palbase 0.6.2 → 0.7.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 (65) hide show
  1. package/dist/ai/index.js +2 -14
  2. package/dist/backend/engine.js +2 -2
  3. package/dist/backend/env.js +1 -1
  4. package/dist/backend/index.js +8 -8
  5. package/dist/backend/stack.js +1 -1
  6. package/dist/backend/test.js +2 -2
  7. package/dist/chunks/3ALGILOX.js +2 -0
  8. package/dist/chunks/{GVFZM4BI.js → 5ZJCEQV5.js} +3 -3
  9. package/dist/chunks/AIIKXCWN.js +2 -0
  10. package/dist/chunks/{53FS342F.js → BKVU4I5R.js} +2 -2
  11. package/dist/chunks/ELEE7XO2.js +18 -0
  12. package/dist/chunks/{DRTZ33XF.js → G3BK7L3J.js} +2 -2
  13. package/dist/chunks/G7E26S3Y.js +13 -0
  14. package/dist/chunks/H2EPK74V.js +20 -0
  15. package/dist/chunks/{VP7V7YRH.js → HEXIIGWS.js} +2 -2
  16. package/dist/chunks/{IYCW6PWG.js → JS3TTUHS.js} +2 -2
  17. package/dist/chunks/{SUX2BJG4.js → KDSWK3XW.js} +1 -1
  18. package/dist/chunks/{U4OZ4HOF.js → L3NTI4AZ.js} +2 -2
  19. package/dist/chunks/LEBVOSG6.js +4 -0
  20. package/dist/chunks/OIA7KLRW.js +2 -0
  21. package/dist/chunks/{AYY4J3B2.js → PJVWGUIT.js} +1 -1
  22. package/dist/chunks/{A3CDCPXX.js → SU7BP6VF.js} +1 -1
  23. package/dist/chunks/{KLANM6M6.js → X3MTLJRV.js} +1 -1
  24. package/dist/chunks/{SXH5AIQX.js → ZBOJEH7K.js} +2 -2
  25. package/dist/cli.js +133 -133
  26. package/dist/refuse/ai.js +1 -1
  27. package/dist/refuse/backend.js +1 -1
  28. package/dist/refuse/server.js +1 -1
  29. package/dist/server/index.js +2 -2
  30. package/dist/server/testing.js +2 -2
  31. package/dist/web/index.js +2 -2
  32. package/dist/web/palbe.js +2 -2
  33. package/dist/web/paywall.js +2 -2
  34. package/dist/web/ssr.js +2 -2
  35. package/dist/web/vite.js +2 -2
  36. package/package.json +2 -2
  37. package/types/ai/src/ai.d.ts +2 -4
  38. package/types/ai/src/chats.d.ts +40 -10
  39. package/types/ai/src/index.d.ts +2 -2
  40. package/types/ai/src/tools.d.ts +3 -8
  41. package/types/backend/src/container.d.ts +2 -2
  42. package/types/backend/src/engine.d.ts +1 -4
  43. package/types/backend/src/gateways.d.ts +250 -0
  44. package/types/backend/src/index.d.ts +2 -2
  45. package/types/backend/src/openapi.d.ts +3 -6
  46. package/types/backend/src/runtime.d.ts +39 -2
  47. package/types/internal/src/chat.d.ts +7 -39
  48. package/types/internal/src/modules/ai.d.ts +68 -35
  49. package/types/internal/src/modules/realtime.d.ts +9 -1
  50. package/types/web/src/backends.d.ts +19 -12
  51. package/types/web/src/chat.d.ts +118 -0
  52. package/types/web/src/client.d.ts +0 -3
  53. package/types/web/src/gateways.d.ts +89 -0
  54. package/types/web/src/index.d.ts +3 -3
  55. package/types/web/src/socket.d.ts +18 -2
  56. package/dist/chunks/2RG3I7LX.js +0 -6
  57. package/dist/chunks/A76UZBAF.js +0 -2
  58. package/dist/chunks/AD5LBZAB.js +0 -4
  59. package/dist/chunks/DRGYTL6T.js +0 -20
  60. package/dist/chunks/IVEAUFGE.js +0 -13
  61. package/dist/chunks/KL7FIRII.js +0 -2
  62. package/types/backend/src/channels.d.ts +0 -81
  63. package/types/backend/src/rooms.d.ts +0 -178
  64. package/types/web/src/ai.d.ts +0 -224
  65. package/types/web/src/rooms.d.ts +0 -61
@@ -12,6 +12,14 @@ export interface SocketOptions {
12
12
  replyTimeoutMs?: number;
13
13
  }
14
14
  export type ChannelState = 'closed' | 'joining' | 'joined' | 'refused';
15
+ export interface ChannelOptions {
16
+ /**
17
+ * On a durable channel, the number to be sent its log after: what was missed
18
+ * since (0: all it keeps). Left out, the channel is heard from its join on.
19
+ * Either way it is joined again after the last number it was sent.
20
+ */
21
+ after?: number;
22
+ }
15
23
  /**
16
24
  * What became of a push: the server's answer — `ok` with its response, or
17
25
  * `error` with `{ reason }` — or, when none came, `timeout` (`no reply`: the
@@ -26,13 +34,20 @@ export declare class Channel {
26
34
  state: ChannelState;
27
35
  /** Why the server refused the last join, when it did. */
28
36
  refusal?: Record<string, unknown>;
37
+ /**
38
+ * A durable channel's number: of the last broadcast it was sent (each carries
39
+ * its `seq`), or of the one its join started after. A socket that drops joins
40
+ * it again after it, and is sent what it missed in order, once. Undefined on
41
+ * a channel that keeps no log.
42
+ */
43
+ logSeq?: number;
29
44
  joinRef: string | null;
30
45
  private listeners;
31
46
  private closers;
32
47
  private joinWaiters;
33
48
  readonly name: string;
34
49
  private socket;
35
- constructor(name: string, socket: RealtimeSocket);
50
+ constructor(name: string, socket: RealtimeSocket, opts?: ChannelOptions);
36
51
  get topic(): string;
37
52
  /** Resolves once joined; rejects with the server's reason when refused. */
38
53
  join(): Promise<void>;
@@ -69,7 +84,8 @@ export declare class RealtimeSocket {
69
84
  reconnects: number;
70
85
  private opts;
71
86
  constructor(opts: SocketOptions);
72
- channel(name: string): Channel;
87
+ /** The channel by its name; opts are the first caller's (a channel already made keeps its own). */
88
+ channel(name: string, opts?: ChannelOptions): Channel;
73
89
  /** Closes the socket; every channel is closed (the app joins again — as the next user, if one signs in). */
74
90
  disconnect(): void;
75
91
  /** A new token for every joined channel (the session was refreshed). */
@@ -1,6 +0,0 @@
1
- /*! palbase 0.6.2 — Palbase SDK License (see LICENSE) */
2
- import{a as C,b as E}from"./IYCW6PWG.js";async function*S(e,t={}){let n=e.getReader(),o=new TextDecoder,r="",a="",i=[],g,w=()=>{n.cancel().catch(()=>{})};t.signal?.addEventListener("abort",w,{once:!0});try{if(t.signal?.aborted)return;for(;;){let{done:v,value:A}=await n.read();if(v||t.signal?.aborted)return;t.onBytes?.(),r+=o.decode(A,{stream:!0});for(let y=r.indexOf(`
3
- `);y>=0;y=r.indexOf(`
4
- `)){let s=r.slice(0,r[y-1]==="\r"?y-1:y);r=r.slice(y+1),s===""?(a!==""&&(yield g===void 0?{event:a,data:i.join(`
5
- `)}:{event:a,data:i.join(`
6
- `),id:g}),a="",i=[],g=void 0):s.startsWith("event:")?a=k(s,6):s.startsWith("data:")?i.push(k(s,5)):s.startsWith("id:")&&(g=k(s,3))}}}finally{t.signal?.removeEventListener("abort",w);try{await n.cancel()}catch{}}}function k(e,t){let n=e.slice(t);return n.startsWith(" ")?n.slice(1):n}function P(e){let t=0;for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);o<128?t+=1:o<2048?t+=2:o>=55296&&o<=56319&&n+1<e.length&&(e.charCodeAt(n+1)&64512)===56320?(t+=4,n++):t+=3}return t}function $(e,t){if(t<=0)return 0;let n=0;for(let o=0;o<e.length;o++){let r=e.charCodeAt(o),a=3,i=1;if(r<128?a=1:r<2048?a=2:r>=55296&&r<=56319&&o+1<e.length&&(e.charCodeAt(o+1)&64512)===56320&&(a=4,i=2),n+=a,n>=t)return o+i;o+=i-1}return e.length}function j(e,t){return e.slice($(e,t))}var M={too_many_streams:()=>"too many chat streams are open at once (4 a user, 32 a project): close one \u2014 chat.close(), or leave a stream's loop \u2014 then follow again",too_many_chats:()=>"this user is in as many chats as they may be (100): delete or leave one before starting another",too_many_endpoints:()=>"the project holds as many tool endpoints as it may (32): delete one (ai.endpoints.delete) before putting another",too_many_messages:e=>`this user has sent as many messages this minute as the project allows${e.retryAfter!==void 0?`: write again in ${e.retryAfter} s`:""}`,history_full:()=>"the project keeps as much chat history as it may: delete chats to write again",not_your_turn:()=>"this turn is another member's: only the member who started it (or the project's server) answers its tools and decides its approvals",image_not_found:()=>"a picture given is not a file of the project's storage: upload it first (storage.from(bucket).upload(path, file)) and give that bucket and path",storage_unavailable:e=>`the project's storage did not answer when the model was to read a picture${e.retryAfter!==void 0?`: try again in ${e.retryAfter} s`:"; try again shortly"}`},O=new WeakSet;function R(e){if(!(e instanceof E)||O.has(e))return e;let t=M[e.code];if(!t)return e;let n=new E({op:e.op,status:e.status,code:e.code,message:`${t(e)} (${e.op}: ${e.status} ${e.code})`,requestId:e.requestId,retryAfter:e.retryAfter,body:e.body,cause:e});return O.add(n),n}function V(e){return e.catch(t=>{throw R(t)})}var m=class extends Error{constructor(t){super(t),this.name="StreamCut"}};function Y(e,t={}){let n=t.resumeFor??12e4,o=t.idleFor??45e3,r=t.signal,a=t.after,i=t.response,g=new Map;i!==void 0&&g.set(i,t.offset??0);let w=!1,v=()=>{let s={};return a!==void 0&&(s.after=a),i!==void 0&&(s.response=i,s.offset=g.get(i)??0),s};function A(s,_,h){let f=h!==void 0&&/^\d+$/.test(h)?Number(h):void 0;if(f!==void 0&&a!==void 0&&f<=a)return;let c;try{c=C(JSON.parse(_))}catch{throw new m(`a ${s} frame is not JSON`)}if(typeof c!="object"||c===null)throw new m(`a ${s} frame is not an object`);let p;switch(s){case"message":p={type:"message",seq:f??0,message:c};break;case"turn":{let d={...c,type:"turn",seq:f??0};d.waiting??=null,d.error??=null,(d.status==="running"||d.status==="waiting")&&(i=d.response_id),p=d;break}case"text":{let d=String(c.response_id),l=Number(c.offset),u=String(c.text??"");if(!Number.isInteger(l)||l<0)throw new m("a text frame names no offset");i=d;let b=g.get(d)??0,x=l+P(u);if(x<=b)return;let T=l>=b?u:j(u,b-l);g.set(d,x),p={type:"text",response_id:d,offset:Math.max(l,b),text:T};break}case"reset":{let d=String(c.response_id),l=Number(c.offset),u=g.get(d)??0;if(!Number.isInteger(l)||l<0||l>=u)return;g.set(d,l),p={type:"reset",response_id:d,offset:l};break}case"tool":case"agent":case"voice":p={...c,type:s,seq:f??0};break;default:break}return f!==void 0&&(a=f),p}async function*y(){let s=Date.now()+n,_;for(let h=0;;h++){if(r?.aborted)throw r.reason;let f=new AbortController,c=()=>f.abort(r?.reason);r?.addEventListener("abort",c,{once:!0});let p,d=()=>{clearTimeout(p),p=setTimeout(()=>f.abort(new m(`no byte for ${o} ms`)),o)},l;try{let u=await e(v(),f.signal);if(!u.body)throw new m("the stream has no body");d();let b=S(u.body,{signal:f.signal,onBytes:()=>{d(),s=Date.now()+n,h=0}});for await(let x of b){let T=A(x.event,x.data,x.id);T&&(yield T)}_=new m("the stream ended")}catch(u){if(r?.aborted)throw r.reason;if(u instanceof E){if(u.status>0&&u.status<500&&u.status!==429||u.code==="too_many_streams")throw R(u);u.retryAfter!==void 0&&(l=u.retryAfter*1e3)}_=f.signal.aborted&&f.signal.reason instanceof m?f.signal.reason:u}finally{clearTimeout(p),r?.removeEventListener("abort",c),f.abort()}if(Date.now()+(l??0)>s)throw _;await L(l??Math.min(250*2**Math.min(h,4),4e3),r)}}return{get position(){return v()},[Symbol.asyncIterator](){if(w)throw new TypeError("a chat stream is read once: follow the chat again from its position for another reader");return w=!0,y()}}}function L(e,t){return new Promise((n,o)=>{if(t?.aborted)return o(t.reason);let a=setTimeout(()=>{t?.removeEventListener("abort",i),n()},e),i=()=>{clearTimeout(a),o(t?.reason)};t?.addEventListener("abort",i,{once:!0})})}var N=new Set(["image/png","image/jpeg","image/webp","image/gif"]);function H(e){return Array.isArray(e)&&e.length>0&&e.every(q)?e.map(F):q(e)?[F(e)]:e==null?[{type:"text",text:""}]:typeof e=="string"?[{type:"text",text:e}]:[{type:"text",text:JSON.stringify(e)??String(e)}]}function q(e){if(typeof e!="object"||e===null)return!1;let t=e;return t.type==="text"?typeof t.text=="string":t.type==="image"?(typeof t.mediaType=="string"||typeof t.media_type=="string")&&(typeof t.data=="string"||t.data instanceof Uint8Array):t.type===void 0&&typeof t.mediaType=="string"&&t.bytes instanceof Uint8Array}function F(e){if("type"in e&&e.type==="text")return{type:"text",text:e.text};let t="bytes"in e||"mediaType"in e?e.mediaType:e.media_type;if(!N.has(t))throw new TypeError(`a tool's picture is image/png, image/jpeg, image/webp or image/gif (got ${JSON.stringify(t)})`);let n="bytes"in e?e.bytes:e.data;return{type:"image",media_type:t,data:typeof n=="string"?n:B(n)}}function B(e){let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)}export{S as a,P as b,$ as c,j as d,R as e,V as f,Y as g,H as h};
@@ -1,2 +0,0 @@
1
- /*! palbase 0.6.2 — Palbase SDK License (see LICENSE) */
2
- import{c as s}from"./IYCW6PWG.js";import{a as n}from"./A3CDCPXX.js";var x=["ai.response.completed","ai.response.failed","file.deleted","file.moved","file.uploaded","purchases.catalog.applied","purchases.catalog.changed","purchases.credits.depleted","purchases.credits.low","purchases.customer.changed","purchases.customer.erased","purchases.customer.merged","purchases.entitlement.changed","purchases.ownership.transferred","purchases.paywall.published","purchases.purchase.completed","purchases.quota.exhausted","purchases.quota.threshold","purchases.refund.changed","purchases.store.changed","purchases.subscription.changed","stores.action.changed","stores.app.changed","stores.apple.changed","stores.delivery.changed","stores.delivery.requested","stores.group.changed","stores.package.changed"];var a={};n(a,{client:()=>h});function h(t){return{async listAgents(e){return t.send({op:"ListAgents",method:"GET",path:"/ai/agents",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async putAgent(e){return t.send({op:"PutAgent",method:"PUT",path:"/ai/agents/"+s("PutAgent","name",e.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deleteAgent(e){return t.send({op:"DeleteAgent",method:"DELETE",path:"/ai/agents/"+s("DeleteAgent","name",e.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:e.signal})},async listChats(e){return t.send({op:"ListChats",method:"GET",path:"/ai/chats",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async createChat(e){return t.send({op:"CreateChat",method:"POST",path:"/ai/chats",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getChat(e){return t.send({op:"GetChat",method:"GET",path:"/ai/chats/"+s("GetChat","chat_id",e.path.chat_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async deleteChat(e){return t.send({op:"DeleteChat",method:"DELETE",path:"/ai/chats/"+s("DeleteChat","chat_id",e.path.chat_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},signal:e.signal})},async decideChatApproval(e){return t.send({op:"DecideChatApproval",method:"POST",path:"/ai/chats/"+s("DecideChatApproval","chat_id",e.path.chat_id)+"/approvals/"+s("DecideChatApproval","approval_id",e.path.approval_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async putChatMember(e){return t.send({op:"PutChatMember",method:"PUT",path:"/ai/chats/"+s("PutChatMember","chat_id",e.path.chat_id)+"/members/"+s("PutChatMember","user_id",e.path.user_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deleteChatMember(e){return t.send({op:"DeleteChatMember",method:"DELETE",path:"/ai/chats/"+s("DeleteChatMember","chat_id",e.path.chat_id)+"/members/"+s("DeleteChatMember","user_id",e.path.user_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},signal:e.signal})},async listChatMessages(e){return t.send({op:"ListChatMessages",method:"GET",path:"/ai/chats/"+s("ListChatMessages","chat_id",e.path.chat_id)+"/messages",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async sendChatMessage(e){return t.send({op:"SendChatMessage",method:"POST",path:"/ai/chats/"+s("SendChatMessage","chat_id",e.path.chat_id)+"/messages",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json",202:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async sendSubagentMessage(e){return t.send({op:"SendSubagentMessage",method:"POST",path:"/ai/chats/"+s("SendSubagentMessage","chat_id",e.path.chat_id)+"/runs/"+s("SendSubagentMessage","run_id",e.path.run_id)+"/messages",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async stopChat(e){return t.send({op:"StopChat",method:"POST",path:"/ai/chats/"+s("StopChat","chat_id",e.path.chat_id)+"/stop",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async followChat(e){return t.send({op:"FollowChat",method:"GET",path:"/ai/chats/"+s("FollowChat","chat_id",e.path.chat_id)+"/stream",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"raw"},query:e.query,signal:e.signal})},async answerChatToolCall(e){return t.send({op:"AnswerChatToolCall",method:"POST",path:"/ai/chats/"+s("AnswerChatToolCall","chat_id",e.path.chat_id)+"/tool-outputs/"+s("AnswerChatToolCall","call_id",e.path.call_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listChatTurnArtifacts(e){return t.send({op:"ListChatTurnArtifacts",method:"GET",path:"/ai/chats/"+s("ListChatTurnArtifacts","chat_id",e.path.chat_id)+"/turns/"+s("ListChatTurnArtifacts","response_id",e.path.response_id)+"/artifacts",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async getChatTurnArtifact(e){return t.send({op:"GetChatTurnArtifact",method:"GET",path:"/ai/chats/"+s("GetChatTurnArtifact","chat_id",e.path.chat_id)+"/turns/"+s("GetChatTurnArtifact","response_id",e.path.response_id)+"/artifacts/"+s("GetChatTurnArtifact","artifact_id",e.path.artifact_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"raw"},signal:e.signal})},async getChatTurnCost(e){return t.send({op:"GetChatTurnCost",method:"GET",path:"/ai/chats/"+s("GetChatTurnCost","chat_id",e.path.chat_id)+"/turns/"+s("GetChatTurnCost","response_id",e.path.response_id)+"/cost",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async startChatVoice(e){return t.send({op:"StartChatVoice",method:"POST",path:"/ai/chats/"+s("StartChatVoice","chat_id",e.path.chat_id)+"/voice",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async closeChatVoice(e){return t.send({op:"CloseChatVoice",method:"DELETE",path:"/ai/chats/"+s("CloseChatVoice","chat_id",e.path.chat_id)+"/voice/"+s("CloseChatVoice","voice_id",e.path.voice_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async commandChatVoice(e){return t.send({op:"CommandChatVoice",method:"POST",path:"/ai/chats/"+s("CommandChatVoice","chat_id",e.path.chat_id)+"/voice/"+s("CommandChatVoice","voice_id",e.path.voice_id)+"/commands",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async createEmbeddings(e){return t.send({op:"CreateEmbeddings",method:"POST",path:"/ai/embeddings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listEndpoints(e){return t.send({op:"ListEndpoints",method:"GET",path:"/ai/endpoints",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async putEndpoint(e){return t.send({op:"PutEndpoint",method:"PUT",path:"/ai/endpoints/"+s("PutEndpoint","name",e.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deleteEndpoint(e){return t.send({op:"DeleteEndpoint",method:"DELETE",path:"/ai/endpoints/"+s("DeleteEndpoint","name",e.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:e.signal})},async createImage(e){return t.send({op:"CreateImage",method:"POST",path:"/ai/images",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getImage(e){return t.send({op:"GetImage",method:"GET",path:"/ai/images/"+s("GetImage","image_id",e.path.image_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async getImageFile(e){return t.send({op:"GetImageFile",method:"GET",path:"/ai/images/"+s("GetImageFile","image_id",e.path.image_id)+"/files/"+s("GetImageFile","position",e.path.position),auth:[["SecretKeyAuth"]],answers:{200:"raw"},signal:e.signal})},async listModels(e){return t.send({op:"ListModels",method:"GET",path:"/ai/models",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async listProviders(e){return t.send({op:"ListProviders",method:"GET",path:"/ai/providers",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async connectProvider(e){return t.send({op:"ConnectProvider",method:"PUT",path:"/ai/providers/"+s("ConnectProvider","provider",e.path.provider),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async disconnectProvider(e){return t.send({op:"DisconnectProvider",method:"DELETE",path:"/ai/providers/"+s("DisconnectProvider","provider",e.path.provider),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:e.signal})},async listRepos(e){return t.send({op:"ListRepos",method:"GET",path:"/ai/repos",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async putRepo(e){return t.send({op:"PutRepo",method:"PUT",path:"/ai/repos/"+s("PutRepo","name",e.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deleteRepo(e){return t.send({op:"DeleteRepo",method:"DELETE",path:"/ai/repos/"+s("DeleteRepo","name",e.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:e.signal})},async createResponse(e){return t.send({op:"CreateResponse",method:"POST",path:"/ai/responses",auth:[["SecretKeyAuth"]],answers:{200:"raw",202:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getResponse(e){return t.send({op:"GetResponse",method:"GET",path:"/ai/responses/"+s("GetResponse","response_id",e.path.response_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async cancelResponse(e){return t.send({op:"CancelResponse",method:"POST",path:"/ai/responses/"+s("CancelResponse","response_id",e.path.response_id)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async followResponse(e){return t.send({op:"FollowResponse",method:"GET",path:"/ai/responses/"+s("FollowResponse","response_id",e.path.response_id)+"/live",auth:[["SecretKeyAuth"]],answers:{200:"raw"},query:e.query,signal:e.signal})},async getSettings(e){return t.send({op:"GetSettings",method:"GET",path:"/ai/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async putSettings(e){return t.send({op:"PutSettings",method:"PUT",path:"/ai/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listUsage(e){return t.send({op:"ListUsage",method:"GET",path:"/ai/usage",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})}}}var r={};n(r,{client:()=>b});function b(t){return{async alias(e){return t.send({op:"Alias",method:"POST",path:"/analytics/alias",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"empty"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async batch(e){return t.send({op:"Batch",method:"POST",path:"/analytics/batch",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"json",207:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getEventBreakdown(e){return t.send({op:"GetEventBreakdown",method:"GET",path:"/analytics/breakdown",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async capture(e){return t.send({op:"Capture",method:"POST",path:"/analytics/capture",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"empty"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async sendConsoleHistory(e){return t.send({op:"SendConsoleHistory",method:"POST",path:"/analytics/console-breadcrumbs",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getConsoleConfig(e){return t.send({op:"GetConsoleConfig",method:"GET",path:"/analytics/console-breadcrumbs/config",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async listConsoleRecords(e){return t.send({op:"ListConsoleRecords",method:"GET",path:"/analytics/console-records",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async listEventNames(e){return t.send({op:"ListEventNames",method:"GET",path:"/analytics/event-names",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async listEvents(e){return t.send({op:"ListEvents",method:"GET",path:"/analytics/events",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async getEventTimeline(e){return t.send({op:"GetEventTimeline",method:"GET",path:"/analytics/events/timeline",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async runFunnel(e){return t.send({op:"RunFunnel",method:"POST",path:"/analytics/funnel",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async identify(e){return t.send({op:"Identify",method:"POST",path:"/analytics/identify",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"empty"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async page(e){return t.send({op:"Page",method:"POST",path:"/analytics/page",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"empty"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async sendPerf(e){return t.send({op:"SendPerf",method:"POST",path:"/analytics/perf",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listPerfGroups(e){return t.send({op:"ListPerfGroups",method:"GET",path:"/analytics/perf/client",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async getPerfConfig(e){return t.send({op:"GetPerfConfig",method:"GET",path:"/analytics/perf/config",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json",304:"empty"},headers:e?.headers,signal:e?.signal})},async getPerfTimeline(e){return t.send({op:"GetPerfTimeline",method:"GET",path:"/analytics/perf/timeline",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async listRequestLines(e){return t.send({op:"ListRequestLines",method:"GET",path:"/analytics/requests",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async getMachineTraffic(e){return t.send({op:"GetMachineTraffic",method:"GET",path:"/analytics/machines/"+s("GetMachineTraffic","name",e.path.name)+"/traffic",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async runRetention(e){return t.send({op:"RunRetention",method:"POST",path:"/analytics/retention",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async screen(e){return t.send({op:"Screen",method:"POST",path:"/analytics/screen",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"empty"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getSettings(e){return t.send({op:"GetSettings",method:"GET",path:"/analytics/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async putSettings(e){return t.send({op:"PutSettings",method:"PUT",path:"/analytics/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getSummary(e){return t.send({op:"GetSummary",method:"GET",path:"/analytics/summary",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async listTraces(e){return t.send({op:"ListTraces",method:"GET",path:"/analytics/traces",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async sendTrace(e){return t.send({op:"SendTrace",method:"POST",path:"/analytics/traces",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"empty"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async sendTraceBatch(e){return t.send({op:"SendTraceBatch",method:"POST",path:"/analytics/traces/batch",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"json",207:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getTraceHops(e){return t.send({op:"GetTraceHops",method:"GET",path:"/analytics/traces/by-trace",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async listSessionTraces(e){return t.send({op:"ListSessionTraces",method:"GET",path:"/analytics/traces/session",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async getTraceSummary(e){return t.send({op:"GetTraceSummary",method:"GET",path:"/analytics/traces/summary",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async getTraceTimeline(e){return t.send({op:"GetTraceTimeline",method:"GET",path:"/analytics/traces/timeline",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})}}}var i={};n(i,{client:()=>_});function _(t){return{async getAppleAppSiteAssociation(e){return t.send({op:"GetAppleAppSiteAssociation",method:"GET",path:"/.well-known/apple-app-site-association",auth:[],answers:{200:"json"},signal:e?.signal})},async getAssetLinks(e){return t.send({op:"GetAssetLinks",method:"GET",path:"/.well-known/assetlinks.json",auth:[],answers:{200:"json"},signal:e?.signal})},async getJwks(e){return t.send({op:"GetJWKS",method:"GET",path:"/.well-known/jwks.json",auth:[],answers:{200:"json"},signal:e?.signal})},async getOidcDiscovery(e){return t.send({op:"GetOIDCDiscovery",method:"GET",path:"/.well-known/openid-configuration",auth:[],answers:{200:"json"},signal:e?.signal})},async getWebAuthnRelatedOrigins(e){return t.send({op:"GetWebAuthnRelatedOrigins",method:"GET",path:"/.well-known/webauthn",auth:[],answers:{200:"json"},signal:e?.signal})},async adminVerifyDeviceAssertion(e){return t.send({op:"AdminVerifyDeviceAssertion",method:"POST",path:"/admin/attest/devices/assert",auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminGetAttestPolicy(e){return t.send({op:"AdminGetAttestPolicy",method:"GET",path:"/admin/attest/devices/attest-policy",auth:[["AdminAuth"]],answers:{200:"json"},signal:e?.signal})},async adminGetAttestObservations(e){return t.send({op:"AdminGetAttestObservations",method:"GET",path:"/admin/attest/devices/observations",auth:[["AdminAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async adminRecordAttestObservations(e){return t.send({op:"AdminRecordAttestObservations",method:"POST",path:"/admin/attest/devices/observations",auth:[["AdminAuth"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminListAuditEvents(e){return t.send({op:"AdminListAuditEvents",method:"GET",path:"/admin/audit",auth:[["AdminAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async adminExportAuditEvents(e){return t.send({op:"AdminExportAuditEvents",method:"GET",path:"/admin/audit/export",auth:[["AdminAuth"]],answers:{200:"raw"},query:e?.query,signal:e?.signal})},async adminVerifyAuditTrail(e){return t.send({op:"AdminVerifyAuditTrail",method:"GET",path:"/admin/audit/verify",auth:[["AdminAuth"]],answers:{200:"json"},signal:e?.signal})},async adminGetAuthSettings(e){return t.send({op:"AdminGetAuthSettings",method:"GET",path:"/admin/auth-settings",auth:[["AdminAuth"]],answers:{200:"json"},signal:e?.signal})},async adminUpdateAuthSettings(e){return t.send({op:"AdminUpdateAuthSettings",method:"PUT",path:"/admin/auth-settings",auth:[["AdminAuth"]],answers:{200:"json"},headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminGetBreachWatch(e){return t.send({op:"AdminGetBreachWatch",method:"GET",path:"/admin/breach-watch",auth:[["AdminAuth"]],answers:{200:"json"},signal:e?.signal})},async adminListHooks(e){return t.send({op:"AdminListHooks",method:"GET",path:"/admin/hooks",auth:[["AdminAuth"]],answers:{200:"json"},signal:e?.signal})},async adminCreateHook(e){return t.send({op:"AdminCreateHook",method:"POST",path:"/admin/hooks",auth:[["AdminAuth"]],answers:{201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminUpdateHook(e){return t.send({op:"AdminUpdateHook",method:"PUT",path:"/admin/hooks/"+s("AdminUpdateHook","id",e.path.id),auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminDeleteHook(e){return t.send({op:"AdminDeleteHook",method:"DELETE",path:"/admin/hooks/"+s("AdminDeleteHook","id",e.path.id),auth:[["AdminAuth"]],answers:{204:"empty"},signal:e.signal})},async adminListHookExecutions(e){return t.send({op:"AdminListHookExecutions",method:"GET",path:"/admin/hooks/"+s("AdminListHookExecutions","id",e.path.id)+"/executions",auth:[["AdminAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async adminListIntegrations(e){return t.send({op:"AdminListIntegrations",method:"GET",path:"/admin/integrations",auth:[["AdminAuth"]],answers:{200:"json"},signal:e?.signal})},async adminPutIntegration(e){return t.send({op:"AdminPutIntegration",method:"PUT",path:"/admin/integrations/"+s("AdminPutIntegration","name",e.path.name),auth:[["AdminAuth"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminDeleteIntegration(e){return t.send({op:"AdminDeleteIntegration",method:"DELETE",path:"/admin/integrations/"+s("AdminDeleteIntegration","name",e.path.name),auth:[["AdminAuth"]],answers:{204:"empty"},signal:e.signal})},async adminListOAuthClients(e){return t.send({op:"AdminListOAuthClients",method:"GET",path:"/admin/oauth-clients",auth:[["AdminAuth"]],answers:{200:"json"},signal:e?.signal})},async adminCreateOAuthClient(e){return t.send({op:"AdminCreateOAuthClient",method:"POST",path:"/admin/oauth-clients",auth:[["AdminAuth"]],answers:{201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminGetOAuthClient(e){return t.send({op:"AdminGetOAuthClient",method:"GET",path:"/admin/oauth-clients/"+s("AdminGetOAuthClient","id",e.path.id),auth:[["AdminAuth"]],answers:{200:"json"},signal:e.signal})},async adminDeleteOAuthClient(e){return t.send({op:"AdminDeleteOAuthClient",method:"DELETE",path:"/admin/oauth-clients/"+s("AdminDeleteOAuthClient","id",e.path.id),auth:[["AdminAuth"]],answers:{204:"empty"},signal:e.signal})},async adminUpdateOAuthClient(e){return t.send({op:"AdminUpdateOAuthClient",method:"PATCH",path:"/admin/oauth-clients/"+s("AdminUpdateOAuthClient","id",e.path.id),auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminListProviders(e){return t.send({op:"AdminListProviders",method:"GET",path:"/admin/providers",auth:[["AdminAuth"]],answers:{200:"json"},signal:e?.signal})},async adminGetPhoneSettings(e){return t.send({op:"AdminGetPhoneSettings",method:"GET",path:"/admin/providers/phone/settings",auth:[["AdminAuth"]],answers:{200:"json"},signal:e?.signal})},async adminUpdatePhoneSettings(e){return t.send({op:"AdminUpdatePhoneSettings",method:"PUT",path:"/admin/providers/phone/settings",auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminToggleProvider(e){return t.send({op:"AdminToggleProvider",method:"POST",path:"/admin/providers/"+s("AdminToggleProvider","name",e.path.name),auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminListRoles(e){return t.send({op:"AdminListRoles",method:"GET",path:"/admin/roles",auth:[["AdminAuth"]],answers:{200:"json"},signal:e?.signal})},async adminUpsertRole(e){return t.send({op:"AdminUpsertRole",method:"PUT",path:"/admin/roles/"+s("AdminUpsertRole","name",e.path.name),auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminDeleteRole(e){return t.send({op:"AdminDeleteRole",method:"DELETE",path:"/admin/roles/"+s("AdminDeleteRole","name",e.path.name),auth:[["AdminAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async adminListServiceAccounts(e){return t.send({op:"AdminListServiceAccounts",method:"GET",path:"/admin/service-accounts",auth:[["AdminAuth"]],answers:{200:"json"},signal:e?.signal})},async adminCreateServiceAccount(e){return t.send({op:"AdminCreateServiceAccount",method:"POST",path:"/admin/service-accounts",auth:[["AdminAuth"]],answers:{201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminGetServiceAccount(e){return t.send({op:"AdminGetServiceAccount",method:"GET",path:"/admin/service-accounts/"+s("AdminGetServiceAccount","id",e.path.id),auth:[["AdminAuth"]],answers:{200:"json"},signal:e.signal})},async adminRevokeServiceAccount(e){return t.send({op:"AdminRevokeServiceAccount",method:"DELETE",path:"/admin/service-accounts/"+s("AdminRevokeServiceAccount","id",e.path.id),auth:[["AdminAuth"]],answers:{204:"empty"},signal:e.signal})},async adminRotateServiceAccount(e){return t.send({op:"AdminRotateServiceAccount",method:"POST",path:"/admin/service-accounts/"+s("AdminRotateServiceAccount","id",e.path.id)+"/rotate",auth:[["AdminAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async adminListSessions(e){return t.send({op:"AdminListSessions",method:"GET",path:"/admin/sessions",auth:[["AdminAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async adminRevokeSession(e){return t.send({op:"AdminRevokeSession",method:"DELETE",path:"/admin/sessions/"+s("AdminRevokeSession","id",e.path.id),auth:[["AdminAuth"]],answers:{204:"empty"},signal:e.signal})},async adminListSigningKeys(e){return t.send({op:"AdminListSigningKeys",method:"GET",path:"/admin/signing-keys",auth:[["AdminAuth"]],answers:{200:"json"},signal:e?.signal})},async adminRotateSigningKey(e){return t.send({op:"AdminRotateSigningKey",method:"POST",path:"/admin/signing-keys/rotate",auth:[["AdminAuth"]],answers:{200:"json"},signal:e?.signal})},async socialAdminConfig(e){return t.send({op:"SocialAdminConfig",method:"GET",path:"/admin/social-auth",auth:[["AdminAuth"]],answers:{200:"json"},signal:e?.signal})},async socialCredentialPut(e){return t.send({op:"SocialCredentialPut",method:"PUT",path:"/admin/social-auth/credentials/"+s("SocialCredentialPut","key",e.path.key),auth:[["AdminAuth"]],answers:{200:"json"},headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async socialCredentialDelete(e){return t.send({op:"SocialCredentialDelete",method:"DELETE",path:"/admin/social-auth/credentials/"+s("SocialCredentialDelete","key",e.path.key),auth:[["AdminAuth"]],answers:{204:"empty"},headers:e.headers,signal:e.signal})},async socialProviderPatch(e){return t.send({op:"SocialProviderPatch",method:"PATCH",path:"/admin/social-auth/providers/"+s("SocialProviderPatch","provider",e.path.provider),auth:[["AdminAuth"]],answers:{200:"json"},headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminGetStats(e){return t.send({op:"AdminGetStats",method:"GET",path:"/admin/stats",auth:[["AdminAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async adminSendTestTemplate(e){return t.send({op:"AdminSendTestTemplate",method:"POST",path:"/admin/templates/"+s("AdminSendTestTemplate","key",e.path.key)+"/send-test",auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminListTestUsers(e){return t.send({op:"AdminListTestUsers",method:"GET",path:"/admin/test-users",auth:[["AdminAuth"]],answers:{200:"json"},signal:e?.signal})},async adminCreateTestUsers(e){return t.send({op:"AdminCreateTestUsers",method:"POST",path:"/admin/test-users",auth:[["AdminAuth"]],answers:{201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminSetTestUserPhone(e){return t.send({op:"AdminSetTestUserPhone",method:"PUT",path:"/admin/test-users/phone",auth:[["AdminAuth"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminDeleteTestUser(e){return t.send({op:"AdminDeleteTestUser",method:"DELETE",path:"/admin/test-users/"+s("AdminDeleteTestUser","uid",e.path.uid),auth:[["AdminAuth"]],answers:{204:"empty"},signal:e.signal})},async adminCreateCustomToken(e){return t.send({op:"AdminCreateCustomToken",method:"POST",path:"/admin/token/custom",auth:[["AdminAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminListUsers(e){return t.send({op:"AdminListUsers",method:"GET",path:"/admin/users",auth:[["AdminAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async adminCreateUser(e){return t.send({op:"AdminCreateUser",method:"POST",path:"/admin/users",auth:[["AdminAuth"]],answers:{201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminImportUsers(e){return t.send({op:"AdminImportUsers",method:"POST",path:"/admin/users/import",auth:[["AdminAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminGetUser(e){return t.send({op:"AdminGetUser",method:"GET",path:"/admin/users/"+s("AdminGetUser","uid",e.path.uid),auth:[["AdminAuth"]],answers:{200:"json"},signal:e.signal})},async adminDeleteUser(e){return t.send({op:"AdminDeleteUser",method:"DELETE",path:"/admin/users/"+s("AdminDeleteUser","uid",e.path.uid),auth:[["AdminAuth"]],answers:{204:"empty"},signal:e.signal})},async adminUpdateUser(e){return t.send({op:"AdminUpdateUser",method:"PATCH",path:"/admin/users/"+s("AdminUpdateUser","uid",e.path.uid),auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminBanUser(e){return t.send({op:"AdminBanUser",method:"POST",path:"/admin/users/"+s("AdminBanUser","uid",e.path.uid)+"/ban",auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async adminListUserConsents(e){return t.send({op:"AdminListUserConsents",method:"GET",path:"/admin/users/"+s("AdminListUserConsents","uid",e.path.uid)+"/consents",auth:[["AdminAuth"]],answers:{200:"json"},signal:e.signal})},async adminRevokeUserCredentials(e){return t.send({op:"AdminRevokeUserCredentials",method:"POST",path:"/admin/users/"+s("AdminRevokeUserCredentials","uid",e.path.uid)+"/credentials/revoke-all",auth:[["AdminAuth"]],answers:{200:"json"},signal:e.signal})},async adminExportUser(e){return t.send({op:"AdminExportUser",method:"GET",path:"/admin/users/"+s("AdminExportUser","uid",e.path.uid)+"/export",auth:[["AdminAuth"]],answers:{200:"json"},signal:e.signal})},async adminListUserMfaFactors(e){return t.send({op:"AdminListUserMFAFactors",method:"GET",path:"/admin/users/"+s("AdminListUserMFAFactors","uid",e.path.uid)+"/mfa",auth:[["AdminAuth"]],answers:{200:"json"},signal:e.signal})},async adminResetUserMfa(e){return t.send({op:"AdminResetUserMFA",method:"DELETE",path:"/admin/users/"+s("AdminResetUserMFA","uid",e.path.uid)+"/mfa",auth:[["AdminAuth"]],answers:{204:"empty"},signal:e.signal})},async adminResetUserPassword(e){return t.send({op:"AdminResetUserPassword",method:"POST",path:"/admin/users/"+s("AdminResetUserPassword","uid",e.path.uid)+"/reset-password",auth:[["AdminAuth"]],answers:{200:"json"},signal:e.signal})},async adminListUserRoles(e){return t.send({op:"AdminListUserRoles",method:"GET",path:"/admin/users/"+s("AdminListUserRoles","uid",e.path.uid)+"/roles",auth:[["AdminAuth"]],answers:{200:"json"},signal:e.signal})},async adminAssignUserRole(e){return t.send({op:"AdminAssignUserRole",method:"PUT",path:"/admin/users/"+s("AdminAssignUserRole","uid",e.path.uid)+"/roles/"+s("AdminAssignUserRole","role",e.path.role),auth:[["AdminAuth"]],answers:{200:"json"},signal:e.signal})},async adminRevokeUserRole(e){return t.send({op:"AdminRevokeUserRole",method:"DELETE",path:"/admin/users/"+s("AdminRevokeUserRole","uid",e.path.uid)+"/roles/"+s("AdminRevokeUserRole","role",e.path.role),auth:[["AdminAuth"]],answers:{200:"json"},signal:e.signal})},async adminRevokeUserSessions(e){return t.send({op:"AdminRevokeUserSessions",method:"POST",path:"/admin/users/"+s("AdminRevokeUserSessions","uid",e.path.uid)+"/sessions/revoke-all",auth:[["AdminAuth"]],answers:{204:"empty"},signal:e.signal})},async adminUnbanUser(e){return t.send({op:"AdminUnbanUser",method:"POST",path:"/admin/users/"+s("AdminUnbanUser","uid",e.path.uid)+"/unban",auth:[["AdminAuth"]],answers:{200:"json"},signal:e.signal})},async signInAnonymously(e){return t.send({op:"SignInAnonymously",method:"POST",path:"/auth/anonymous",auth:[["ApiKeyAuth"]],answers:{201:"json"},headers:e?.headers,body:{kind:"json",contentType:"application/json",value:e?.body},signal:e?.signal})},async convertAnonymousUser(e){return t.send({op:"ConvertAnonymousUser",method:"POST",path:"/auth/anonymous/convert",auth:[["ApiKeyAuth","userJWT"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async verifyAnonymousConversion(e){return t.send({op:"VerifyAnonymousConversion",method:"POST",path:"/auth/anonymous/convert/verify",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async devicePendingRequest(e){return t.send({op:"DevicePendingRequest",method:"GET",path:"/auth/device/requests/"+s("DevicePendingRequest","user_code",e.path.user_code),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e.signal})},async deviceVerifyPage(e){return t.send({op:"DeviceVerifyPage",method:"GET",path:"/auth/device/verify",auth:[["ApiKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async deviceVerifySubmit(e){return t.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:e.body},signal:e.signal})},async listDevices(e){return t.send({op:"ListDevices",method:"GET",path:"/auth/devices",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e?.signal})},async attestAndroidDevice(e){return t.send({op:"AttestAndroidDevice",method:"POST",path:"/auth/devices/attest/android",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async attestIosDevice(e){return t.send({op:"AttestIOSDevice",method:"POST",path:"/auth/devices/attest/ios",auth:[["ApiKeyAuth"]],answers:{200:"json"},headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async bindDeviceKey(e){return t.send({op:"BindDeviceKey",method:"POST",path:"/auth/devices/bind",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async createDeviceChallenge(e){return t.send({op:"CreateDeviceChallenge",method:"POST",path:"/auth/devices/challenge",auth:[["ApiKeyAuth"]],answers:{200:"json"},headers:e?.headers,signal:e?.signal})},async verifyAndroidIntegrity(e){return t.send({op:"VerifyAndroidIntegrity",method:"POST",path:"/auth/devices/verify/android",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deleteDevice(e){return t.send({op:"DeleteDevice",method:"DELETE",path:"/auth/devices/"+s("DeleteDevice","id",e.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e.signal})},async verifyDeviceSignature(e){return t.send({op:"VerifyDeviceSignature",method:"POST",path:"/auth/devices/"+s("VerifyDeviceSignature","id",e.path.id)+"/verify",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listIdentities(e){return t.send({op:"ListIdentities",method:"GET",path:"/auth/identities",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e?.signal})},async unlinkIdentity(e){return t.send({op:"UnlinkIdentity",method:"DELETE",path:"/auth/identities/"+s("UnlinkIdentity","id",e.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e.signal})},async createInstallation(e){return t.send({op:"CreateInstallation",method:"POST",path:"/auth/installations",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async bindInstallation(e){return t.send({op:"BindInstallation",method:"POST",path:"/auth/installations/"+s("BindInstallation","id",e.path.id)+"/bind",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async refreshInstallation(e){return t.send({op:"RefreshInstallation",method:"POST",path:"/auth/installations/"+s("RefreshInstallation","id",e.path.id)+"/refresh",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e.signal})},async revokeInstallation(e){return t.send({op:"RevokeInstallation",method:"POST",path:"/auth/installations/"+s("RevokeInstallation","id",e.path.id)+"/revoke",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e.signal})},async unbindInstallation(e){return t.send({op:"UnbindInstallation",method:"POST",path:"/auth/installations/"+s("UnbindInstallation","id",e.path.id)+"/unbind",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e.signal})},async login(e){return t.send({op:"Login",method:"POST",path:"/auth/login",auth:[["ApiKeyAuth"]],answers:{200:"json"},headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async logout(e){return t.send({op:"Logout",method:"POST",path:"/auth/logout",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e?.signal})},async magicLinkRequest(e){return t.send({op:"MagicLinkRequest",method:"POST",path:"/auth/magic-link",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async magicLinkVerify(e){return t.send({op:"MagicLinkVerify",method:"POST",path:"/auth/magic-link/verify",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getMe(e){return t.send({op:"GetMe",method:"GET",path:"/auth/me",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e?.signal})},async updateMe(e){return t.send({op:"UpdateMe",method:"PATCH",path:"/auth/me",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async mfaChallenge(e){return t.send({op:"MfaChallenge",method:"POST",path:"/auth/mfa/challenge",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async mfaEmailChallenge(e){return t.send({op:"MfaEmailChallenge",method:"POST",path:"/auth/mfa/email/challenge",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async mfaEmailEnroll(e){return t.send({op:"MfaEmailEnroll",method:"POST",path:"/auth/mfa/email/enroll",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e?.signal})},async mfaEmailVerify(e){return t.send({op:"MfaEmailVerify",method:"POST",path:"/auth/mfa/email/verify",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async mfaEnroll(e){return t.send({op:"MfaEnroll",method:"POST",path:"/auth/mfa/enroll",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async mfaListFactors(e){return t.send({op:"MfaListFactors",method:"GET",path:"/auth/mfa/factors",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e?.signal})},async mfaRemoveFactor(e){return t.send({op:"MfaRemoveFactor",method:"DELETE",path:"/auth/mfa/factors/"+s("MfaRemoveFactor","id",e.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async mfaRecovery(e){return t.send({op:"MfaRecovery",method:"POST",path:"/auth/mfa/recovery",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async mfaRegenerateRecoveryCodes(e){return t.send({op:"MfaRegenerateRecoveryCodes",method:"POST",path:"/auth/mfa/recovery-codes/regenerate",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e?.signal})},async mfaSmsChallenge(e){return t.send({op:"MfaSMSChallenge",method:"POST",path:"/auth/mfa/sms/challenge",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async mfaSmsEnroll(e){return t.send({op:"MfaSMSEnroll",method:"POST",path:"/auth/mfa/sms/enroll",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async mfaSmsVerifyEnrollment(e){return t.send({op:"MfaSMSVerifyEnrollment",method:"POST",path:"/auth/mfa/sms/verify",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async mfaVerifyEnrollment(e){return t.send({op:"MfaVerifyEnrollment",method:"POST",path:"/auth/mfa/verify",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async socialCallbackApple(e){return t.send({op:"SocialCallbackApple",method:"GET",path:"/auth/oauth/callback/apple",auth:[],answers:{},signal:e?.signal})},async socialCallbackApplePost(e){return t.send({op:"SocialCallbackApplePost",method:"POST",path:"/auth/oauth/callback/apple",auth:[],answers:{303:"redirect"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:e.body},signal:e.signal})},async socialCallbackGitHub(e){return t.send({op:"SocialCallbackGitHub",method:"GET",path:"/auth/oauth/callback/github",auth:[],answers:{303:"redirect"},query:e.query,signal:e.signal})},async socialCallbackGitHubPost(e){return t.send({op:"SocialCallbackGitHubPost",method:"POST",path:"/auth/oauth/callback/github",auth:[],answers:{},signal:e?.signal})},async socialCallbackGoogle(e){return t.send({op:"SocialCallbackGoogle",method:"GET",path:"/auth/oauth/callback/google",auth:[],answers:{303:"redirect"},query:e.query,signal:e.signal})},async socialCallbackGooglePost(e){return t.send({op:"SocialCallbackGooglePost",method:"POST",path:"/auth/oauth/callback/google",auth:[],answers:{},signal:e?.signal})},async socialCallbackMicrosoft(e){return t.send({op:"SocialCallbackMicrosoft",method:"GET",path:"/auth/oauth/callback/microsoft",auth:[],answers:{303:"redirect"},query:e.query,signal:e.signal})},async socialCallbackMicrosoftPost(e){return t.send({op:"SocialCallbackMicrosoftPost",method:"POST",path:"/auth/oauth/callback/microsoft",auth:[],answers:{},signal:e?.signal})},async socialConfig(e){return t.send({op:"SocialConfig",method:"GET",path:"/auth/oauth/config",auth:[["ApiKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async socialBegin(e){return t.send({op:"SocialBegin",method:"POST",path:"/auth/oauth/transactions",auth:[["ApiKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async socialCancel(e){return t.send({op:"SocialCancel",method:"POST",path:"/auth/oauth/transactions/"+s("SocialCancel","id",e.path.id)+"/cancel",auth:[["ApiKeyAuth"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async socialComplete(e){return t.send({op:"SocialComplete",method:"POST",path:"/auth/oauth/transactions/"+s("SocialComplete","id",e.path.id)+"/complete",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async requestPhoneOtp(e){return t.send({op:"RequestPhoneOTP",method:"POST",path:"/auth/otp",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async verifyPhoneOtp(e){return t.send({op:"VerifyPhoneOTP",method:"POST",path:"/auth/otp/verify",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async hostedRecoveryApprovalPage(e){return t.send({op:"HostedRecoveryApprovalPage",method:"GET",path:"/auth/pages/recovery-approval",auth:[],answers:{200:"raw"},query:e?.query,signal:e?.signal})},async hostedRecoveryApprovalSubmit(e){return t.send({op:"HostedRecoveryApprovalSubmit",method:"POST",path:"/auth/pages/recovery-approval",auth:[],answers:{200:"raw"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:e.body},signal:e.signal})},async hostedRecoveryContactPage(e){return t.send({op:"HostedRecoveryContactPage",method:"GET",path:"/auth/pages/recovery-contact",auth:[],answers:{200:"raw"},query:e?.query,signal:e?.signal})},async hostedRecoveryContactSubmit(e){return t.send({op:"HostedRecoveryContactSubmit",method:"POST",path:"/auth/pages/recovery-contact",auth:[],answers:{200:"raw"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:e.body},signal:e.signal})},async hostedResetPasswordPage(e){return t.send({op:"HostedResetPasswordPage",method:"GET",path:"/auth/pages/reset-password",auth:[],answers:{200:"raw"},query:e?.query,signal:e?.signal})},async hostedResetPasswordSubmit(e){return t.send({op:"HostedResetPasswordSubmit",method:"POST",path:"/auth/pages/reset-password",auth:[],answers:{200:"raw"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:e.body},signal:e.signal})},async hostedVerifyEmailPage(e){return t.send({op:"HostedVerifyEmailPage",method:"GET",path:"/auth/pages/verify-email",auth:[],answers:{200:"raw"},query:e?.query,signal:e?.signal})},async hostedVerifyEmailSubmit(e){return t.send({op:"HostedVerifyEmailSubmit",method:"POST",path:"/auth/pages/verify-email",auth:[],answers:{200:"raw"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:e.body},signal:e.signal})},async passwordChange(e){return t.send({op:"PasswordChange",method:"POST",path:"/auth/password/change",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async passwordResetRequest(e){return t.send({op:"PasswordResetRequest",method:"POST",path:"/auth/password/reset",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async passwordResetConfirm(e){return t.send({op:"PasswordResetConfirm",method:"POST",path:"/auth/password/reset/confirm",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async setPassword(e){return t.send({op:"SetPassword",method:"POST",path:"/auth/password/set",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async powChallenge(e){return t.send({op:"PowChallenge",method:"POST",path:"/auth/pow/challenge",auth:[["ApiKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async approveRecovery(e){return t.send({op:"ApproveRecovery",method:"POST",path:"/auth/recovery/approve",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listRecoveryContacts(e){return t.send({op:"ListRecoveryContacts",method:"GET",path:"/auth/recovery/contacts",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e?.signal})},async addRecoveryContact(e){return t.send({op:"AddRecoveryContact",method:"POST",path:"/auth/recovery/contacts",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deleteRecoveryContact(e){return t.send({op:"DeleteRecoveryContact",method:"DELETE",path:"/auth/recovery/contacts/"+s("DeleteRecoveryContact","id",e.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:e.signal})},async verifyRecoveryContact(e){return t.send({op:"VerifyRecoveryContact",method:"POST",path:"/auth/recovery/contacts/"+s("VerifyRecoveryContact","id",e.path.id)+"/verify",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async denyRecovery(e){return t.send({op:"DenyRecovery",method:"POST",path:"/auth/recovery/deny",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async initiateRecovery(e){return t.send({op:"InitiateRecovery",method:"POST",path:"/auth/recovery/initiate",auth:[["ApiKeyAuth"]],answers:{200:"json",202:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getRecoveryStatus(e){return t.send({op:"GetRecoveryStatus",method:"GET",path:"/auth/recovery/status",auth:[["ApiKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async resendVerification(e){return t.send({op:"ResendVerification",method:"POST",path:"/auth/resend-verification",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listSessions(e){return t.send({op:"ListSessions",method:"GET",path:"/auth/sessions",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e?.signal})},async revokeAllSessions(e){return t.send({op:"RevokeAllSessions",method:"DELETE",path:"/auth/sessions",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e?.signal})},async revokeSession(e){return t.send({op:"RevokeSession",method:"DELETE",path:"/auth/sessions/"+s("RevokeSession","id",e.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e.signal})},async signup(e){return t.send({op:"Signup",method:"POST",path:"/auth/signup",auth:[["ApiKeyAuth"]],answers:{201:"json"},headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async stepUp(e){return t.send({op:"StepUp",method:"POST",path:"/auth/step-up",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async stepUpStatus(e){return t.send({op:"StepUpStatus",method:"GET",path:"/auth/step-up/status",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e?.signal})},async stepUpWebAuthnBegin(e){return t.send({op:"StepUpWebAuthnBegin",method:"POST",path:"/auth/step-up/webauthn/begin",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e?.signal})},async exchangeCustomToken(e){return t.send({op:"ExchangeCustomToken",method:"POST",path:"/auth/token/exchange",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async refreshToken(e){return t.send({op:"RefreshToken",method:"POST",path:"/auth/token/refresh",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async revokeRefreshToken(e){return t.send({op:"RevokeRefreshToken",method:"POST",path:"/auth/token/revoke",auth:[["ApiKeyAuth"]],answers:{200:"empty"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listTransactions(e){return t.send({op:"ListTransactions",method:"GET",path:"/auth/transactions",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async createTransaction(e){return t.send({op:"CreateTransaction",method:"POST",path:"/auth/transactions",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getTransaction(e){return t.send({op:"GetTransaction",method:"GET",path:"/auth/transactions/"+s("GetTransaction","id",e.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e.signal})},async approveTransaction(e){return t.send({op:"ApproveTransaction",method:"POST",path:"/auth/transactions/"+s("ApproveTransaction","id",e.path.id)+"/approve",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async denyTransaction(e){return t.send({op:"DenyTransaction",method:"POST",path:"/auth/transactions/"+s("DenyTransaction","id",e.path.id)+"/deny",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listTrustedDevices(e){return t.send({op:"ListTrustedDevices",method:"GET",path:"/auth/trusted-devices",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e?.signal})},async registerTrustedDevice(e){return t.send({op:"RegisterTrustedDevice",method:"POST",path:"/auth/trusted-devices",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async revokeTrustedDevice(e){return t.send({op:"RevokeTrustedDevice",method:"DELETE",path:"/auth/trusted-devices/"+s("RevokeTrustedDevice","id",e.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e.signal})},async verifyTokenUser(e){return t.send({op:"VerifyTokenUser",method:"GET",path:"/auth/user",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e?.signal})},async deleteAccount(e){return t.send({op:"DeleteAccount",method:"DELETE",path:"/auth/user",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:e?.body},signal:e?.signal})},async listConsents(e){return t.send({op:"ListConsents",method:"GET",path:"/auth/user/consents",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e?.signal})},async recordConsent(e){return t.send({op:"RecordConsent",method:"POST",path:"/auth/user/consents",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async revokeConsent(e){return t.send({op:"RevokeConsent",method:"DELETE",path:"/auth/user/consents/"+s("RevokeConsent","id",e.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e.signal})},async verifyEmail(e){return t.send({op:"VerifyEmail",method:"POST",path:"/auth/verify-email",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async webauthnListCredentials(e){return t.send({op:"WebauthnListCredentials",method:"GET",path:"/auth/webauthn/credentials",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e?.signal})},async webauthnRenameCredential(e){return t.send({op:"WebauthnRenameCredential",method:"PUT",path:"/auth/webauthn/credentials/"+s("WebauthnRenameCredential","id",e.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async webauthnDeleteCredential(e){return t.send({op:"WebauthnDeleteCredential",method:"DELETE",path:"/auth/webauthn/credentials/"+s("WebauthnDeleteCredential","id",e.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e.signal})},async webauthnLoginBegin(e){return t.send({op:"WebauthnLoginBegin",method:"POST",path:"/auth/webauthn/login/begin",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e?.body},signal:e?.signal})},async webauthnLoginFinish(e){return t.send({op:"WebauthnLoginFinish",method:"POST",path:"/auth/webauthn/login/finish",auth:[["ApiKeyAuth"]],answers:{200:"json"},query:e.query,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async webauthnRecoveryBegin(e){return t.send({op:"WebauthnRecoveryBegin",method:"POST",path:"/auth/webauthn/recovery/begin",auth:[["ApiKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async webauthnRecoveryFinish(e){return t.send({op:"WebauthnRecoveryFinish",method:"POST",path:"/auth/webauthn/recovery/finish",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async webauthnRecoveryRegisterBegin(e){return t.send({op:"WebauthnRecoveryRegisterBegin",method:"POST",path:"/auth/webauthn/recovery/register/begin",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e?.body},signal:e?.signal})},async webauthnRecoveryRegisterFinish(e){return t.send({op:"WebauthnRecoveryRegisterFinish",method:"POST",path:"/auth/webauthn/recovery/register/finish",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async webauthnRegisterBegin(e){return t.send({op:"WebauthnRegisterBegin",method:"POST",path:"/auth/webauthn/register/begin",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e?.body},signal:e?.signal})},async webauthnRegisterFinish(e){return t.send({op:"WebauthnRegisterFinish",method:"POST",path:"/auth/webauthn/register/finish",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async webauthnSignupBegin(e){return t.send({op:"WebauthnSignupBegin",method:"POST",path:"/auth/webauthn/signup/begin",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async webauthnSignupFinish(e){return t.send({op:"WebauthnSignupFinish",method:"POST",path:"/auth/webauthn/signup/finish",auth:[["ApiKeyAuth"]],answers:{201:"json"},query:e.query,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async oauthAuthorize(e){return t.send({op:"OauthAuthorize",method:"GET",path:"/oauth/authorize",auth:[],answers:{302:"redirect",303:"redirect"},query:e?.query,signal:e?.signal})},async oauthAuthorizePost(e){return t.send({op:"OauthAuthorizePost",method:"POST",path:"/oauth/authorize",auth:[],answers:{302:"redirect",303:"redirect"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:e.body},signal:e.signal})},async oauthAuthorizeCallback(e){return t.send({op:"OauthAuthorizeCallback",method:"GET",path:"/oauth/authorize/callback",auth:[],answers:{303:"redirect"},query:e.query,signal:e.signal})},async oauthDeviceAuthorize(e){return t.send({op:"OauthDeviceAuthorize",method:"POST",path:"/oauth/device",auth:[["OAuthClient"],[]],answers:{200:"json"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:e.body},signal:e.signal})},async oauthIntrospect(e){return t.send({op:"OauthIntrospect",method:"POST",path:"/oauth/introspect",auth:[["AdminAuth"],["OAuthClient"],[]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async oauthLogout(e){return t.send({op:"OauthLogout",method:"GET",path:"/oauth/logout",auth:[],answers:{302:"redirect"},query:e?.query,signal:e?.signal})},async oauthLogoutPost(e){return t.send({op:"OauthLogoutPost",method:"POST",path:"/oauth/logout",auth:[],answers:{302:"redirect"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:e?.body},signal:e?.signal})},async oauthPar(e){return t.send({op:"OauthPAR",method:"POST",path:"/oauth/par",auth:[["OAuthClient"],[]],answers:{201:"json"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:e.body},signal:e.signal})},async oauthRevoke(e){return t.send({op:"OauthRevoke",method:"POST",path:"/oauth/revoke",auth:[["OAuthClient"],[]],answers:{200:"empty"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:e.body},signal:e.signal})},async oauthToken(e){return t.send({op:"OauthToken",method:"POST",path:"/oauth/token",auth:[["OAuthClient"],[]],answers:{200:"json"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:e.body},signal:e.signal})},async oauthUserinfo(e){return t.send({op:"OauthUserinfo",method:"GET",path:"/oauth/userinfo",auth:[["OAuthAccessToken"]],answers:{200:"json"},signal:e?.signal})},async oauthUserinfoPost(e){return t.send({op:"OauthUserinfoPost",method:"POST",path:"/oauth/userinfo",auth:[["OAuthAccessToken"]],answers:{200:"json"},signal:e?.signal})},async ownerCliCode(e){return t.send({op:"OwnerCLICode",method:"POST",path:"/auth/cli/owner-code",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}}}var o={};n(o,{client:()=>P});function P(t){return{async getCacheEntry(e){return t.send({op:"GetCacheEntry",method:"GET",path:"/cache/entry",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async putCacheEntry(e){return t.send({op:"PutCacheEntry",method:"PUT",path:"/cache/entry",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deleteCacheEntry(e){return t.send({op:"DeleteCacheEntry",method:"DELETE",path:"/cache/entry",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async incrementCacheEntry(e){return t.send({op:"IncrementCacheEntry",method:"POST",path:"/cache/entry/increment",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async getCacheUsage(e){return t.send({op:"GetCacheUsage",method:"GET",path:"/cache/usage",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})}}}var l={};n(l,{client:()=>A});function A(t){return{async getValues(e){return t.send({op:"GetValues",method:"GET",path:"/flags",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},headers:e?.headers,signal:e?.signal})},async batchUserValues(e){return t.send({op:"BatchUserValues",method:"POST",path:"/flags/batch",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getDelta(e){return t.send({op:"GetDelta",method:"GET",path:"/flags/delta",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json",304:"empty"},query:e?.query,headers:e?.headers,signal:e?.signal})},async getEvaluations(e){return t.send({op:"GetEvaluations",method:"GET",path:"/flags/evaluations",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async getCurrentInstallations(e){return t.send({op:"GetCurrentInstallations",method:"GET",path:"/flags/installations/current",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async getInstallationsDaily(e){return t.send({op:"GetInstallationsDaily",method:"GET",path:"/flags/installations/daily",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async getSnapshot(e){return t.send({op:"GetSnapshot",method:"GET",path:"/flags/snapshot",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json",304:"empty"},headers:e?.headers,signal:e?.signal})},async listDefinitions(e){return t.send({op:"ListDefinitions",method:"GET",path:"/flags/system",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async getDefinition(e){return t.send({op:"GetDefinition",method:"GET",path:"/flags/system/"+s("GetDefinition","key",e.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async putDefinition(e){return t.send({op:"PutDefinition",method:"PUT",path:"/flags/system/"+s("PutDefinition","key",e.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deleteDefinition(e){return t.send({op:"DeleteDefinition",method:"DELETE",path:"/flags/system/"+s("DeleteDefinition","key",e.path.key),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:e.signal})},async activateTemplates(e){return t.send({op:"ActivateTemplates",method:"POST",path:"/flags/templates/activation",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getActiveTemplate(e){return t.send({op:"GetActiveTemplate",method:"GET",path:"/flags/templates/active",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async getTemplateCapabilities(e){return t.send({op:"GetTemplateCapabilities",method:"GET",path:"/flags/templates/capabilities",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async getTemplateDraft(e){return t.send({op:"GetTemplateDraft",method:"GET",path:"/flags/templates/draft",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async createTemplateDraft(e){return t.send({op:"CreateTemplateDraft",method:"POST",path:"/flags/templates/draft",auth:[["SecretKeyAuth"]],answers:{201:"json"},headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async discardTemplateDraft(e){return t.send({op:"DiscardTemplateDraft",method:"DELETE",path:"/flags/templates/draft",auth:[["SecretKeyAuth"]],answers:{204:"empty"},headers:e.headers,signal:e.signal})},async putTemplateParameter(e){return t.send({op:"PutTemplateParameter",method:"PUT",path:"/flags/templates/draft/parameters/"+s("PutTemplateParameter","key",e.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async removeTemplateParameter(e){return t.send({op:"RemoveTemplateParameter",method:"DELETE",path:"/flags/templates/draft/parameters/"+s("RemoveTemplateParameter","key",e.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},headers:e.headers,signal:e.signal})},async reviewTemplateDraft(e){return t.send({op:"ReviewTemplateDraft",method:"GET",path:"/flags/templates/draft/review",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async publishTemplate(e){return t.send({op:"PublishTemplate",method:"POST",path:"/flags/templates/publish",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getPublishReceipt(e){return t.send({op:"GetPublishReceipt",method:"POST",path:"/flags/templates/publish/receipt",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async restoreTemplateVersion(e){return t.send({op:"RestoreTemplateVersion",method:"POST",path:"/flags/templates/restore/"+s("RestoreTemplateVersion","version",e.path.version),auth:[["SecretKeyAuth"]],answers:{201:"json"},headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listTemplateVersions(e){return t.send({op:"ListTemplateVersions",method:"GET",path:"/flags/templates/versions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async getTemplateVersion(e){return t.send({op:"GetTemplateVersion",method:"GET",path:"/flags/templates/versions/"+s("GetTemplateVersion","version",e.path.version),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async getUserValues(e){return t.send({op:"GetUserValues",method:"GET",path:"/flags/users/"+s("GetUserValues","user_id",e.path.user_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},headers:e.headers,signal:e.signal})},async putUserValues(e){return t.send({op:"PutUserValues",method:"PUT",path:"/flags/users/"+s("PutUserValues","user_id",e.path.user_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deleteUserValues(e){return t.send({op:"DeleteUserValues",method:"DELETE",path:"/flags/users/"+s("DeleteUserValues","user_id",e.path.user_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async putUserValue(e){return t.send({op:"PutUserValue",method:"PUT",path:"/flags/users/"+s("PutUserValue","user_id",e.path.user_id)+"/"+s("PutUserValue","key",e.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deleteUserValue(e){return t.send({op:"DeleteUserValue",method:"DELETE",path:"/flags/users/"+s("DeleteUserValue","user_id",e.path.user_id)+"/"+s("DeleteUserValue","key",e.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},headers:e.headers,signal:e.signal})}}}var p={};n(p,{client:()=>R});function R(t){return{async listMachines(e){return t.send({op:"ListMachines",method:"GET",path:"/machines",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async createMachine(e){return t.send({op:"CreateMachine",method:"POST",path:"/machines",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listMachineSizes(e){return t.send({op:"ListMachineSizes",method:"GET",path:"/machines/sizes",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async getMachineNetwork(e){return t.send({op:"GetMachineNetwork",method:"GET",path:"/machines/network",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async connectGitHub(e){return t.send({op:"ConnectGitHub",method:"POST",path:"/machines/github/connect",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async listInstallations(e){return t.send({op:"ListInstallations",method:"GET",path:"/machines/github/installations",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async linkInstallation(e){return t.send({op:"LinkInstallation",method:"POST",path:"/machines/github/installations",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async unlinkInstallation(e){return t.send({op:"UnlinkInstallation",method:"DELETE",path:"/machines/github/installations/"+s("UnlinkInstallation","installation",e.path.installation),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:e.signal})},async listRepositories(e){return t.send({op:"ListRepositories",method:"GET",path:"/machines/github/repositories",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async getMachine(e){return t.send({op:"GetMachine",method:"GET",path:"/machines/"+s("GetMachine","name",e.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async deleteMachine(e){return t.send({op:"DeleteMachine",method:"DELETE",path:"/machines/"+s("DeleteMachine","name",e.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:e.signal})},async updateMachine(e){return t.send({op:"UpdateMachine",method:"PATCH",path:"/machines/"+s("UpdateMachine","name",e.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listBuilds(e){return t.send({op:"ListBuilds",method:"GET",path:"/machines/"+s("ListBuilds","name",e.path.name)+"/builds",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async deployMachine(e){return t.send({op:"DeployMachine",method:"POST",path:"/machines/"+s("DeployMachine","name",e.path.name)+"/builds",auth:[["SecretKeyAuth"]],answers:{202:"json"},signal:e.signal})},async getBuild(e){return t.send({op:"GetBuild",method:"GET",path:"/machines/"+s("GetBuild","name",e.path.name)+"/builds/"+s("GetBuild","build",e.path.build),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async getBuildLog(e){return t.send({op:"GetBuildLog",method:"GET",path:"/machines/"+s("GetBuildLog","name",e.path.name)+"/builds/"+s("GetBuildLog","build",e.path.build)+"/log",auth:[["SecretKeyAuth"]],answers:{200:"raw"},signal:e.signal})},async rollbackMachine(e){return t.send({op:"RollbackMachine",method:"POST",path:"/machines/"+s("RollbackMachine","name",e.path.name)+"/rollback",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listDatabases(e){return t.send({op:"ListDatabases",method:"GET",path:"/databases",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async createDatabase(e){return t.send({op:"CreateDatabase",method:"POST",path:"/databases",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listDatabaseSizes(e){return t.send({op:"ListDatabaseSizes",method:"GET",path:"/databases/sizes",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async getDatabase(e){return t.send({op:"GetDatabase",method:"GET",path:"/databases/"+s("GetDatabase","name",e.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async deleteDatabase(e){return t.send({op:"DeleteDatabase",method:"DELETE",path:"/databases/"+s("DeleteDatabase","name",e.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:e.signal})},async updateDatabase(e){return t.send({op:"UpdateDatabase",method:"PATCH",path:"/databases/"+s("UpdateDatabase","name",e.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json",202:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async undeleteDatabase(e){return t.send({op:"UndeleteDatabase",method:"POST",path:"/databases/"+s("UndeleteDatabase","name",e.path.name)+"/undelete",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async purgeDatabase(e){return t.send({op:"PurgeDatabase",method:"POST",path:"/databases/"+s("PurgeDatabase","name",e.path.name)+"/purge",auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:e.signal})},async getDatabaseCredentials(e){return t.send({op:"GetDatabaseCredentials",method:"GET",path:"/databases/"+s("GetDatabaseCredentials","name",e.path.name)+"/credentials",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async changeDatabasePassword(e){return t.send({op:"ChangeDatabasePassword",method:"POST",path:"/databases/"+s("ChangeDatabasePassword","name",e.path.name)+"/password",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async readMachineLogs(e){return t.send({op:"ReadMachineLogs",method:"GET",path:"/machines/"+s("ReadMachineLogs","name",e.path.name)+"/logs",auth:[["SecretKeyAuth"]],answers:{200:"raw"},query:e.query,signal:e.signal})},async getMachineMetrics(e){return t.send({op:"GetMachineMetrics",method:"GET",path:"/machines/"+s("GetMachineMetrics","name",e.path.name)+"/metrics",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async getMachineContract(e){return t.send({op:"GetMachineContract",method:"GET",path:"/machines/"+s("GetMachineContract","name",e.path.name)+"/openapi",auth:[["SecretKeyAuth"]],answers:{200:"json",304:"empty"},headers:e.headers,signal:e.signal})},async restoreDatabase(e){return t.send({op:"RestoreDatabase",method:"POST",path:"/databases/"+s("RestoreDatabase","name",e.path.name)+"/restore",auth:[["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getDatabaseSchema(e){return t.send({op:"GetDatabaseSchema",method:"GET",path:"/databases/"+s("GetDatabaseSchema","name",e.path.name)+"/schema",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async getDatabaseMetrics(e){return t.send({op:"GetDatabaseMetrics",method:"GET",path:"/databases/"+s("GetDatabaseMetrics","name",e.path.name)+"/metrics",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async queryDatabase(e){return t.send({op:"QueryDatabase",method:"POST",path:"/databases/"+s("QueryDatabase","name",e.path.name)+"/sql",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listCrons(e){return t.send({op:"ListCrons",method:"GET",path:"/machines/"+s("ListCrons","name",e.path.name)+"/crons",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async listCronRuns(e){return t.send({op:"ListCronRuns",method:"GET",path:"/machines/"+s("ListCronRuns","name",e.path.name)+"/crons/"+s("ListCronRuns","cron",e.path.cron)+"/runs",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async runCron(e){return t.send({op:"RunCron",method:"POST",path:"/machines/"+s("RunCron","name",e.path.name)+"/crons/"+s("RunCron","cron",e.path.cron)+"/run",auth:[["SecretKeyAuth"]],answers:{201:"json"},signal:e.signal})},async pauseCron(e){return t.send({op:"PauseCron",method:"POST",path:"/machines/"+s("PauseCron","name",e.path.name)+"/crons/"+s("PauseCron","cron",e.path.cron)+"/pause",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async resumeCron(e){return t.send({op:"ResumeCron",method:"POST",path:"/machines/"+s("ResumeCron","name",e.path.name)+"/crons/"+s("ResumeCron","cron",e.path.cron)+"/resume",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async listTasks(e){return t.send({op:"ListTasks",method:"GET",path:"/machines/"+s("ListTasks","name",e.path.name)+"/tasks",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async enqueueTask(e){return t.send({op:"EnqueueTask",method:"POST",path:"/machines/"+s("EnqueueTask","name",e.path.name)+"/tasks",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getTask(e){return t.send({op:"GetTask",method:"GET",path:"/machines/"+s("GetTask","name",e.path.name)+"/tasks/"+s("GetTask","task",e.path.task),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async cancelTask(e){return t.send({op:"CancelTask",method:"POST",path:"/machines/"+s("CancelTask","name",e.path.name)+"/tasks/"+s("CancelTask","task",e.path.task)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async retryTask(e){return t.send({op:"RetryTask",method:"POST",path:"/machines/"+s("RetryTask","name",e.path.name)+"/tasks/"+s("RetryTask","task",e.path.task)+"/retry",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async listTaskTypes(e){return t.send({op:"ListTaskTypes",method:"GET",path:"/machines/"+s("ListTaskTypes","name",e.path.name)+"/task-types",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})}}}var d={};n(d,{client:()=>S});function S(t){return{async getDeliverability(e){return t.send({op:"GetDeliverability",method:"GET",path:"/notify/deliverability",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async listDevices(e){return t.send({op:"ListDevices",method:"GET",path:"/notify/devices",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async registerDevice(e){return t.send({op:"RegisterDevice",method:"POST",path:"/notify/devices",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getDeviceStats(e){return t.send({op:"GetDeviceStats",method:"GET",path:"/notify/devices/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async deleteMyDevice(e){return t.send({op:"DeleteMyDevice",method:"DELETE",path:"/notify/devices/"+s("DeleteMyDevice","device_id",e.path.device_id),auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async sendEmail(e){return t.send({op:"SendEmail",method:"POST",path:"/notify/email",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listNotifyMessages(e){return t.send({op:"ListNotifyMessages",method:"GET",path:"/notify/messages",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async getNotifyMessage(e){return t.send({op:"GetNotifyMessage",method:"GET",path:"/notify/messages/"+s("GetNotifyMessage","id",e.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async getMetricsSummary(e){return t.send({op:"GetMetricsSummary",method:"GET",path:"/notify/metrics/summary",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async getMyPreferences(e){return t.send({op:"GetMyPreferences",method:"GET",path:"/notify/preferences",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e?.signal})},async setMyPreferences(e){return t.send({op:"SetMyPreferences",method:"PUT",path:"/notify/preferences",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listNotifyProviders(e){return t.send({op:"ListNotifyProviders",method:"GET",path:"/notify/providers",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async putNotifyProvider(e){return t.send({op:"PutNotifyProvider",method:"PUT",path:"/notify/providers/"+s("PutNotifyProvider","channel",e.path.channel)+"/"+s("PutNotifyProvider","provider",e.path.provider),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deleteNotifyProvider(e){return t.send({op:"DeleteNotifyProvider",method:"DELETE",path:"/notify/providers/"+s("DeleteNotifyProvider","channel",e.path.channel)+"/"+s("DeleteNotifyProvider","provider",e.path.provider),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async sendPush(e){return t.send({op:"SendPush",method:"POST",path:"/notify/push",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getNotifySettings(e){return t.send({op:"GetNotifySettings",method:"GET",path:"/notify/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async putNotifySettings(e){return t.send({op:"PutNotifySettings",method:"PUT",path:"/notify/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async sendSms(e){return t.send({op:"SendSMS",method:"POST",path:"/notify/sms",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listEmailTemplates(e){return t.send({op:"ListEmailTemplates",method:"GET",path:"/notify/templates/email",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async getEmailTemplate(e){return t.send({op:"GetEmailTemplate",method:"GET",path:"/notify/templates/email/"+s("GetEmailTemplate","slug",e.path.slug)+"/"+s("GetEmailTemplate","locale",e.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async putEmailTemplate(e){return t.send({op:"PutEmailTemplate",method:"PUT",path:"/notify/templates/email/"+s("PutEmailTemplate","slug",e.path.slug)+"/"+s("PutEmailTemplate","locale",e.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deleteEmailTemplate(e){return t.send({op:"DeleteEmailTemplate",method:"DELETE",path:"/notify/templates/email/"+s("DeleteEmailTemplate","slug",e.path.slug)+"/"+s("DeleteEmailTemplate","locale",e.path.locale),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async listSmsTemplates(e){return t.send({op:"ListSMSTemplates",method:"GET",path:"/notify/templates/sms",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async getSmsTemplate(e){return t.send({op:"GetSMSTemplate",method:"GET",path:"/notify/templates/sms/"+s("GetSMSTemplate","slug",e.path.slug)+"/"+s("GetSMSTemplate","locale",e.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async putSmsTemplate(e){return t.send({op:"PutSMSTemplate",method:"PUT",path:"/notify/templates/sms/"+s("PutSMSTemplate","slug",e.path.slug)+"/"+s("PutSMSTemplate","locale",e.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deleteSmsTemplate(e){return t.send({op:"DeleteSMSTemplate",method:"DELETE",path:"/notify/templates/sms/"+s("DeleteSMSTemplate","slug",e.path.slug)+"/"+s("DeleteSMSTemplate","locale",e.path.locale),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async listWhatsAppTemplates(e){return t.send({op:"ListWhatsAppTemplates",method:"GET",path:"/notify/templates/whatsapp",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async getWhatsAppTemplate(e){return t.send({op:"GetWhatsAppTemplate",method:"GET",path:"/notify/templates/whatsapp/"+s("GetWhatsAppTemplate","slug",e.path.slug)+"/"+s("GetWhatsAppTemplate","locale",e.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async putWhatsAppTemplate(e){return t.send({op:"PutWhatsAppTemplate",method:"PUT",path:"/notify/templates/whatsapp/"+s("PutWhatsAppTemplate","slug",e.path.slug)+"/"+s("PutWhatsAppTemplate","locale",e.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deleteWhatsAppTemplate(e){return t.send({op:"DeleteWhatsAppTemplate",method:"DELETE",path:"/notify/templates/whatsapp/"+s("DeleteWhatsAppTemplate","slug",e.path.slug)+"/"+s("DeleteWhatsAppTemplate","locale",e.path.locale),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async listTopics(e){return t.send({op:"ListTopics",method:"GET",path:"/notify/topics",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async createTopic(e){return t.send({op:"CreateTopic",method:"POST",path:"/notify/topics",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deleteTopic(e){return t.send({op:"DeleteTopic",method:"DELETE",path:"/notify/topics/"+s("DeleteTopic","name",e.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async changeTopic(e){return t.send({op:"ChangeTopic",method:"PATCH",path:"/notify/topics/"+s("ChangeTopic","name",e.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async addTopicSubscribers(e){return t.send({op:"AddTopicSubscribers",method:"POST",path:"/notify/topics/"+s("AddTopicSubscribers","name",e.path.name)+"/subscribers",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async removeTopicSubscriber(e){return t.send({op:"RemoveTopicSubscriber",method:"DELETE",path:"/notify/topics/"+s("RemoveTopicSubscriber","name",e.path.name)+"/subscribers/"+s("RemoveTopicSubscriber","user_id",e.path.user_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async followTopic(e){return t.send({op:"FollowTopic",method:"POST",path:"/notify/topics/"+s("FollowTopic","name",e.path.name)+"/subscription",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async unfollowTopic(e){return t.send({op:"UnfollowTopic",method:"DELETE",path:"/notify/topics/"+s("UnfollowTopic","name",e.path.name)+"/subscription",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async listUserDevices(e){return t.send({op:"ListUserDevices",method:"GET",path:"/notify/users/"+s("ListUserDevices","user_id",e.path.user_id)+"/devices",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async getUserPreferences(e){return t.send({op:"GetUserPreferences",method:"GET",path:"/notify/users/"+s("GetUserPreferences","user_id",e.path.user_id)+"/preferences",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async setUserPreferences(e){return t.send({op:"SetUserPreferences",method:"PUT",path:"/notify/users/"+s("SetUserPreferences","user_id",e.path.user_id)+"/preferences",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async startVerification(e){return t.send({op:"StartVerification",method:"POST",path:"/notify/verifications",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async checkVerification(e){return t.send({op:"CheckVerification",method:"POST",path:"/notify/verifications/check",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async receiveSendGridEvents(e){return t.send({op:"ReceiveSendGridEvents",method:"POST",path:"/notify/webhooks/email/sendgrid",auth:[],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async receiveTwilioStatus(e){return t.send({op:"ReceiveTwilioStatus",method:"POST",path:"/notify/webhooks/sms/twilio",auth:[],answers:{204:"empty"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:e.body},signal:e.signal})},async receiveVonageReceiptQuery(e){return t.send({op:"ReceiveVonageReceiptQuery",method:"GET",path:"/notify/webhooks/sms/vonage",auth:[],answers:{204:"empty"},query:e?.query,signal:e?.signal})},async receiveVonageReceipt(e){return t.send({op:"ReceiveVonageReceipt",method:"POST",path:"/notify/webhooks/sms/vonage",auth:[],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async subscribeMetaWebhook(e){return t.send({op:"SubscribeMetaWebhook",method:"GET",path:"/notify/webhooks/whatsapp/meta",auth:[],answers:{200:"raw"},query:e.query,signal:e.signal})},async receiveMetaNotification(e){return t.send({op:"ReceiveMetaNotification",method:"POST",path:"/notify/webhooks/whatsapp/meta",auth:[],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async sendWhatsApp(e){return t.send({op:"SendWhatsApp",method:"POST",path:"/notify/whatsapp",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listWhatsAppInbound(e){return t.send({op:"ListWhatsAppInbound",method:"GET",path:"/notify/whatsapp/inbound",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})}}}var g={};n(g,{client:()=>v});function v(t){return{async getAppleAccount(e){return t.send({op:"GetAppleAccount",method:"GET",path:"/purchases/apple",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async disconnectApple(e){return t.send({op:"DisconnectApple",method:"DELETE",path:"/purchases/apple",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:e?.headers,signal:e?.signal})},async getAppleAccountToken(e){return t.send({op:"GetAppleAccountToken",method:"POST",path:"/purchases/apple/account-token",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e?.signal})},async getAppleConnectPage(e){return t.send({op:"GetAppleConnectPage",method:"GET",path:"/purchases/apple/connect",auth:[],answers:{200:"raw"},signal:e?.signal})},async connectAppleKey(e){return t.send({op:"ConnectAppleKey",method:"POST",path:"/purchases/apple/connect",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async createAppleGrant(e){return t.send({op:"CreateAppleGrant",method:"POST",path:"/purchases/apple/grants",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:e?.headers,signal:e?.signal})},async getAppleReadiness(e){return t.send({op:"GetAppleReadiness",method:"GET",path:"/purchases/apple/readiness",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async reportAppleTransactions(e){return t.send({op:"ReportAppleTransactions",method:"POST",path:"/purchases/apple/transactions",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async setXcodeCertificate(e){return t.send({op:"SetXcodeCertificate",method:"PUT",path:"/purchases/apple/xcode-certificate",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async clearXcodeCertificate(e){return t.send({op:"ClearXcodeCertificate",method:"DELETE",path:"/purchases/apple/xcode-certificate",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:e?.headers,signal:e?.signal})},async getCatalog(e){return t.send({op:"GetCatalog",method:"GET",path:"/purchases/catalog",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async saveCatalog(e){return t.send({op:"SaveCatalog",method:"PUT",path:"/purchases/catalog",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async planCatalog(e){return t.send({op:"PlanCatalog",method:"POST",path:"/purchases/catalog/plans",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:e?.headers,signal:e?.signal})},async getCatalogPlan(e){return t.send({op:"GetCatalogPlan",method:"GET",path:"/purchases/catalog/plans/"+s("GetCatalogPlan","plan_id",e.path.plan_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async confirmCatalogPlan(e){return t.send({op:"ConfirmCatalogPlan",method:"POST",path:"/purchases/catalog/plans/"+s("ConfirmCatalogPlan","plan_id",e.path.plan_id)+"/confirm",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async declineCatalogPlan(e){return t.send({op:"DeclineCatalogPlan",method:"POST",path:"/purchases/catalog/plans/"+s("DeclineCatalogPlan","plan_id",e.path.plan_id)+"/decline",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async validateCatalog(e){return t.send({op:"ValidateCatalog",method:"POST",path:"/purchases/catalog/validate",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listCharts(e){return t.send({op:"ListCharts",method:"GET",path:"/purchases/charts",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async getChartsOverview(e){return t.send({op:"GetChartsOverview",method:"GET",path:"/purchases/charts/overview",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async getChart(e){return t.send({op:"GetChart",method:"GET",path:"/purchases/charts/"+s("GetChart","chart",e.path.chart),auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async getStripeConnectPage(e){return t.send({op:"GetStripeConnectPage",method:"GET",path:"/purchases/connect",auth:[],answers:{200:"raw"},signal:e?.signal})},async connectStripeKey(e){return t.send({op:"ConnectStripeKey",method:"POST",path:"/purchases/connect",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getCustomer(e){return t.send({op:"GetCustomer",method:"GET",path:"/purchases/customers/"+s("GetCustomer","customer_id",e.path.customer_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async grantCredits(e){return t.send({op:"GrantCredits",method:"POST",path:"/purchases/customers/"+s("GrantCredits","customer_id",e.path.customer_id)+"/credits",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listCreditEntries(e){return t.send({op:"ListCreditEntries",method:"GET",path:"/purchases/customers/"+s("ListCreditEntries","customer_id",e.path.customer_id)+"/credits/entries",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async forgiveCredits(e){return t.send({op:"ForgiveCredits",method:"POST",path:"/purchases/customers/"+s("ForgiveCredits","customer_id",e.path.customer_id)+"/credits/forgive",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async grantEntitlement(e){return t.send({op:"GrantEntitlement",method:"POST",path:"/purchases/customers/"+s("GrantEntitlement","customer_id",e.path.customer_id)+"/grants",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async revokeGrant(e){return t.send({op:"RevokeGrant",method:"DELETE",path:"/purchases/customers/"+s("RevokeGrant","customer_id",e.path.customer_id)+"/grants/"+s("RevokeGrant","grant_id",e.path.grant_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async holdSpend(e){return t.send({op:"HoldSpend",method:"POST",path:"/purchases/customers/"+s("HoldSpend","customer_id",e.path.customer_id)+"/holds",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async setCustomerLimit(e){return t.send({op:"SetCustomerLimit",method:"PUT",path:"/purchases/customers/"+s("SetCustomerLimit","customer_id",e.path.customer_id)+"/limits/"+s("SetCustomerLimit","limit_key",e.path.limit_key),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async clearCustomerLimit(e){return t.send({op:"ClearCustomerLimit",method:"DELETE",path:"/purchases/customers/"+s("ClearCustomerLimit","customer_id",e.path.customer_id)+"/limits/"+s("ClearCustomerLimit","limit_key",e.path.limit_key),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async grantLimit(e){return t.send({op:"GrantLimit",method:"POST",path:"/purchases/customers/"+s("GrantLimit","customer_id",e.path.customer_id)+"/limits/"+s("GrantLimit","limit_key",e.path.limit_key)+"/grants",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async spend(e){return t.send({op:"Spend",method:"POST",path:"/purchases/customers/"+s("Spend","customer_id",e.path.customer_id)+"/spend",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async commitSpend(e){return t.send({op:"CommitSpend",method:"POST",path:"/purchases/customers/"+s("CommitSpend","customer_id",e.path.customer_id)+"/spends/"+s("CommitSpend","spend_id",e.path.spend_id)+"/commit",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async extendHold(e){return t.send({op:"ExtendHold",method:"POST",path:"/purchases/customers/"+s("ExtendHold","customer_id",e.path.customer_id)+"/spends/"+s("ExtendHold","spend_id",e.path.spend_id)+"/extend",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async releaseSpend(e){return t.send({op:"ReleaseSpend",method:"POST",path:"/purchases/customers/"+s("ReleaseSpend","customer_id",e.path.customer_id)+"/spends/"+s("ReleaseSpend","spend_id",e.path.spend_id)+"/release",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async reverseSpend(e){return t.send({op:"ReverseSpend",method:"POST",path:"/purchases/customers/"+s("ReverseSpend","customer_id",e.path.customer_id)+"/spends/"+s("ReverseSpend","spend_id",e.path.spend_id)+"/reverse",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listExperiments(e){return t.send({op:"ListExperiments",method:"GET",path:"/purchases/experiments",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async startExperiment(e){return t.send({op:"StartExperiment",method:"POST",path:"/purchases/experiments",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getExperiment(e){return t.send({op:"GetExperiment",method:"GET",path:"/purchases/experiments/"+s("GetExperiment","experiment_id",e.path.experiment_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async getExperimentResults(e){return t.send({op:"GetExperimentResults",method:"GET",path:"/purchases/experiments/"+s("GetExperimentResults","experiment_id",e.path.experiment_id)+"/results",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async stopExperiment(e){return t.send({op:"StopExperiment",method:"POST",path:"/purchases/experiments/"+s("StopExperiment","experiment_id",e.path.experiment_id)+"/stop",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async declareExperimentWinner(e){return t.send({op:"DeclareExperimentWinner",method:"POST",path:"/purchases/experiments/"+s("DeclareExperimentWinner","experiment_id",e.path.experiment_id)+"/winner",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getMyCustomerInfo(e){return t.send({op:"GetMyCustomerInfo",method:"GET",path:"/purchases/me",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:e?.signal})},async mergeGuest(e){return t.send({op:"MergeGuest",method:"POST",path:"/purchases/me/merge",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async createMergeGrant(e){return t.send({op:"CreateMergeGrant",method:"POST",path:"/purchases/me/merge-grant",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},signal:e?.signal})},async getOfferings(e){return t.send({op:"GetOfferings",method:"GET",path:"/purchases/offerings",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async listPaywalls(e){return t.send({op:"ListPaywalls",method:"GET",path:"/purchases/paywalls",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async createPaywall(e){return t.send({op:"CreatePaywall",method:"POST",path:"/purchases/paywalls",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listPaywallAssets(e){return t.send({op:"ListPaywallAssets",method:"GET",path:"/purchases/paywalls/assets",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async registerPaywallAsset(e){return t.send({op:"RegisterPaywallAsset",method:"POST",path:"/purchases/paywalls/assets",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deletePaywallAsset(e){return t.send({op:"DeletePaywallAsset",method:"DELETE",path:"/purchases/paywalls/assets/"+s("DeletePaywallAsset","asset_id",e.path.asset_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async listPaywallTemplates(e){return t.send({op:"ListPaywallTemplates",method:"GET",path:"/purchases/paywalls/templates",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async getPaywallTemplateAsset(e){return t.send({op:"GetPaywallTemplateAsset",method:"GET",path:"/purchases/paywalls/templates/"+s("GetPaywallTemplateAsset","key",e.path.key)+"/assets/"+s("GetPaywallTemplateAsset","asset_id",e.path.asset_id),auth:[["SecretKeyAuth"]],answers:{200:"raw",304:"empty"},headers:e.headers,signal:e.signal})},async validatePaywall(e){return t.send({op:"ValidatePaywall",method:"POST",path:"/purchases/paywalls/validate",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getPaywall(e){return t.send({op:"GetPaywall",method:"GET",path:"/purchases/paywalls/"+s("GetPaywall","paywall_id",e.path.paywall_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async deletePaywall(e){return t.send({op:"DeletePaywall",method:"DELETE",path:"/purchases/paywalls/"+s("DeletePaywall","paywall_id",e.path.paywall_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async savePaywallDraft(e){return t.send({op:"SavePaywallDraft",method:"PUT",path:"/purchases/paywalls/"+s("SavePaywallDraft","paywall_id",e.path.paywall_id)+"/draft",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async publishPaywall(e){return t.send({op:"PublishPaywall",method:"POST",path:"/purchases/paywalls/"+s("PublishPaywall","paywall_id",e.path.paywall_id)+"/publish",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async listPaywallVersions(e){return t.send({op:"ListPaywallVersions",method:"GET",path:"/purchases/paywalls/"+s("ListPaywallVersions","paywall_id",e.path.paywall_id)+"/versions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async getPaywallVersion(e){return t.send({op:"GetPaywallVersion",method:"GET",path:"/purchases/paywalls/"+s("GetPaywallVersion","paywall_id",e.path.paywall_id)+"/versions/"+s("GetPaywallVersion","version",e.path.version),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async listPlacements(e){return t.send({op:"ListPlacements",method:"GET",path:"/purchases/placements",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async listAttributeKeys(e){return t.send({op:"ListAttributeKeys",method:"GET",path:"/purchases/placements/attributes",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async setPlacement(e){return t.send({op:"SetPlacement",method:"PUT",path:"/purchases/placements/"+s("SetPlacement","placement",e.path.placement),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deletePlacement(e){return t.send({op:"DeletePlacement",method:"DELETE",path:"/purchases/placements/"+s("DeletePlacement","placement",e.path.placement),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async recordPaywallExposure(e){return t.send({op:"RecordPaywallExposure",method:"POST",path:"/purchases/placements/"+s("RecordPaywallExposure","placement",e.path.placement)+"/exposures",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getPlacementPaywall(e){return t.send({op:"GetPlacementPaywall",method:"GET",path:"/purchases/placements/"+s("GetPlacementPaywall","placement",e.path.placement)+"/paywall",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json",204:"empty",304:"empty"},query:e.query,headers:e.headers,signal:e.signal})},async previewPlacement(e){return t.send({op:"PreviewPlacement",method:"POST",path:"/purchases/placements/"+s("PreviewPlacement","placement",e.path.placement)+"/resolve-preview",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getPlacementResults(e){return t.send({op:"GetPlacementResults",method:"GET",path:"/purchases/placements/"+s("GetPlacementResults","placement",e.path.placement)+"/results",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async getPlacementRules(e){return t.send({op:"GetPlacementRules",method:"GET",path:"/purchases/placements/"+s("GetPlacementRules","placement",e.path.placement)+"/rules",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async setPlacementRules(e){return t.send({op:"SetPlacementRules",method:"PUT",path:"/purchases/placements/"+s("SetPlacementRules","placement",e.path.placement)+"/rules",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getSettings(e){return t.send({op:"GetSettings",method:"GET",path:"/purchases/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async updateSettings(e){return t.send({op:"UpdateSettings",method:"PUT",path:"/purchases/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getStripeAccount(e){return t.send({op:"GetStripeAccount",method:"GET",path:"/purchases/stripe",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async disconnectStripe(e){return t.send({op:"DisconnectStripe",method:"DELETE",path:"/purchases/stripe",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:e?.headers,signal:e?.signal})},async checkStripeAccount(e){return t.send({op:"CheckStripeAccount",method:"POST",path:"/purchases/stripe/check",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e?.headers,signal:e?.signal})},async createCheckout(e){return t.send({op:"CreateCheckout",method:"POST",path:"/purchases/stripe/checkout",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async createStripeGrant(e){return t.send({op:"CreateStripeGrant",method:"POST",path:"/purchases/stripe/grants",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:e?.headers,signal:e?.signal})},async createPortalSession(e){return t.send({op:"CreatePortalSession",method:"POST",path:"/purchases/stripe/portal",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async receiveAppleNotification(e){return t.send({op:"ReceiveAppleNotification",method:"POST",path:"/purchases/webhooks/apple",auth:[],answers:{200:"empty"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async receiveStripeEvent(e){return t.send({op:"ReceiveStripeEvent",method:"POST",path:"/purchases/webhooks/stripe",auth:[],answers:{200:"empty"},headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}}}var y={};n(y,{client:()=>w});function w(t){return{async broadcast(e){return t.send({op:"Broadcast",method:"POST",path:"/realtime/broadcast",auth:[["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getChannels(e){return t.send({op:"GetChannels",method:"GET",path:"/realtime/channels",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async putChannels(e){return t.send({op:"PutChannels",method:"PUT",path:"/realtime/channels",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getLimits(e){return t.send({op:"GetLimits",method:"GET",path:"/realtime/limits",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async putLimits(e){return t.send({op:"PutLimits",method:"PUT",path:"/realtime/limits",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async writeState(e){return t.send({op:"WriteState",method:"POST",path:"/realtime/state",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getStats(e){return t.send({op:"GetStats",method:"GET",path:"/realtime/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})}}}var u={};n(u,{client:()=>f});function f(t){return{async listSecretAudit(e){return t.send({op:"ListSecretAudit",method:"GET",path:"/secrets/audit",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async listSecrets(e){return t.send({op:"ListSecrets",method:"GET",path:"/secrets/"+s("ListSecrets","environment",e.path.environment),auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async getEnvironmentValues(e){return t.send({op:"GetEnvironmentValues",method:"GET",path:"/secrets/"+s("GetEnvironmentValues","environment",e.path.environment)+"/values",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async getSecret(e){return t.send({op:"GetSecret",method:"GET",path:"/secrets/"+s("GetSecret","environment",e.path.environment)+"/"+s("GetSecret","name",e.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async putSecret(e){return t.send({op:"PutSecret",method:"PUT",path:"/secrets/"+s("PutSecret","environment",e.path.environment)+"/"+s("PutSecret","name",e.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deleteSecret(e){return t.send({op:"DeleteSecret",method:"DELETE",path:"/secrets/"+s("DeleteSecret","environment",e.path.environment)+"/"+s("DeleteSecret","name",e.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async rollbackSecret(e){return t.send({op:"RollbackSecret",method:"POST",path:"/secrets/"+s("RollbackSecret","environment",e.path.environment)+"/"+s("RollbackSecret","name",e.path.name)+"/rollback",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listSecretVersions(e){return t.send({op:"ListSecretVersions",method:"GET",path:"/secrets/"+s("ListSecretVersions","environment",e.path.environment)+"/"+s("ListSecretVersions","name",e.path.name)+"/versions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})}}}var c={};n(c,{client:()=>T});function T(t){return{async listBuckets(e){return t.send({op:"ListBuckets",method:"GET",path:"/storage/buckets",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async getBucket(e){return t.send({op:"GetBucket",method:"GET",path:"/storage/buckets/"+s("GetBucket","bucket",e.path.bucket),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async putBucket(e){return t.send({op:"PutBucket",method:"PUT",path:"/storage/buckets/"+s("PutBucket","bucket",e.path.bucket),auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deleteBucket(e){return t.send({op:"DeleteBucket",method:"DELETE",path:"/storage/buckets/"+s("DeleteBucket","bucket",e.path.bucket),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:e.signal})},async copyObject(e){return t.send({op:"CopyObject",method:"POST",path:"/storage/buckets/"+s("CopyObject","bucket",e.path.bucket)+"/copy",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async moveObject(e){return t.send({op:"MoveObject",method:"POST",path:"/storage/buckets/"+s("MoveObject","bucket",e.path.bucket)+"/move",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listObjects(e){return t.send({op:"ListObjects",method:"GET",path:"/storage/buckets/"+s("ListObjects","bucket",e.path.bucket)+"/objects",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async getObject(e){return t.send({op:"GetObject",method:"GET",path:"/storage/buckets/"+s("GetObject","bucket",e.path.bucket)+"/objects/"+s("GetObject","path",e.path.path),auth:[["SecretKeyAuth"]],answers:{200:"raw",206:"raw",304:"empty"},query:e.query,headers:e.headers,signal:e.signal})},async putObject(e){return t.send({op:"PutObject",method:"PUT",path:"/storage/buckets/"+s("PutObject","bucket",e.path.bucket)+"/objects/"+s("PutObject","path",e.path.path),auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},query:e.query,headers:e.headers,body:{kind:"raw",contentType:e.contentType??"application/octet-stream",value:e.body},signal:e.signal})},async deleteObject(e){return t.send({op:"DeleteObject",method:"DELETE",path:"/storage/buckets/"+s("DeleteObject","bucket",e.path.bucket)+"/objects/"+s("DeleteObject","path",e.path.path),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:e.signal})},async headObject(e){return t.send({op:"HeadObject",method:"HEAD",path:"/storage/buckets/"+s("HeadObject","bucket",e.path.bucket)+"/objects/"+s("HeadObject","path",e.path.path),auth:[["SecretKeyAuth"]],answers:{200:"empty",304:"empty"},query:e.query,headers:e.headers,signal:e.signal})},async createSignedUrl(e){return t.send({op:"CreateSignedUrl",method:"POST",path:"/storage/buckets/"+s("CreateSignedUrl","bucket",e.path.bucket)+"/signed-urls",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async createUploadUrl(e){return t.send({op:"CreateUploadUrl",method:"POST",path:"/storage/buckets/"+s("CreateUploadUrl","bucket",e.path.bucket)+"/upload-urls",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getPublicObject(e){return t.send({op:"GetPublicObject",method:"GET",path:"/storage/public/"+s("GetPublicObject","bucket",e.path.bucket)+"/"+s("GetPublicObject","path",e.path.path),auth:[],answers:{200:"raw",206:"raw",304:"empty"},query:e.query,headers:e.headers,signal:e.signal})},async headPublicObject(e){return t.send({op:"HeadPublicObject",method:"HEAD",path:"/storage/public/"+s("HeadPublicObject","bucket",e.path.bucket)+"/"+s("HeadPublicObject","path",e.path.path),auth:[],answers:{200:"empty",304:"empty"},query:e.query,headers:e.headers,signal:e.signal})},async getSignedObject(e){return t.send({op:"GetSignedObject",method:"GET",path:"/storage/signed/"+s("GetSignedObject","bucket",e.path.bucket)+"/"+s("GetSignedObject","path",e.path.path),auth:[],answers:{200:"raw",206:"raw",304:"empty"},query:e.query,headers:e.headers,signal:e.signal})},async putSignedObject(e){return t.send({op:"PutSignedObject",method:"PUT",path:"/storage/signed/"+s("PutSignedObject","bucket",e.path.bucket)+"/"+s("PutSignedObject","path",e.path.path),auth:[],answers:{200:"json",201:"json"},query:e.query,headers:e.headers,body:{kind:"raw",contentType:e.contentType??"application/octet-stream",value:e.body},signal:e.signal})},async headSignedObject(e){return t.send({op:"HeadSignedObject",method:"HEAD",path:"/storage/signed/"+s("HeadSignedObject","bucket",e.path.bucket)+"/"+s("HeadSignedObject","path",e.path.path),auth:[],answers:{200:"empty",304:"empty"},query:e.query,headers:e.headers,signal:e.signal})},async getStorageStats(e){return t.send({op:"GetStorageStats",method:"GET",path:"/storage/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async upload(e){return t.send({op:"Upload",method:"POST",path:"/storage/upload/"+s("Upload","machine",e.path.machine)+"/"+s("Upload","route",e.path.route),auth:[["ApiKeyAuth","userJWT"],["ApiKeyAuth"]],answers:{},body:{kind:"raw",contentType:e.contentType??"multipart/form-data",value:e.body},signal:e.signal})}}}var m={};n(m,{client:()=>k});function k(t){return{async listActions(e){return t.send({op:"ListActions",method:"GET",path:"/stores/actions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async getAction(e){return t.send({op:"GetAction",method:"GET",path:"/stores/actions/"+s("GetAction","action_id",e.path.action_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async confirmAction(e){return t.send({op:"ConfirmAction",method:"POST",path:"/stores/actions/"+s("ConfirmAction","action_id",e.path.action_id)+"/confirm",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async declineAction(e){return t.send({op:"DeclineAction",method:"POST",path:"/stores/actions/"+s("DeclineAction","action_id",e.path.action_id)+"/decline",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async getAppleAccount(e){return t.send({op:"GetAppleAccount",method:"GET",path:"/stores/apple",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async disconnectApple(e){return t.send({op:"DisconnectApple",method:"DELETE",path:"/stores/apple",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:e?.headers,signal:e?.signal})},async checkAppleAccount(e){return t.send({op:"CheckAppleAccount",method:"POST",path:"/stores/apple/check",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e?.headers,signal:e?.signal})},async createAppleGrant(e){return t.send({op:"CreateAppleGrant",method:"POST",path:"/stores/apple/grants",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:e?.headers,signal:e?.signal})},async getSandboxReadiness(e){return t.send({op:"GetSandboxReadiness",method:"GET",path:"/stores/apple/readiness",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async listSandboxTesters(e){return t.send({op:"ListSandboxTesters",method:"GET",path:"/stores/apple/sandbox-testers",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async clearSandboxPurchaseHistory(e){return t.send({op:"ClearSandboxPurchaseHistory",method:"POST",path:"/stores/apple/sandbox-testers/clear-purchase-history",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async updateSandboxTester(e){return t.send({op:"UpdateSandboxTester",method:"PATCH",path:"/stores/apple/sandbox-testers/"+s("UpdateSandboxTester","tester_id",e.path.tester_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listApps(e){return t.send({op:"ListApps",method:"GET",path:"/stores/apps",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e?.signal})},async listFeedback(e){return t.send({op:"ListFeedback",method:"GET",path:"/stores/apps/"+s("ListFeedback","app_id",e.path.app_id)+"/feedback",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async listGroups(e){return t.send({op:"ListGroups",method:"GET",path:"/stores/apps/"+s("ListGroups","app_id",e.path.app_id)+"/groups",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async createGroup(e){return t.send({op:"CreateGroup",method:"POST",path:"/stores/apps/"+s("CreateGroup","app_id",e.path.app_id)+"/groups",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async linkApp(e){return t.send({op:"LinkApp",method:"POST",path:"/stores/apps/"+s("LinkApp","app_id",e.path.app_id)+"/link",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async createPackage(e){return t.send({op:"CreatePackage",method:"POST",path:"/stores/apps/"+s("CreatePackage","app_id",e.path.app_id)+"/packages",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getReviewInfo(e){return t.send({op:"GetReviewInfo",method:"GET",path:"/stores/apps/"+s("GetReviewInfo","app_id",e.path.app_id)+"/testflight/review-info",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e.query,signal:e.signal})},async setReviewInfo(e){return t.send({op:"SetReviewInfo",method:"PUT",path:"/stores/apps/"+s("SetReviewInfo","app_id",e.path.app_id)+"/testflight/review-info",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async getConnectPage(e){return t.send({op:"GetConnectPage",method:"GET",path:"/stores/connect",auth:[],answers:{200:"raw"},signal:e?.signal})},async connectAppleKey(e){return t.send({op:"ConnectAppleKey",method:"POST",path:"/stores/connect",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deleteGroup(e){return t.send({op:"DeleteGroup",method:"DELETE",path:"/stores/groups/"+s("DeleteGroup","group_id",e.path.group_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async renameGroup(e){return t.send({op:"RenameGroup",method:"PATCH",path:"/stores/groups/"+s("RenameGroup","group_id",e.path.group_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async addGroupBuild(e){return t.send({op:"AddGroupBuild",method:"POST",path:"/stores/groups/"+s("AddGroupBuild","group_id",e.path.group_id)+"/builds",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listTesters(e){return t.send({op:"ListTesters",method:"GET",path:"/stores/groups/"+s("ListTesters","group_id",e.path.group_id)+"/testers",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async setTesters(e){return t.send({op:"SetTesters",method:"PUT",path:"/stores/groups/"+s("SetTesters","group_id",e.path.group_id)+"/testers",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async listPackages(e){return t.send({op:"ListPackages",method:"GET",path:"/stores/packages",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:e?.query,signal:e?.signal})},async getPackage(e){return t.send({op:"GetPackage",method:"GET",path:"/stores/packages/"+s("GetPackage","package_id",e.path.package_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async uploadArtifact(e){return t.send({op:"UploadArtifact",method:"PUT",path:"/stores/packages/"+s("UploadArtifact","package_id",e.path.package_id)+"/artifact",auth:[],answers:{200:"json"},headers:e.headers,body:{kind:"raw",contentType:e.contentType??"application/octet-stream",value:e.body},signal:e.signal})},async planBetaReview(e){return t.send({op:"PlanBetaReview",method:"POST",path:"/stores/packages/"+s("PlanBetaReview","package_id",e.path.package_id)+"/beta-review",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async listDeliveries(e){return t.send({op:"ListDeliveries",method:"GET",path:"/stores/packages/"+s("ListDeliveries","package_id",e.path.package_id)+"/deliveries",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:e.signal})},async deliver(e){return t.send({op:"Deliver",method:"POST",path:"/stores/packages/"+s("Deliver","package_id",e.path.package_id)+"/deliveries",auth:[["SecretKeyAuth"]],answers:{200:"json",202:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async planExpire(e){return t.send({op:"PlanExpire",method:"POST",path:"/stores/packages/"+s("PlanExpire","package_id",e.path.package_id)+"/expire",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async planExportCompliance(e){return t.send({op:"PlanExportCompliance",method:"POST",path:"/stores/packages/"+s("PlanExportCompliance","package_id",e.path.package_id)+"/export-compliance",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async setWhatToTest(e){return t.send({op:"SetWhatToTest",method:"PUT",path:"/stores/packages/"+s("SetWhatToTest","package_id",e.path.package_id)+"/what-to-test",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}}}export{a,r as b,i as c,o as d,l as e,p as f,d as g,g as h,y as i,u as j,c as k,m as l,x as m};
@@ -1,4 +0,0 @@
1
- /*! palbase 0.6.2 — Palbase SDK License (see LICENSE) */
2
- import{AsyncLocalStorage as v}from"node:async_hooks";function x(n,e){return new Proxy(e,{get(s,t,i){if(c.getStore()?.services===void 0)return Reflect.get(s,t,i);let o=R(n,t,s),r=o[t];return typeof r=="function"?r.bind(o):r}})}function R(n,e,s){let t=c.getStore()?.services;if(t===void 0)return s;let i=t[n];if(i!==void 0)return i;if(n==="Log"||typeof e=="symbol"||e==="then")return s;throw new Error(`${n}.${String(e)} was read, but this test did not provide ${n}. Pass it: withServices({ ${n}: \u2026 }, () => \u2026)`)}var A=Symbol.for("palbase.backend.requestScope"),c=globalThis[A]??=new v,b;function I(n){b=n}var N=new Proxy({},{get(n,e){if(!b)throw new Error(`Palbase.${String(e)} is reached before the app is served (serve() binds it)`);return b[e]}}),C=new Proxy({},{get(n,e){let s=c.getStore(),t=s?.database;if(!t)throw new Error(s?.services?`Database.${String(e)} was read, and this test gave no Database: withServices({ Database: fake.raw }, \u2026)`:s?`Database.${String(e)}: this app declares no database \u2014 PalbaseFactory.create(\u2026, { db: { schemas } })`:`Database.${String(e)} is reached outside a request: it is the request's transaction, reached from a handler, a service it calls or an @On`);let i=t[e];return typeof i=="function"?i.bind(t):i}});function g(n,e,s){let t={time:new Date().toISOString(),level:n,msg:e},i=c.getStore();if(i&&(t.request_id=i.requestId),s)for(let[r,a]of Object.entries(s))t[r]=a instanceof Error?{name:a.name,message:a.message,stack:a.stack}:a;let o=O(t);n==="error"||n==="warn"?process.stderr.write(`${o}
3
- `):process.stdout.write(`${o}
4
- `)}function O(n){try{return JSON.stringify(n)}catch{let e=new WeakSet;try{return JSON.stringify(n,(s,t)=>{if(typeof t=="bigint")return t.toString();if(typeof t=="object"&&t!==null){if(e.has(t))return"[circular]";e.add(t)}return t})}catch{return JSON.stringify({time:n.time,level:n.level,msg:n.msg,request_id:n.request_id,unwritable:"a field of this line could not be written"})}}}var m=x("Log",{debug:(n,e)=>g("debug",n,e),info:(n,e)=>g("info",n,e),warn:(n,e)=>g("warn",n,e),error:(n,e)=>g("error",n,e)});var T=512,k=8,L=64,E=/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/,h={"i-klingon":"tlh","en-gb-oed":"en-GB-oxendict","sgn-be-fr":"sfb","zh-cmn-hans":"cmn-Hans","zh-yue":"yue","hy-arevela":"hy-arevela"};function P(n){let e=n.indexOf("-");return e>0?n.slice(0,e):n}function _(n){let e=n.split("-"),s=(e[0]??"").toLowerCase();return s==="mo"&&e.length===1?"ro-MD":s==="tl"?(e[0]="fil",e.join("-")):s==="sh"?(e[0]="sr",e.length>1&&/^[A-Za-z]{4}$/.test(e[1]??"")||e.splice(1,0,"Latn"),e.join("-")):n}function q(n){let e=n.trim().replaceAll("_","-");if(e===""||e==="*"||e.length>L)return;let s=e.toLowerCase(),t=Object.hasOwn(h,s)?h[s]:void 0;if(t===void 0){try{t=Intl.getCanonicalLocales(_(e))[0]}catch{return}if(t===void 0)return}let i=P(t);if(!(i===""||i==="und"||i==="mul"))return t}function D(n){let e=n.split("-"),s=e.findIndex((r,a)=>a>0&&r.length===1),t=s>0?e.slice(0,s):e,i=[],o=r=>{i.includes(r)||i.push(r)};for(let r=t.length;r>1||r===t.length;r--)o(t.slice(0,r).join("-"));if(!t.slice(1).some(r=>/^[A-Za-z]{4}$/.test(r)))try{let r=new Intl.Locale(t.join("-")).maximize().script;r&&o(`${t[0]}-${r}`)}catch{}return o(t[0]),i}function G(n,e){let s=[],t=i=>{i!==""&&!s.includes(i)&&s.push(i)};if(n!==null&&n.length<=T){let i=[];for(let o of n.split(",")){let r=o.trim();if(r==="")continue;let a=1,l=r.indexOf(";");if(l>=0){let y=r.slice(l+1);r=r.slice(0,l).trim();for(let f of y.split(";")){let p=f.indexOf("=");if(p<0||f.slice(0,p).trim().toLowerCase()!=="q")continue;let w=f.slice(p+1).trim(),d=E.test(w)?Number(w):Number.NaN;a=Number.isFinite(d)&&d>=0&&d<=1?d:0}}a>0&&i.push({tag:r,q:a,at:i.length})}i.sort((o,r)=>r.q-o.q||o.at-r.at);for(let{tag:o}of i.slice(0,k)){let r=q(o);if(r!==void 0)for(let a of D(r))t(a)}}return e!==void 0&&e!==""&&t(e),s}function $(n,e,s){let t=n.strings??{},i=Object.hasOwn(t,e)?t[e]:null;for(let o of s){if(o===n.source)break;let r=i!=null&&Object.hasOwn(i,o)?i[o]:void 0;if(typeof r=="string"&&r!=="")return{text:r,locale:o}}return{text:e,locale:n.source}}var j=/\{\{\s*([A-Za-z_][A-Za-z0-9_]*)\s*\}\}/g;function S(n,e){return n.replace(j,(s,t,i,o)=>{if(o[i-1]==="{"||o[i+s.length]==="}")return s;let r=e!==void 0&&Object.hasOwn(e,t)?e[t]:void 0;return r==null?"":String(r)})}var u;function K(n){u=n===void 0?void 0:{root:n,said:!1}}function Z(n,e){let s=c.getStore(),t=s?.strings;if(t===void 0)return u&&!u.said&&s?.services===void 0&&(u.said=!0,m.warn(`[palbase] t(): the app has no palbase/strings (looked in ${u.root}) \u2014 every sentence is said as it is written. \`npx palbase strings\` starts the table; an image takes it with COPY palbase ./palbase`)),S(n,e);let{text:i,locale:o}=$(t,n,s?.locales??[t.source]),r=s?.usedLocales;return r!==void 0&&!r.includes(o)&&r.push(o),S(i,e)}export{x as a,R as b,c,I as d,N as e,C as f,m as g,G as h,K as i,Z as j};