palbase 0.75.0 → 0.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/index.js +2 -2
- package/dist/ai-sdk/index.js +2 -2
- package/dist/backend/engine.js +2 -2
- package/dist/backend/env.js +1 -1
- package/dist/backend/index.js +3 -3
- package/dist/backend/stack.js +1 -1
- package/dist/backend/test.js +2 -2
- package/dist/chunks/{ZWASHVNO.js → 2NEPN2ZZ.js} +2 -2
- package/dist/chunks/{P6LK5BD6.js → 33XOVYAU.js} +2 -2
- package/dist/chunks/{2SVWIAAD.js → 3CN6HGTW.js} +1 -1
- package/dist/chunks/{HT6TR6AZ.js → 3VGWTVKI.js} +2 -2
- package/dist/chunks/{MT22R56P.js → 5RNXCTOO.js} +2 -2
- package/dist/chunks/{FJVUDV4I.js → 5YJZAPY2.js} +2 -2
- package/dist/chunks/{UPJGT3BN.js → A3I7H7QN.js} +1 -1
- package/dist/chunks/{XZSXLA3N.js → ALT62XIG.js} +2 -2
- package/dist/chunks/{KWVOOFCB.js → BRDO3ZPT.js} +1 -1
- package/dist/chunks/{7BSFT4SH.js → D6NOE76D.js} +1 -1
- package/dist/chunks/{EFDYHDIB.js → DKYFIOWM.js} +1 -1
- package/dist/chunks/{5NZNKECX.js → EXLA3A7O.js} +2 -2
- package/dist/chunks/{XUEBLD7V.js → ISMWEEGW.js} +1 -1
- package/dist/chunks/{RBZI2C7M.js → KEGVHELA.js} +1 -1
- package/dist/chunks/{7R5TMAGP.js → MKVIRNSJ.js} +2 -2
- package/dist/chunks/{POURMU7G.js → PGQNRJ2C.js} +2 -2
- package/dist/chunks/{GSY2E764.js → Q4UWBIJ6.js} +2 -2
- package/dist/chunks/{GMCROKBB.js → SVWF7ABJ.js} +2 -2
- package/dist/chunks/{SPMFD3LH.js → TGQGGUE6.js} +2 -2
- package/dist/chunks/{LGXI36R6.js → TUK6NH2Q.js} +2 -2
- package/dist/chunks/{UKONQ2R4.js → UHN63FGH.js} +7 -7
- package/dist/chunks/{G37YLKYL.js → UOW74IHY.js} +2 -2
- package/dist/chunks/{3GR5ZPYK.js → YRYPXVAJ.js} +2 -2
- package/dist/chunks/{YEZCBT5I.js → ZCMCYI2D.js} +2 -2
- package/dist/cli.js +2 -2
- package/dist/cloud/index.js +2 -2
- package/dist/refuse/ai-sdk.js +1 -1
- package/dist/refuse/ai.js +1 -1
- package/dist/refuse/backend.js +1 -1
- package/dist/refuse/cloud.js +1 -1
- package/dist/refuse/server.js +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/testing.js +2 -2
- package/dist/web/index.js +2 -2
- package/dist/web/message.js +2 -2
- package/dist/web/palbe.js +2 -2
- package/dist/web/payments-ui.js +2 -2
- package/dist/web/paywall.js +2 -2
- package/dist/web/push-sw.js +1 -1
- package/dist/web/ssr.js +2 -2
- package/dist/web/vite.js +2 -2
- package/package.json +2 -2
- package/types/backend/src/gateways.d.ts +9 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! palbase 0.
|
|
2
|
-
import{a as g,b}from"./
|
|
1
|
+
/*! palbase 0.76.0 — Palbase SDK License (see LICENSE) */
|
|
2
|
+
import{a as g,b}from"./ISMWEEGW.js";var A=Symbol.for("palbase.data"),T=globalThis,m=T[A]??=new WeakSet;function S(t){return t instanceof Date||ArrayBuffer.isView(t)||t instanceof ArrayBuffer}function k(t){let e=[t];for(;e.length>0;){let n=e.pop();if(!(typeof n!="object"||n===null||m.has(n)||S(n))){m.add(n);for(let a of Array.isArray(n)?n:Object.values(n))e.push(a)}}return t}var l=class extends Error{status;code;requestId;retryAfter;body;op;get isNetworkError(){return this.code==="network_error"}constructor(e){super(e.message,e.cause===void 0?void 0:{cause:e.cause}),this.name="PalbaseError",this.op=e.op,this.status=e.status,this.code=e.code,this.requestId=e.requestId,this.retryAfter=e.retryAfter,this.body=e.body}};function C(t,e,n){let a=String(n);if(a===""||a==="."||a==="..")throw new l({op:t,status:0,code:"invalid_path_parameter",message:`${t}: ${e} cannot be ${a===""?"empty":JSON.stringify(a)}`});return encodeURIComponent(a)}var x=new Set(["apikey","authorization"]),q=64*1024;function W(t){let e=E(t.baseUrl),n=t.fetch??globalThis.fetch,a=t.solveProofOfWork??!0,u=async(r,o)=>{let d=v(e,r),s=new Headers;for(let[h,y]of Object.entries(r.headers??{}))y!=null&&!x.has(h.toLowerCase())&&s.set(h,String(y));for(let[h,y]of Object.entries(o))s.set(h,y);await j(r,t.credentials,s),s.has("accept")||s.set("accept","application/json");let f={method:r.method,headers:s,redirect:"manual",signal:r.signal,...r.keepalive?{keepalive:!0}:{}};r.body&&r.body.value!==void 0&&(s.set("content-type",r.body.contentType),f.body=L(r.body.kind,r.body.value),R(f.body)||(f.duplex="half"));let i;try{i=r.onUploadProgress&&t.xmlHttpRequest?await $(t.xmlHttpRequest,r.op,d,f,r.onUploadProgress):await n(d,f)}catch(h){throw r.signal?.aborted||h instanceof l?h:new l({op:r.op,status:0,code:"network_error",message:`${r.op}: the request did not reach ${e.origin}`,cause:h})}let c=r.answers[i.status]??(r.ownResponse&&i.status>=200&&i.status<300?"raw":void 0);if(c===void 0)throw i.status>=200&&i.status<300?(await i.body?.cancel(),new l({op:r.op,status:i.status,code:"undeclared_answer",message:`${r.op}: the server answered ${i.status}, which its contract does not declare; the request may have taken effect`})):await O(r.op,i);let p;switch(c){case"json":try{p=k(await i.json())}catch(h){throw new l({op:r.op,status:i.status,code:"invalid_json",message:`${r.op}: the answer is not JSON`,cause:h})}break;case"raw":p=i;break;default:await i.body?.cancel(),p=void 0}return{status:i.status,data:p,headers:i.headers}};return{async send(r){try{return await u(r,{})}catch(o){let d=a&&o instanceof l&&o.status===403?g(o.body):null,s=r.body?.value;if(!d||r.body?.kind==="raw"&&!R(s))throw o;let f=o,i;try{i=await b(d,{signal:r.signal})}catch(c){throw r.signal?.aborted?c:new l({op:r.op,status:403,code:"pow_unsolved",message:`${r.op}: ${c instanceof Error?c.message:String(c)}`,requestId:f.requestId,body:f.body,cause:c})}return u(r,i)}}}}function $(t,e,n,a,u){return new Promise((r,o)=>{let d=a.signal;if(d?.aborted)return o(d.reason);let s=new t,f=()=>s.abort();d?.addEventListener("abort",f,{once:!0});let i=c=>{d?.removeEventListener("abort",f),c()};s.open(a.method??"GET",n.href),s.responseType="arraybuffer",new Headers(a.headers).forEach((c,p)=>s.setRequestHeader(p,c)),s.upload&&(s.upload.onprogress=c=>{c.lengthComputable&&u(c.loaded,c.total)}),s.onload=()=>i(()=>{if(s.responseURL!==""&&s.responseURL!==n.href){o(new l({op:e,status:0,code:"undeclared_redirect",message:`${e}: the server redirected; the answer is another address's, and was not read`}));return}if(s.status<200||s.status>599)return o(new TypeError(`${e}: answered ${s.status}`));let c=s.status===204||s.status===205||s.status===304;r(new Response(c?null:s.response,{status:s.status,statusText:s.statusText,headers:U(s.getAllResponseHeaders())}))}),s.onerror=()=>i(()=>o(new TypeError(`${e}: the request failed`))),s.onabort=()=>i(()=>o(d?.reason??new DOMException("The request was aborted","AbortError"))),s.send(a.body)})}function U(t){let e=new Headers;for(let n of t.split(/\r?\n/)){let a=n.indexOf(":");if(!(a<=0))try{e.append(n.slice(0,a).trim(),n.slice(a+1).trim())}catch{}}return e}function E(t){let e;try{e=new URL(t)}catch{throw new TypeError(`baseUrl ${JSON.stringify(t)} is not an absolute URL`)}let n=e.hostname==="localhost"||e.hostname.endsWith(".localhost")||e.hostname==="127.0.0.1"||e.hostname==="[::1]";if(e.protocol!=="https:"&&!(e.protocol==="http:"&&n))throw new TypeError(`baseUrl must be https (http only for a loopback address): ${e.origin}`);if(e.username||e.password||e.search||e.hash)throw new TypeError("baseUrl carries no user, query or fragment");if(e.pathname!=="/"&&e.pathname!=="")throw new TypeError("baseUrl is the project origin alone, with no path");return e}function v(t,e){if(!e.path.startsWith("/")||e.path.startsWith("//"))throw new l({op:e.op,status:0,code:"invalid_path",message:`${e.op}: path ${JSON.stringify(e.path)} is not absolute`});let n=new URL(e.path+P(e.query),t);if(n.origin!==t.origin)throw new l({op:e.op,status:0,code:"invalid_path",message:`${e.op}: path leaves the project's origin`});return n}async function j(t,e,n){if(t.auth.length===0)return;let a=t.auth.some(o=>o.includes("userJWT"))?await e.accessToken?.():void 0,u=o=>{switch(o){case"ApiKeyAuth":return!!(e.publishableKey??e.secretKey);case"SecretKeyAuth":case"AdminAuth":return!!(e.secretKey??e.token);case"PalbaseBearer":return!!e.token;case"userJWT":return!!a&&!e.token;default:return!1}},r=t.auth.filter(o=>o.every(u)).reduce((o,d)=>o===void 0||d.length>o.length?d:o,void 0);if(!r)throw new l({op:t.op,status:0,code:"missing_credential",message:`${t.op} needs one of: ${t.auth.map(o=>o.length===0?"nothing":o.join(" + ")).join(" | ")}`});for(let o of r)o==="ApiKeyAuth"?n.set("apikey",e.publishableKey??e.secretKey):(o==="SecretKeyAuth"||o==="AdminAuth"||o==="PalbaseBearer")&&e.token?n.set("authorization",`Bearer ${e.token}`):o==="SecretKeyAuth"||o==="AdminAuth"?n.set("apikey",e.secretKey):o==="userJWT"&&n.set("authorization",`Bearer ${a}`)}function L(t,e){switch(t){case"json":return JSON.stringify(e);case"form":{let n=new URLSearchParams;for(let[a,u]of Object.entries(e))w(n,a,u);return n}case"raw":return e}}function R(t){return!!(t==null||typeof t=="string"||t instanceof URLSearchParams||t instanceof Blob||t instanceof FormData||t instanceof ArrayBuffer||ArrayBuffer.isView(t))}function P(t){if(!t)return"";let e=new URLSearchParams;for(let[a,u]of Object.entries(t))w(e,a,u);let n=e.toString();return n===""?"":`?${n}`}function w(t,e,n){if(n!=null){if(Array.isArray(n)){for(let a of n)w(t,e,a);return}if(n instanceof Date){t.append(e,n.toISOString());return}t.append(e,typeof n=="object"?JSON.stringify(n):String(n))}}async function O(t,e){let n=await B(e,q).catch(()=>""),a;try{a=n===""?void 0:JSON.parse(n)}catch{a=n}let u=_(a)?a:void 0,r=Number(e.headers.get("retry-after")),o=e.status>=300&&e.status<400;return new l({op:t,status:e.status,code:u?.error??(o?"undeclared_redirect":`http_${e.status}`),message:u?.error_description??(o?`${t}: the server redirected (${e.status}); the request was not followed, its credentials stay here`:`${t}: ${e.status} ${e.statusText}`.trim()),requestId:u?.request_id??e.headers.get("x-request-id")??void 0,retryAfter:u?.retry_after??(Number.isFinite(r)&&r>0?r:void 0),body:a})}async function B(t,e){if(!t.body)return"";let n=t.body.getReader(),a=[],u=0;for(;u<e;){let{done:d,value:s}=await n.read();if(d)break;a.push(s),u+=s.byteLength}await n.cancel().catch(()=>{});let r=new Uint8Array(Math.min(u,e)),o=0;for(let d of a){let s=Math.min(d.byteLength,r.byteLength-o);if(r.set(d.subarray(0,s),o),o+=s,o>=r.byteLength)break}return new TextDecoder().decode(r)}function _(t){return typeof t=="object"&&t!==null&&typeof t.error=="string"}export{k as a,l as b,C as c,W as d,E as e,R as f};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! palbase 0.
|
|
2
|
-
import{a as w,d as He,e as Ke,f as Je}from"./
|
|
1
|
+
/*! palbase 0.76.0 — Palbase SDK License (see LICENSE) */
|
|
2
|
+
import{a as w,d as He,e as Ke,f as Je}from"./2NEPN2ZZ.js";import{a as ze}from"./KEGVHELA.js";import{a as Ve}from"./3VGWTVKI.js";import{a as Ge,b as Le,c as Fe}from"./SVWF7ABJ.js";import{b as I,d as Be}from"./UOW74IHY.js";async function*Qe(e,t={}){let i=e.getReader(),s=new TextDecoder,a="",d="",c=[],o,r=()=>{i.cancel().catch(()=>{})};t.signal?.addEventListener("abort",r,{once:!0});try{if(t.signal?.aborted)return;for(;;){let{done:n,value:l}=await i.read();if(n||t.signal?.aborted)return;t.onBytes?.(),a+=s.decode(l,{stream:!0});for(let u=a.indexOf(`
|
|
3
3
|
`);u>=0;u=a.indexOf(`
|
|
4
4
|
`)){let f=a.slice(0,a[u-1]==="\r"?u-1:u);a=a.slice(u+1),f===""?(d!==""&&(yield o===void 0?{event:d,data:c.join(`
|
|
5
5
|
`)}:{event:d,data:c.join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! palbase 0.
|
|
2
|
-
import{n as w}from"./HT6TR6AZ.js";import{b as c}from"./G37YLKYL.js";var P=new Set(["succeeded","requires_capture","failed","canceled","expired"]);function S(o){return P.has(o)}var W=new Set(["payments.payment.succeeded","payments.payment.failed","payments.payment.canceled","payments.payment.requires_capture"]),E=new Set(["payments.wallet.balance_changed","payments.wallet.hold_changed"]);function T(o){if(typeof o!="object"||o===null)return null;let e=o;return e.source!=="palbase.payments"||typeof e.intent_id!="string"||e.intent_id.length===0||typeof e.status!="string"||e.status.length===0?null:{source:"palbase.payments",intent_id:e.intent_id,status:e.status,...typeof e.decline_code=="string"&&e.decline_code.length>0?{decline_code:e.decline_code}:{},...typeof e.return_url=="string"&&e.return_url.length>0?{return_url:e.return_url}:{}}}var A={insufficient_funds:"Insufficient funds on this card. Please try another payment method.",card_declined:"Your card was declined by the issuing bank.",do_not_honor:"Your bank declined this transaction. Please contact your bank or use another card.",expired_card:"This card has expired. Please use a valid card.",incorrect_cvc:"The security code (CVC/CVV) is incorrect.",incorrect_number:"The card number is invalid.",invalid_expiry:"The card expiration date is invalid.",authentication_required:"Additional 3D Secure verification is required by your bank.",three_ds_failed:"3D Secure verification failed or was canceled.",otp_invalid:"The verification code is incorrect. Please try again.",otp_expired:"The verification code has expired. Please request a new one.",fraud_suspected:"This transaction was declined for security reasons.",velocity_exceeded:"Too many failed payment attempts. Please wait a moment and try again.",limit_exceeded:"This transaction exceeds your card limit.",card_not_permitted:"This card is not enabled for online or international transactions.",processing_error:"A temporary payment processing error occurred. Please try again.",provider_unavailable:"The payment provider is temporarily unavailable. Please try again.",wallet_frozen:"This wallet is currently frozen and cannot be charged.",wallet_insufficient_balance:"Insufficient wallet balance for this payment."};function B(o){return o?A[o]??"Payment was declined. Please try another payment method.":"Payment could not be completed. Please try again."}var _=class{api;profile;methods;wallet;subscriptions;session;socket;ref;origin;walletListeners=new Set;walletWatch;walletFollowing;lastBalances;eventListeners=new Set;eventWatch;eventFollowing;constructor(e,t,i,s,d){this.api=w.client(e),this.session=t,this.socket=i,this.ref=s,this.origin=d,this.profile={get:async n=>(await this.api.getMyProfile({signal:n?.signal})).data,update:async(n,a)=>(await this.api.updateMyProfile({body:n,signal:a?.signal})).data},this.methods={list:async n=>(await this.api.listMyMethods({signal:n?.signal})).data.methods,add:async(n={})=>{let a={...n.channel!==void 0?{channel:n.channel}:{},...n.vault!==void 0?{vault:n.vault}:{},...n.phone!==void 0?{phone:n.phone}:{},...n.returnUrl!==void 0?{return_url:n.returnUrl}:{},...n.cancelUrl!==void 0?{cancel_url:n.cancelUrl}:{}};return(await this.api.addMyMethod({body:a,signal:n.signal})).data.next_action},remove:async(n,a)=>{await this.api.deleteMyMethod({path:{method_id:n},signal:a?.signal})}},this.wallet={balances:async n=>{let a=this.session.snapshot()?.userId,l=(await this.api.listMyWallets({signal:n?.signal})).data.balances;return this.walletWatch&&this.walletWatch.userId===a&&this.offerBalances(this.walletWatch,l),l},balance:async(n,a)=>(await this.wallet.balances(a)).find(u=>u.wallet_key===n),topUp:async n=>{let a={wallet_key:n.walletKey,amount:n.amount,...n.channel!==void 0?{channel:n.channel}:{},...n.methodId!==void 0?{method_id:n.methodId}:{},...n.saveMethod!==void 0?{save_method:n.saveMethod}:{},...n.useMasterpass!==void 0?{use_masterpass:n.useMasterpass}:{},...n.phone!==void 0?{phone:n.phone}:{},...n.returnUrl!==void 0?{return_url:n.returnUrl}:{},...n.cancelUrl!==void 0?{cancel_url:n.cancelUrl}:{}},l=n.idempotencyKey?{"Idempotency-Key":n.idempotencyKey}:void 0;return(await this.api.topUpMyWallet({body:a,headers:l,signal:n.signal})).data},createSpendToken:async n=>{let a={wallet_key:n.walletKey,...n.maxAmount!==void 0?{max_amount:n.maxAmount}:{},...n.ttlSeconds!==void 0?{ttl_seconds:n.ttlSeconds}:{}};return(await this.api.createMySpendToken({body:a,signal:n.signal})).data},onChange:n=>this.onWalletChange(n)},this.subscriptions={list:async n=>(await this.api.listMySubscriptions({query:{limit:n?.limit,cursor:n?.cursor},signal:n?.signal})).data,cancel:async(n,a)=>(await this.api.cancelMySubscription({path:{subscription_id:n},signal:a?.signal})).data}}async capabilities(e={}){return(await this.api.getCapabilities({query:{...e.currency!==void 0?{currency:e.currency}:{},...e.channel!==void 0?{channel:e.channel}:{}},signal:e.signal})).data}async installments(e){let t={amount:e.amount,currency:e.currency,...e.bin!==void 0?{bin:e.bin}:{},...e.methodId!==void 0?{method_id:e.methodId}:{},...e.channel!==void 0?{channel:e.channel}:{}};return(await this.api.lookupInstallments({body:t,signal:e.signal})).data}async getIntent(e,t={}){return(await this.api.getIntent({path:{intent_id:e},query:t.clientSecret?{client_secret:t.clientSecret}:void 0,signal:t.signal})).data}async confirm(e,t={}){let i={...t.clientSecret!==void 0?{client_secret:t.clientSecret}:{},...t.methodId!==void 0?{method_id:t.methodId}:{},...t.saveMethod!==void 0?{save_method:t.saveMethod}:{},...t.useMasterpass!==void 0?{use_masterpass:t.useMasterpass}:{},...t.phone!==void 0?{phone:t.phone}:{},...t.buyer!==void 0?{buyer:t.buyer}:{},...t.installments!==void 0?{installments:t.installments}:{},...t.providerOptions!==void 0?{provider_options:t.providerOptions}:{}},s=t.idempotencyKey?{"Idempotency-Key":t.idempotencyKey}:void 0;return(await this.api.confirmIntent({path:{intent_id:e},body:i,headers:s,signal:t.signal})).data}async submitOtp(e,t){let i={challenge_id:t.challengeId,otp:t.otp,...t.clientSecret!==void 0?{client_secret:t.clientSecret}:{},...t.saveMethod!==void 0?{save_method:t.saveMethod}:{}};return(await this.api.submitIntentOtp({path:{intent_id:e},body:i,signal:t.signal})).data}async portal(e,t={}){let i={return_url:e,...t.channel!==void 0?{channel:t.channel}:{}};return(await this.api.createMyPortal({body:i,signal:t.signal})).data.url}async waitForIntent(e,t={}){let i=t.timeoutMs??3e5;if(t.signal?.aborted)throw t.signal.reason;return new Promise((s,d)=>{let n=!1,a=!1,l=!1,u=this.socket.channel(`payment_intent:${this.ref}:${e}`),h=()=>{v!==void 0&&clearTimeout(v),x(),u.leave(),y.removeEventListener?.("message",g),t.signal?.removeEventListener("abort",f)},I=r=>{n||(n=!0,h(),s(r))},p=r=>{n||(n=!0,h(),d(r))},m=async()=>{if(!n){if(a){l=!0;return}a=!0;try{for(;;){l=!1;try{let r=await this.getIntent(e,{clientSecret:t.clientSecret,signal:t.signal});if(S(r.status)){I(r);return}}catch(r){if(t.signal?.aborted){p(t.signal.reason);return}if(r instanceof c&&(r.status===401||r.status===403||r.status===404)){p(r);return}}if(n||!l)return}}finally{a=!1}}},x=u.on("broadcast",r=>{typeof r.event=="string"&&W.has(r.event)&&m()}),g=r=>{if(r.origin&&r.origin!=="null"&&r.origin!==this.origin)return;let b=T(r.data);b&&b.intent_id===e&&m()},f=()=>p(t.signal?.reason),y=globalThis;y.addEventListener?.("message",g),t.signal?.addEventListener("abort",f,{once:!0});let v=i>0?setTimeout(()=>{p(new c({op:"WaitForIntent",status:0,code:"payment_timeout",message:`timed out waiting for payment intent ${e}`}))},i):void 0;u.join().catch(()=>{}),m()})}async present(e,t={}){let i=t.clientSecret??e.client_secret,s=e.status!==void 0&&e.amount!==void 0?e:await this.getIntent(e.id,{clientSecret:i,signal:t.signal});for(let d=0;d<6;d++){if(S(s.status))return s;let n=s.next_action;if(!n||n.type==="none")return this.waitForIntent(s.id,{clientSecret:i,timeoutMs:t.timeoutMs,signal:t.signal});if(n.type==="redirect"){if(!n.url)throw new c({op:"PresentIntent",status:0,code:"invalid_next_action",message:"redirect next_action is missing url"});if(t.onRedirect)await t.onRedirect(n.url,n);else{let a=globalThis.location;if(!a)throw new c({op:"PresentIntent",status:0,code:"redirect_unavailable",message:"provide onRedirect in non-browser environments"});a.assign(n.url)}return this.waitForIntent(s.id,{clientSecret:i,timeoutMs:t.timeoutMs,signal:t.signal})}if(n.type==="embed"){let a;if(t.onEmbed){let l=await t.onEmbed(n);typeof l=="function"&&(a=l)}else if(t.container)a=k(t.container,n);else throw new c({op:"PresentIntent",status:0,code:"embed_container_required",message:"provide container or onEmbed to present an embedded 3DS/checkout action"});try{return await this.waitForIntent(s.id,{clientSecret:i,timeoutMs:t.timeoutMs,signal:t.signal})}finally{a?.()}}if(n.type==="otp"||n.type==="masterpass"){if(!t.onOtp)throw new c({op:"PresentIntent",status:0,code:"otp_handler_required",message:"provide onOtp to complete an OTP or Masterpass verification step"});let a=n.challenge_id??"",l=await t.onOtp({intentId:s.id,challengeId:a,maskedPhone:n.masked_phone??n.masterpass?.phone,expiresAt:n.expires_at,masterpass:n.masterpass});if(l===null)throw new c({op:"PresentIntent",status:0,code:"payment_canceled",message:"verification canceled by customer"});let u=typeof l=="string"?l:l.otp,h=typeof l=="string"?void 0:l.saveMethod;s=await this.submitOtp(s.id,{challengeId:a,otp:u,clientSecret:i,saveMethod:h,signal:t.signal});continue}return this.waitForIntent(s.id,{clientSecret:i,timeoutMs:t.timeoutMs,signal:t.signal})}return this.getIntent(s.id,{clientSecret:i,signal:t.signal})}onEvent(e){return this.eventListeners.add(e),this.eventListeners.size===1&&this.startEvents(),()=>{this.eventListeners.delete(e)&&this.eventListeners.size===0&&this.stopEvents()}}onWalletChange(e){if(this.walletListeners.add(e),this.walletListeners.size===1)this.startWalletWatch();else if(this.lastBalances!==void 0){let t=this.lastBalances;queueMicrotask(()=>this.walletListeners.has(e)&&M(e,t))}return()=>{this.walletListeners.delete(e)&&this.walletListeners.size===0&&this.stopWalletWatch()}}startWalletWatch(){this.walletFollowing=this.session.onChange((e,t)=>{(e==="SIGNED_IN"||e==="SIGNED_OUT"||e==="SESSION_EXPIRED")&&this.followWallet(t)}),this.session.session().then(e=>{this.walletFollowing&&!this.walletWatch&&this.lastBalances===void 0&&this.followWallet(e)})}stopWalletWatch(){this.walletFollowing?.(),this.walletFollowing=void 0,this.unfollowWallet(),this.lastBalances=void 0}followWallet(e){if(this.unfollowWallet(),!e){this.tellBalances(null);return}let t=this.socket.channel(`payments:${this.ref}:${e.userId}`),i={userId:e.userId,channel:t,off:()=>{},maxVersion:-1,reading:!1,wanted:!1},s=t.on("broadcast",d=>{typeof d.event=="string"&&E.has(d.event)&&this.walletChanged(i)});i.off=s,this.walletWatch=i,t.join().catch(()=>{}),this.readBalances(i)}unfollowWallet(){let e=this.walletWatch;e&&(this.walletWatch=void 0,e.off(),e.channel.leave())}walletChanged(e){this.walletWatch===e&&(e.reading?e.wanted=!0:this.readBalances(e))}async readBalances(e){e.reading=!0;try{for(;;){e.wanted=!1;try{let t=(await this.api.listMyWallets()).data.balances;if(this.walletWatch!==e)return;this.offerBalances(e,t)}catch{}if(this.walletWatch!==e||!e.wanted)return}}finally{e.reading=!1}}offerBalances(e,t){if(this.walletWatch!==e)return;let i=t.reduce((s,d)=>Math.max(s,d.version),0);e.maxVersion>=0&&i<e.maxVersion||(e.maxVersion=i,this.tellBalances(t))}tellBalances(e){if(!(this.lastBalances===null&&e===null)){this.lastBalances=e;for(let t of[...this.walletListeners])M(t,e)}}startEvents(){this.eventFollowing=this.session.onChange((e,t)=>{(e==="SIGNED_IN"||e==="SIGNED_OUT"||e==="SESSION_EXPIRED")&&this.followEvents(t)}),this.session.session().then(e=>{this.eventFollowing&&!this.eventWatch&&this.followEvents(e)})}stopEvents(){this.eventFollowing?.(),this.eventFollowing=void 0,this.unfollowEvents()}followEvents(e){if(this.unfollowEvents(),!e)return;let t=this.socket.channel(`payments:${this.ref}:${e.userId}`),i=t.on("broadcast",s=>{if(typeof s.event!="string")return;let d={type:s.event,payload:s.payload};for(let n of[...this.eventListeners])try{n(d)}catch{}});this.eventWatch={userId:e.userId,channel:t,off:i},t.join().catch(()=>{})}unfollowEvents(){let e=this.eventWatch;e&&(this.eventWatch=void 0,e.off(),e.channel.leave())}};function k(o,e){let i=o.ownerDocument.createElement("iframe");return i.setAttribute("data-palbase-payments-frame",""),i.setAttribute("title","Secure Payment Verification"),i.setAttribute("sandbox","allow-scripts allow-forms allow-same-origin allow-popups allow-top-navigation-by-user-activation"),i.style.width="100%",i.style.minHeight="480px",i.style.border="0",i.style.borderRadius="8px",i.style.background="#ffffff",e.html?i.srcdoc=e.html:e.url&&(i.src=e.url),o.replaceChildren(i),()=>{i.remove()}}function M(o,e){try{o(e)}catch{}}export{P as a,S as b,T as c,B as d,_ as e,k as f};
|
|
1
|
+
/*! palbase 0.76.0 — Palbase SDK License (see LICENSE) */
|
|
2
|
+
import{n as w}from"./3VGWTVKI.js";import{b as c}from"./UOW74IHY.js";var P=new Set(["succeeded","requires_capture","failed","canceled","expired"]);function S(o){return P.has(o)}var W=new Set(["payments.payment.succeeded","payments.payment.failed","payments.payment.canceled","payments.payment.requires_capture"]),E=new Set(["payments.wallet.balance_changed","payments.wallet.hold_changed"]);function T(o){if(typeof o!="object"||o===null)return null;let e=o;return e.source!=="palbase.payments"||typeof e.intent_id!="string"||e.intent_id.length===0||typeof e.status!="string"||e.status.length===0?null:{source:"palbase.payments",intent_id:e.intent_id,status:e.status,...typeof e.decline_code=="string"&&e.decline_code.length>0?{decline_code:e.decline_code}:{},...typeof e.return_url=="string"&&e.return_url.length>0?{return_url:e.return_url}:{}}}var A={insufficient_funds:"Insufficient funds on this card. Please try another payment method.",card_declined:"Your card was declined by the issuing bank.",do_not_honor:"Your bank declined this transaction. Please contact your bank or use another card.",expired_card:"This card has expired. Please use a valid card.",incorrect_cvc:"The security code (CVC/CVV) is incorrect.",incorrect_number:"The card number is invalid.",invalid_expiry:"The card expiration date is invalid.",authentication_required:"Additional 3D Secure verification is required by your bank.",three_ds_failed:"3D Secure verification failed or was canceled.",otp_invalid:"The verification code is incorrect. Please try again.",otp_expired:"The verification code has expired. Please request a new one.",fraud_suspected:"This transaction was declined for security reasons.",velocity_exceeded:"Too many failed payment attempts. Please wait a moment and try again.",limit_exceeded:"This transaction exceeds your card limit.",card_not_permitted:"This card is not enabled for online or international transactions.",processing_error:"A temporary payment processing error occurred. Please try again.",provider_unavailable:"The payment provider is temporarily unavailable. Please try again.",wallet_frozen:"This wallet is currently frozen and cannot be charged.",wallet_insufficient_balance:"Insufficient wallet balance for this payment."};function B(o){return o?A[o]??"Payment was declined. Please try another payment method.":"Payment could not be completed. Please try again."}var _=class{api;profile;methods;wallet;subscriptions;session;socket;ref;origin;walletListeners=new Set;walletWatch;walletFollowing;lastBalances;eventListeners=new Set;eventWatch;eventFollowing;constructor(e,t,i,s,d){this.api=w.client(e),this.session=t,this.socket=i,this.ref=s,this.origin=d,this.profile={get:async n=>(await this.api.getMyProfile({signal:n?.signal})).data,update:async(n,a)=>(await this.api.updateMyProfile({body:n,signal:a?.signal})).data},this.methods={list:async n=>(await this.api.listMyMethods({signal:n?.signal})).data.methods,add:async(n={})=>{let a={...n.channel!==void 0?{channel:n.channel}:{},...n.vault!==void 0?{vault:n.vault}:{},...n.phone!==void 0?{phone:n.phone}:{},...n.returnUrl!==void 0?{return_url:n.returnUrl}:{},...n.cancelUrl!==void 0?{cancel_url:n.cancelUrl}:{}};return(await this.api.addMyMethod({body:a,signal:n.signal})).data.next_action},remove:async(n,a)=>{await this.api.deleteMyMethod({path:{method_id:n},signal:a?.signal})}},this.wallet={balances:async n=>{let a=this.session.snapshot()?.userId,l=(await this.api.listMyWallets({signal:n?.signal})).data.balances;return this.walletWatch&&this.walletWatch.userId===a&&this.offerBalances(this.walletWatch,l),l},balance:async(n,a)=>(await this.wallet.balances(a)).find(u=>u.wallet_key===n),topUp:async n=>{let a={wallet_key:n.walletKey,amount:n.amount,...n.channel!==void 0?{channel:n.channel}:{},...n.methodId!==void 0?{method_id:n.methodId}:{},...n.saveMethod!==void 0?{save_method:n.saveMethod}:{},...n.useMasterpass!==void 0?{use_masterpass:n.useMasterpass}:{},...n.phone!==void 0?{phone:n.phone}:{},...n.returnUrl!==void 0?{return_url:n.returnUrl}:{},...n.cancelUrl!==void 0?{cancel_url:n.cancelUrl}:{}},l=n.idempotencyKey?{"Idempotency-Key":n.idempotencyKey}:void 0;return(await this.api.topUpMyWallet({body:a,headers:l,signal:n.signal})).data},createSpendToken:async n=>{let a={wallet_key:n.walletKey,...n.maxAmount!==void 0?{max_amount:n.maxAmount}:{},...n.ttlSeconds!==void 0?{ttl_seconds:n.ttlSeconds}:{}};return(await this.api.createMySpendToken({body:a,signal:n.signal})).data},onChange:n=>this.onWalletChange(n)},this.subscriptions={list:async n=>(await this.api.listMySubscriptions({query:{limit:n?.limit,cursor:n?.cursor},signal:n?.signal})).data,cancel:async(n,a)=>(await this.api.cancelMySubscription({path:{subscription_id:n},signal:a?.signal})).data}}async capabilities(e={}){return(await this.api.getCapabilities({query:{...e.currency!==void 0?{currency:e.currency}:{},...e.channel!==void 0?{channel:e.channel}:{}},signal:e.signal})).data}async installments(e){let t={amount:e.amount,currency:e.currency,...e.bin!==void 0?{bin:e.bin}:{},...e.methodId!==void 0?{method_id:e.methodId}:{},...e.channel!==void 0?{channel:e.channel}:{}};return(await this.api.lookupInstallments({body:t,signal:e.signal})).data}async getIntent(e,t={}){return(await this.api.getIntent({path:{intent_id:e},query:t.clientSecret?{client_secret:t.clientSecret}:void 0,signal:t.signal})).data}async confirm(e,t={}){let i={...t.clientSecret!==void 0?{client_secret:t.clientSecret}:{},...t.methodId!==void 0?{method_id:t.methodId}:{},...t.saveMethod!==void 0?{save_method:t.saveMethod}:{},...t.useMasterpass!==void 0?{use_masterpass:t.useMasterpass}:{},...t.phone!==void 0?{phone:t.phone}:{},...t.buyer!==void 0?{buyer:t.buyer}:{},...t.installments!==void 0?{installments:t.installments}:{},...t.providerOptions!==void 0?{provider_options:t.providerOptions}:{}},s=t.idempotencyKey?{"Idempotency-Key":t.idempotencyKey}:void 0;return(await this.api.confirmIntent({path:{intent_id:e},body:i,headers:s,signal:t.signal})).data}async submitOtp(e,t){let i={challenge_id:t.challengeId,otp:t.otp,...t.clientSecret!==void 0?{client_secret:t.clientSecret}:{},...t.saveMethod!==void 0?{save_method:t.saveMethod}:{}};return(await this.api.submitIntentOtp({path:{intent_id:e},body:i,signal:t.signal})).data}async portal(e,t={}){let i={return_url:e,...t.channel!==void 0?{channel:t.channel}:{}};return(await this.api.createMyPortal({body:i,signal:t.signal})).data.url}async waitForIntent(e,t={}){let i=t.timeoutMs??3e5;if(t.signal?.aborted)throw t.signal.reason;return new Promise((s,d)=>{let n=!1,a=!1,l=!1,u=this.socket.channel(`payment_intent:${this.ref}:${e}`),h=()=>{v!==void 0&&clearTimeout(v),x(),u.leave(),y.removeEventListener?.("message",g),t.signal?.removeEventListener("abort",f)},I=r=>{n||(n=!0,h(),s(r))},p=r=>{n||(n=!0,h(),d(r))},m=async()=>{if(!n){if(a){l=!0;return}a=!0;try{for(;;){l=!1;try{let r=await this.getIntent(e,{clientSecret:t.clientSecret,signal:t.signal});if(S(r.status)){I(r);return}}catch(r){if(t.signal?.aborted){p(t.signal.reason);return}if(r instanceof c&&(r.status===401||r.status===403||r.status===404)){p(r);return}}if(n||!l)return}}finally{a=!1}}},x=u.on("broadcast",r=>{typeof r.event=="string"&&W.has(r.event)&&m()}),g=r=>{if(r.origin&&r.origin!=="null"&&r.origin!==this.origin)return;let b=T(r.data);b&&b.intent_id===e&&m()},f=()=>p(t.signal?.reason),y=globalThis;y.addEventListener?.("message",g),t.signal?.addEventListener("abort",f,{once:!0});let v=i>0?setTimeout(()=>{p(new c({op:"WaitForIntent",status:0,code:"payment_timeout",message:`timed out waiting for payment intent ${e}`}))},i):void 0;u.join().catch(()=>{}),m()})}async present(e,t={}){let i=t.clientSecret??e.client_secret,s=e.status!==void 0&&e.amount!==void 0?e:await this.getIntent(e.id,{clientSecret:i,signal:t.signal});for(let d=0;d<6;d++){if(S(s.status))return s;let n=s.next_action;if(!n||n.type==="none")return this.waitForIntent(s.id,{clientSecret:i,timeoutMs:t.timeoutMs,signal:t.signal});if(n.type==="redirect"){if(!n.url)throw new c({op:"PresentIntent",status:0,code:"invalid_next_action",message:"redirect next_action is missing url"});if(t.onRedirect)await t.onRedirect(n.url,n);else{let a=globalThis.location;if(!a)throw new c({op:"PresentIntent",status:0,code:"redirect_unavailable",message:"provide onRedirect in non-browser environments"});a.assign(n.url)}return this.waitForIntent(s.id,{clientSecret:i,timeoutMs:t.timeoutMs,signal:t.signal})}if(n.type==="embed"){let a;if(t.onEmbed){let l=await t.onEmbed(n);typeof l=="function"&&(a=l)}else if(t.container)a=k(t.container,n);else throw new c({op:"PresentIntent",status:0,code:"embed_container_required",message:"provide container or onEmbed to present an embedded 3DS/checkout action"});try{return await this.waitForIntent(s.id,{clientSecret:i,timeoutMs:t.timeoutMs,signal:t.signal})}finally{a?.()}}if(n.type==="otp"||n.type==="masterpass"){if(!t.onOtp)throw new c({op:"PresentIntent",status:0,code:"otp_handler_required",message:"provide onOtp to complete an OTP or Masterpass verification step"});let a=n.challenge_id??"",l=await t.onOtp({intentId:s.id,challengeId:a,maskedPhone:n.masked_phone??n.masterpass?.phone,expiresAt:n.expires_at,masterpass:n.masterpass});if(l===null)throw new c({op:"PresentIntent",status:0,code:"payment_canceled",message:"verification canceled by customer"});let u=typeof l=="string"?l:l.otp,h=typeof l=="string"?void 0:l.saveMethod;s=await this.submitOtp(s.id,{challengeId:a,otp:u,clientSecret:i,saveMethod:h,signal:t.signal});continue}return this.waitForIntent(s.id,{clientSecret:i,timeoutMs:t.timeoutMs,signal:t.signal})}return this.getIntent(s.id,{clientSecret:i,signal:t.signal})}onEvent(e){return this.eventListeners.add(e),this.eventListeners.size===1&&this.startEvents(),()=>{this.eventListeners.delete(e)&&this.eventListeners.size===0&&this.stopEvents()}}onWalletChange(e){if(this.walletListeners.add(e),this.walletListeners.size===1)this.startWalletWatch();else if(this.lastBalances!==void 0){let t=this.lastBalances;queueMicrotask(()=>this.walletListeners.has(e)&&M(e,t))}return()=>{this.walletListeners.delete(e)&&this.walletListeners.size===0&&this.stopWalletWatch()}}startWalletWatch(){this.walletFollowing=this.session.onChange((e,t)=>{(e==="SIGNED_IN"||e==="SIGNED_OUT"||e==="SESSION_EXPIRED")&&this.followWallet(t)}),this.session.session().then(e=>{this.walletFollowing&&!this.walletWatch&&this.lastBalances===void 0&&this.followWallet(e)})}stopWalletWatch(){this.walletFollowing?.(),this.walletFollowing=void 0,this.unfollowWallet(),this.lastBalances=void 0}followWallet(e){if(this.unfollowWallet(),!e){this.tellBalances(null);return}let t=this.socket.channel(`payments:${this.ref}:${e.userId}`),i={userId:e.userId,channel:t,off:()=>{},maxVersion:-1,reading:!1,wanted:!1},s=t.on("broadcast",d=>{typeof d.event=="string"&&E.has(d.event)&&this.walletChanged(i)});i.off=s,this.walletWatch=i,t.join().catch(()=>{}),this.readBalances(i)}unfollowWallet(){let e=this.walletWatch;e&&(this.walletWatch=void 0,e.off(),e.channel.leave())}walletChanged(e){this.walletWatch===e&&(e.reading?e.wanted=!0:this.readBalances(e))}async readBalances(e){e.reading=!0;try{for(;;){e.wanted=!1;try{let t=(await this.api.listMyWallets()).data.balances;if(this.walletWatch!==e)return;this.offerBalances(e,t)}catch{}if(this.walletWatch!==e||!e.wanted)return}}finally{e.reading=!1}}offerBalances(e,t){if(this.walletWatch!==e)return;let i=t.reduce((s,d)=>Math.max(s,d.version),0);e.maxVersion>=0&&i<e.maxVersion||(e.maxVersion=i,this.tellBalances(t))}tellBalances(e){if(!(this.lastBalances===null&&e===null)){this.lastBalances=e;for(let t of[...this.walletListeners])M(t,e)}}startEvents(){this.eventFollowing=this.session.onChange((e,t)=>{(e==="SIGNED_IN"||e==="SIGNED_OUT"||e==="SESSION_EXPIRED")&&this.followEvents(t)}),this.session.session().then(e=>{this.eventFollowing&&!this.eventWatch&&this.followEvents(e)})}stopEvents(){this.eventFollowing?.(),this.eventFollowing=void 0,this.unfollowEvents()}followEvents(e){if(this.unfollowEvents(),!e)return;let t=this.socket.channel(`payments:${this.ref}:${e.userId}`),i=t.on("broadcast",s=>{if(typeof s.event!="string")return;let d={type:s.event,payload:s.payload};for(let n of[...this.eventListeners])try{n(d)}catch{}});this.eventWatch={userId:e.userId,channel:t,off:i},t.join().catch(()=>{})}unfollowEvents(){let e=this.eventWatch;e&&(this.eventWatch=void 0,e.off(),e.channel.leave())}};function k(o,e){let i=o.ownerDocument.createElement("iframe");return i.setAttribute("data-palbase-payments-frame",""),i.setAttribute("title","Secure Payment Verification"),i.setAttribute("sandbox","allow-scripts allow-forms allow-same-origin allow-popups allow-top-navigation-by-user-activation"),i.style.width="100%",i.style.minHeight="480px",i.style.border="0",i.style.borderRadius="8px",i.style.background="#ffffff",e.html?i.srcdoc=e.html:e.url&&(i.src=e.url),o.replaceChildren(i),()=>{i.remove()}}function M(o,e){try{o(e)}catch{}}export{P as a,S as b,T as c,B as d,_ as e,k as f};
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! palbase 0.
|
|
2
|
+
/*! palbase 0.76.0 — Palbase SDK License (see LICENSE) */
|
|
3
3
|
var Q0=Object.defineProperty;var wt=(e,t)=>{for(var n in t)Q0(e,n,{get:t[n],enumerable:!0})};import{parseArgs as MS}from"node:util";var eS=Symbol.for("palbase.data"),tS=globalThis,Ou=tS[eS]??=new WeakSet;function nS(e){return e instanceof Date||ArrayBuffer.isView(e)||e instanceof ArrayBuffer}function Bi(e){let t=[e];for(;t.length>0;){let n=t.pop();if(!(typeof n!="object"||n===null||Ou.has(n)||nS(n))){Ou.add(n);for(let s of Array.isArray(n)?n:Object.values(n))t.push(s)}}return e}var sS="X-PoW-Challenge-ID",aS="X-PoW-Nonce";function xu(e){if(typeof e!="object"||e===null)return null;let t=e;if(t.error!=="pow_required"||typeof t.challenge!="object"||t.challenge===null)return null;let{id:n,prefix:s,difficulty:a}=t.challenge;return typeof n!="string"||typeof s!="string"||typeof a!="number"||!Number.isInteger(a)||a<0?null:{id:n,prefix:s,difficulty:a}}function oS(e){return 8*2**e}var Oa;async function iS(){if(Oa)return Oa;let e=globalThis;if(e.process?.versions?.node!==void 0||e.process?.versions?.bun!==void 0)try{let s=(await import("node:crypto")).createHash;if(typeof s=="function")return Oa=a=>new Uint8Array(s("sha256").update(a).digest()),Oa}catch{}let t=new TextEncoder;return Oa=async n=>new Uint8Array(await crypto.subtle.digest("SHA-256",t.encode(n))),Oa}function rS(e){let t=0;for(let n of e){if(n===0){t+=8;continue}return t+Math.clz32(n)-24}return t}var lS=4096,pS=typeof globalThis.setImmediate=="function"?()=>new Promise(e=>globalThis.setImmediate(e)):()=>new Promise(e=>setTimeout(e,0));async function Lu(e,t={}){if(e.difficulty>24)throw new Error(`proof-of-work: difficulty ${e.difficulty} is above auth's ceiling of 24`);let n=await iS(),s=oS(e.difficulty),a=Date.now()+(t.timeLimitMs??12e4);for(let o=0;o<s;o++){if(o%lS===0&&o>0){if(await pS(),t.signal?.aborted)throw t.signal.reason??new DOMException("proof-of-work aborted","AbortError");if(Date.now()>a)throw new Error(`proof-of-work: gave up on difficulty ${e.difficulty} after ${o} attempts`)}let i=n(e.prefix+o),r=i instanceof Uint8Array?i:await i;if(rS(r)>=e.difficulty)return{[sS]:e.id,[aS]:String(o)}}throw new Error(`proof-of-work: no nonce for difficulty ${e.difficulty} within ${s} attempts`)}var G=class extends Error{status;code;requestId;retryAfter;body;op;get isNetworkError(){return this.code==="network_error"}constructor(t){super(t.message,t.cause===void 0?void 0:{cause:t.cause}),this.name="PalbaseError",this.op=t.op,this.status=t.status,this.code=t.code,this.requestId=t.requestId,this.retryAfter=t.retryAfter,this.body=t.body}};function c(e,t,n){let s=String(n);if(s===""||s==="."||s==="..")throw new G({op:e,status:0,code:"invalid_path_parameter",message:`${e}: ${t} cannot be ${s===""?"empty":JSON.stringify(s)}`});return encodeURIComponent(s)}var dS=new Set(["apikey","authorization"]),cS=64*1024;function dp(e){let t=Ji(e.baseUrl),n=e.fetch??globalThis.fetch,s=e.solveProofOfWork??!0,a=async(o,i)=>{let r=gS(t,o),l=new Headers;for(let[y,w]of Object.entries(o.headers??{}))w!=null&&!dS.has(y.toLowerCase())&&l.set(y,String(w));for(let[y,w]of Object.entries(i))l.set(y,w);await hS(o,e.credentials,l),l.has("accept")||l.set("accept","application/json");let p={method:o.method,headers:l,redirect:"manual",signal:o.signal,...o.keepalive?{keepalive:!0}:{}};o.body&&o.body.value!==void 0&&(l.set("content-type",o.body.contentType),p.body=yS(o.body.kind,o.body.value),xa(p.body)||(p.duplex="half"));let d;try{d=o.onUploadProgress&&e.xmlHttpRequest?await uS(e.xmlHttpRequest,o.op,r,p,o.onUploadProgress):await n(r,p)}catch(y){throw o.signal?.aborted||y instanceof G?y:new G({op:o.op,status:0,code:"network_error",message:`${o.op}: the request did not reach ${t.origin}`,cause:y})}let u=o.answers[d.status]??(o.ownResponse&&d.status>=200&&d.status<300?"raw":void 0);if(u===void 0)throw d.status>=200&&d.status<300?(await d.body?.cancel(),new G({op:o.op,status:d.status,code:"undeclared_answer",message:`${o.op}: the server answered ${d.status}, which its contract does not declare; the request may have taken effect`})):await bS(o.op,d);let g;switch(u){case"json":try{g=Bi(await d.json())}catch(y){throw new G({op:o.op,status:d.status,code:"invalid_json",message:`${o.op}: the answer is not JSON`,cause:y})}break;case"raw":g=d;break;default:await d.body?.cancel(),g=void 0}return{status:d.status,data:g,headers:d.headers}};return{async send(o){try{return await a(o,{})}catch(i){let r=s&&i instanceof G&&i.status===403?xu(i.body):null,l=o.body?.value;if(!r||o.body?.kind==="raw"&&!xa(l))throw i;let p=i,d;try{d=await Lu(r,{signal:o.signal})}catch(u){throw o.signal?.aborted?u:new G({op:o.op,status:403,code:"pow_unsolved",message:`${o.op}: ${u instanceof Error?u.message:String(u)}`,requestId:p.requestId,body:p.body,cause:u})}return a(o,d)}}}}function uS(e,t,n,s,a){return new Promise((o,i)=>{let r=s.signal;if(r?.aborted)return i(r.reason);let l=new e,p=()=>l.abort();r?.addEventListener("abort",p,{once:!0});let d=u=>{r?.removeEventListener("abort",p),u()};l.open(s.method??"GET",n.href),l.responseType="arraybuffer",new Headers(s.headers).forEach((u,g)=>l.setRequestHeader(g,u)),l.upload&&(l.upload.onprogress=u=>{u.lengthComputable&&a(u.loaded,u.total)}),l.onload=()=>d(()=>{if(l.responseURL!==""&&l.responseURL!==n.href){i(new G({op:t,status:0,code:"undeclared_redirect",message:`${t}: the server redirected; the answer is another address's, and was not read`}));return}if(l.status<200||l.status>599)return i(new TypeError(`${t}: answered ${l.status}`));let u=l.status===204||l.status===205||l.status===304;o(new Response(u?null:l.response,{status:l.status,statusText:l.statusText,headers:mS(l.getAllResponseHeaders())}))}),l.onerror=()=>d(()=>i(new TypeError(`${t}: the request failed`))),l.onabort=()=>d(()=>i(r?.reason??new DOMException("The request was aborted","AbortError"))),l.send(s.body)})}function mS(e){let t=new Headers;for(let n of e.split(/\r?\n/)){let s=n.indexOf(":");if(!(s<=0))try{t.append(n.slice(0,s).trim(),n.slice(s+1).trim())}catch{}}return t}function Ji(e){let t;try{t=new URL(e)}catch{throw new TypeError(`baseUrl ${JSON.stringify(e)} is not an absolute URL`)}let n=t.hostname==="localhost"||t.hostname.endsWith(".localhost")||t.hostname==="127.0.0.1"||t.hostname==="[::1]";if(t.protocol!=="https:"&&!(t.protocol==="http:"&&n))throw new TypeError(`baseUrl must be https (http only for a loopback address): ${t.origin}`);if(t.username||t.password||t.search||t.hash)throw new TypeError("baseUrl carries no user, query or fragment");if(t.pathname!=="/"&&t.pathname!=="")throw new TypeError("baseUrl is the project origin alone, with no path");return t}function gS(e,t){if(!t.path.startsWith("/")||t.path.startsWith("//"))throw new G({op:t.op,status:0,code:"invalid_path",message:`${t.op}: path ${JSON.stringify(t.path)} is not absolute`});let n=new URL(t.path+fS(t.query),e);if(n.origin!==e.origin)throw new G({op:t.op,status:0,code:"invalid_path",message:`${t.op}: path leaves the project's origin`});return n}async function hS(e,t,n){if(e.auth.length===0)return;let s=e.auth.some(i=>i.includes("userJWT"))?await t.accessToken?.():void 0,a=i=>{switch(i){case"ApiKeyAuth":return!!(t.publishableKey??t.secretKey);case"SecretKeyAuth":case"AdminAuth":return!!(t.secretKey??t.token);case"PalbaseBearer":return!!t.token;case"userJWT":return!!s&&!t.token;default:return!1}},o=e.auth.filter(i=>i.every(a)).reduce((i,r)=>i===void 0||r.length>i.length?r:i,void 0);if(!o)throw new G({op:e.op,status:0,code:"missing_credential",message:`${e.op} needs one of: ${e.auth.map(i=>i.length===0?"nothing":i.join(" + ")).join(" | ")}`});for(let i of o)i==="ApiKeyAuth"?n.set("apikey",t.publishableKey??t.secretKey):(i==="SecretKeyAuth"||i==="AdminAuth"||i==="PalbaseBearer")&&t.token?n.set("authorization",`Bearer ${t.token}`):i==="SecretKeyAuth"||i==="AdminAuth"?n.set("apikey",t.secretKey):i==="userJWT"&&n.set("authorization",`Bearer ${s}`)}function yS(e,t){switch(e){case"json":return JSON.stringify(t);case"form":{let n=new URLSearchParams;for(let[s,a]of Object.entries(t))cp(n,s,a);return n}case"raw":return t}}function xa(e){return!!(e==null||typeof e=="string"||e instanceof URLSearchParams||e instanceof Blob||e instanceof FormData||e instanceof ArrayBuffer||ArrayBuffer.isView(e))}function fS(e){if(!e)return"";let t=new URLSearchParams;for(let[s,a]of Object.entries(e))cp(t,s,a);let n=t.toString();return n===""?"":`?${n}`}function cp(e,t,n){if(n!=null){if(Array.isArray(n)){for(let s of n)cp(e,t,s);return}if(n instanceof Date){e.append(t,n.toISOString());return}e.append(t,typeof n=="object"?JSON.stringify(n):String(n))}}async function bS(e,t){let n=await wS(t,cS).catch(()=>""),s;try{s=n===""?void 0:JSON.parse(n)}catch{s=n}let a=vS(s)?s:void 0,o=Number(t.headers.get("retry-after")),i=t.status>=300&&t.status<400;return new G({op:e,status:t.status,code:a?.error??(i?"undeclared_redirect":`http_${t.status}`),message:a?.error_description??(i?`${e}: the server redirected (${t.status}); the request was not followed, its credentials stay here`:`${e}: ${t.status} ${t.statusText}`.trim()),requestId:a?.request_id??t.headers.get("x-request-id")??void 0,retryAfter:a?.retry_after??(Number.isFinite(o)&&o>0?o:void 0),body:s})}async function wS(e,t){if(!e.body)return"";let n=e.body.getReader(),s=[],a=0;for(;a<t;){let{done:r,value:l}=await n.read();if(r)break;s.push(l),a+=l.byteLength}await n.cancel().catch(()=>{});let o=new Uint8Array(Math.min(a,t)),i=0;for(let r of s){let l=Math.min(r.byteLength,o.byteLength-i);if(o.set(r.subarray(0,l),i),i+=l,i>=o.byteLength)break}return new TextDecoder().decode(o)}function vS(e){return typeof e=="object"&&e!==null&&typeof e.error=="string"}var Hi={project:{type:"string",short:"P",value:"project",description:"the project (name or id; org/project when the name is in two organizations)"},env:{type:"string",short:"E",value:"env",description:"the project's environment (slug or ref)"},json:{type:"boolean",description:"print the answer as JSON"},"non-interactive":{type:"boolean",description:"never ask: refuse what would need a question"},yes:{type:"boolean",short:"y",description:"confirm a change to a production environment without asking"},debug:{type:"boolean",description:"print each request the command sends"},help:{type:"boolean",short:"h",description:"show help"}};var b=class extends Error{exitCode;hint;code;reported;constructor(t,n,s={}){super(n),this.name="CliError",this.code=t,this.hint=s.hint,this.exitCode=s.exitCode??1,this.reported=s.reported??!1}};function h(e,t){return new b("usage",e,{hint:t,exitCode:2})}var Vi=class{io;json;constructor(t,n){this.io=t,this.json=n}result(t,n){this.json?this.io.stdout(`${JSON.stringify(t,null,2)}
|
|
4
4
|
`):n()}line(t=""){this.io.stdout(`${le(t)}
|
|
5
5
|
`)}note(t){this.io.stderr(`${le(t)}
|
|
@@ -9,7 +9,7 @@ var Q0=Object.defineProperty;var wt=(e,t)=>{for(var n in t)Q0(e,n,{get:t[n],enum
|
|
|
9
9
|
`);let i;try{i=await this.io.fetch(t,{method:n.method,headers:{...n.headers,...a},body:n.body,signal:n.signal,...s?{}:{duplex:"half"},redirect:"manual"})}catch(l){throw n.signal?.aborted?l:new b("network_error",`${new URL(t).origin} could not be reached: ${l instanceof Error?l.message:String(l)}`)}if(this.debug&&this.io.stderr(`< ${i.status} ${i.headers.get("x-request-id")??""}
|
|
10
10
|
`),i.status!==503||!s||o>=LS||!xS.has(await hp(i)??""))return i;await i.body?.cancel();let r=Number(i.headers.get("retry-after")??"");await this.io.sleep((Number.isFinite(r)&&r>0?Math.min(r,30):1)*1e3)}}async exchange(t,n,s){let a=await this.token(),o=await this.send(t,n,s,a.value);if(o.status===401&&a.renewable){let i=await this.renew(await this.currentSession());o=await this.send(t,n,s,i.access_token)}return{res:o,renewable:a.renewable}}async answered(t,n,s,a){if(s.status===204)return;let o=await s.text(),i=o===""?void 0:IS(o);if(s.ok)return i;let r=i??{};throw s.status===401?r.error==="token_not_for_machines"?Vu(new URL(this.cloud.studioApi).host):a?La():this.tokenRefused("Studio"):new G({op:`${t} ${n}`,status:s.status,code:r.error??`http_${s.status}`,message:r.error_description??`Studio answered ${s.status}`,requestId:r.request_id??s.headers.get("x-request-id")??void 0,body:i})}tokenRefused(t){return(this.io.env.PALBASE_TOKEN??"").startsWith("pbe_")?new b("token_refused",`${t} refused PALBASE_TOKEN, an environment's token: it ended (a few hours at most), it was revoked, or what minted it no longer holds`,{hint:"mint another: palbase env:tokens:create --scope <scope> (an admin), or with the environment's secret key (Studio's POST /environments/{ref}/tokens)"}):(this.io.env.PALBASE_TOKEN??"").startsWith("pbu_")?new b("token_refused",`${t} refused PALBASE_TOKEN, an account token: it was revoked, it ended, or, in this organization, the one who made it left it`,{hint:"its maker makes a new one: palbase account:tokens:create <name>"}):new b("token_refused",`${t} refused PALBASE_TOKEN: it was revoked, it ended, or the one who made it no longer holds its role`,{hint:"an admin makes a new one: palbase tokens:create <name>"})}async token(){let t=this.io.env.PALBASE_TOKEN;return t&&t!==""?{value:t,renewable:!1}:{value:(await this.currentSession()).access_token,renewable:!0}}async renew(t){let n=await Wu(this.io,this.cloud,t);return await this.state.writeSession(n),this.session=n,n}async send(t,n,s,a){let o=`${this.cloud.studioApi}${OS}${n}`;this.debug&&this.io.stderr(`> ${t} ${o}
|
|
11
11
|
`);try{let i=await this.io.fetch(o,{method:t,headers:{...a===void 0?{}:{authorization:`Bearer ${a}`},accept:"application/json",...s===void 0?{}:{"content-type":"application/json"}},body:s===void 0?void 0:JSON.stringify(s),redirect:"manual"});return this.debug&&this.io.stderr(`< ${i.status} ${i.headers.get("x-request-id")??""}
|
|
12
|
-
`),i}catch(i){throw new b("network_error",`Studio (${this.cloud.studioApi}) could not be reached: ${i instanceof Error?i.message:String(i)}`)}}};function Vu(e){return new b("token_not_for_machines",`the platform's edge refused PALBASE_TOKEN at ${e}, taking it for a machine's address (token_not_for_machines): the token itself was not refused`,{hint:"nothing is wrong with the token: run this again in a few minutes, and tell Palbase if it lasts"})}async function hp(e){let t=await e.clone().json().catch(()=>null),n=t&&typeof t=="object"?t.error:void 0;return typeof n=="string"&&/^(console|token|edge)_/.test(n)?n:void 0}function IS(e){try{return JSON.parse(e)}catch{return e}}var Xu={version:"0.
|
|
12
|
+
`),i}catch(i){throw new b("network_error",`Studio (${this.cloud.studioApi}) could not be reached: ${i instanceof Error?i.message:String(i)}`)}}};function Vu(e){return new b("token_not_for_machines",`the platform's edge refused PALBASE_TOKEN at ${e}, taking it for a machine's address (token_not_for_machines): the token itself was not refused`,{hint:"nothing is wrong with the token: run this again in a few minutes, and tell Palbase if it lasts"})}async function hp(e){let t=await e.clone().json().catch(()=>null),n=t&&typeof t=="object"?t.error:void 0;return typeof n=="string"&&/^(console|token|edge)_/.test(n)?n:void 0}function IS(e){try{return JSON.parse(e)}catch{return e}}var Xu={version:"0.76.0"};var er=Xu.version;async function tm(e,t,n,s){let a=new Map(n.map(r=>[r.name,r])),o=e.includes("--json"),i=e.includes("--debug");try{let{name:r,at:l}=DS(e);if(r===void 0)return e.includes("--version")?(t.stdout(`palbase ${er}
|
|
13
13
|
`),0):(t.stdout(em(n)),e.length===0||e.includes("--help")||e.includes("-h")?0:2);if(r==="help"){let E=e[l+1],C=E===void 0?void 0:a.get(E);if(E!==void 0&&!C)throw Yu(E,n);return t.stdout(C?Qu(C):em(n)),0}let p=a.get(r);if(!p)throw Yu(r,n);let d=[...e.slice(0,l),...e.slice(l+1)],u=d.includes("--")?d.slice(0,d.indexOf("--")):d;if(u.includes("--help")||u.includes("-h"))return t.stdout(Qu(p)),0;let{flags:g,positionals:y}=zS(p,d),w=p.args??{min:0,max:0};if(y.length<w.min)throw h(`${p.name} needs ${w.min===1?"an argument":`${w.min} arguments`}`,fp(p));if(y.length>w.max)throw h(`${p.name} takes ${w.max===0?"no argument":`at most ${w.max}`}: ${JSON.stringify(y.slice(w.max))} is left over`,fp(p));let v={project:g.project,env:g.env,json:g.json===!0,nonInteractive:g["non-interactive"]===!0,yes:g.yes===!0,debug:g.debug===!0},P=qu(t.env),R=new Yi(Ku(t.configDir,P)),T={io:t,state:R,out:new Vi(t,v.json),global:v,args:y,flags:g,interactive:t.interactive&&!v.nonInteractive,cloud:P,studio:new Qi(t,P,R,v.debug,s?.callPlatform)};return await p.run(T)??0}catch(r){return qS(r,t,o,i)}}function DS(e){let t=new Set;for(let[n,s]of Object.entries(Hi))s.type==="string"&&(t.add(`--${n}`),s.short&&t.add(`-${s.short}`));for(let n=0;n<e.length;n++){let s=e[n];if(s==="--")return{at:-1};if(t.has(s)){n++;continue}if(!s.startsWith("-"))return{name:s,at:n}}return{at:-1}}function zS(e,t){let n={...Hi,...e.flags??{}},s={};for(let[a,o]of Object.entries(n))s[a]={type:o.type,...o.short?{short:o.short}:{},...o.multiple?{multiple:!0}:{}};try{let{values:a,positionals:o}=MS({args:t,options:s,strict:!0,allowPositionals:!0});return{flags:a,positionals:o}}catch(a){throw h(a instanceof Error?a.message.replace(/^.*?: /,""):String(a),`palbase help ${e.name}`)}}function qS(e,t,n,s){let a="error",o,i,r=1,l;return e instanceof b?(a=e.code,o=e.message,i=e.hint,r=e.exitCode):e instanceof G?(a=e.code,o=e.message,l=e.requestId,e.code==="token_out_of_scope"&&t.env.PALBASE_TOKEN&&(o=`${e.op} refused PALBASE_TOKEN: ${e.message}`,i="this is the token's reach, fixed when it was minted: a person's yes does not change it \u2014 mint a token whose scopes name this call, or have a person run it signed in")):o=e instanceof Error?e.message:String(e),n&&e instanceof b&&e.reported||(n&&t.stdout(`${JSON.stringify({error:a,message:o,...i?{hint:i}:{},...l?{request_id:l}:{}},null,2)}
|
|
14
14
|
`),t.stderr(`error: ${le(o)}${l?` (request ${le(l)})`:""}
|
|
15
15
|
`),i&&t.stderr(` ${le(i)}
|
package/dist/cloud/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! palbase 0.
|
|
2
|
-
import{a as F}from"../chunks/RBZI2C7M.js";import{a as w,b as R,c as T,e as A,f as E,g as j,h as L,i as M,j as x,k as I,l as D,m as B,n as U,o as G,p as O,q as W,r as K,s as V}from"../chunks/HT6TR6AZ.js";import{a as H,b as z}from"../chunks/GMCROKBB.js";import{b as P,c as i,d as k}from"../chunks/G37YLKYL.js";import"../chunks/XUEBLD7V.js";import"../chunks/7BSFT4SH.js";function q(s){let e=w.client(s),o=R.client(s),r=T.client(s),u=A.client(s),c=E.client(s),t=j.client(s),p=L.client(s),a=M.client(s),m=x.client(s),n=I.client(s),h=D.client(s),g=B.client(s),d=U.client(s),_=G.client(s),y=O.client(s),v=W.client(s),l=K.client(s),b=V.client(s);return{ai:{draftAgent:e.draftAgent,listAgents:e.listAgents,getAgent:e.getAgent,putAgent:e.putAgent,deleteAgent:e.deleteAgent,publishAgent:e.publishAgent,rollbackAgent:e.rollbackAgent,listAgentVersions:e.listAgentVersions,createAudioSpeech:e.createAudioSpeech,createAudioTranscription:e.createAudioTranscription,listChats:e.listChats,createChat:e.createChat,getChat:e.getChat,deleteChat:e.deleteChat,decideChatApproval:e.decideChatApproval,getChatExecution:e.getChatExecution,patchChatExecution:e.patchChatExecution,forkChat:e.forkChat,getChatGoal:e.getChatGoal,setChatGoal:e.setChatGoal,clearChatGoal:e.clearChatGoal,updateChatGoal:e.updateChatGoal,handoffChat:e.handoffChat,putChatMember:e.putChatMember,deleteChatMember:e.deleteChatMember,listChatMessages:e.listChatMessages,sendChatMessage:e.sendChatMessage,getChatMessageAttachment:e.getChatMessageAttachment,listChatParts:e.listChatParts,putChatPipe:e.putChatPipe,deleteChatPipe:e.deleteChatPipe,sendSubagentMessage:e.sendSubagentMessage,stopSubagent:e.stopSubagent,stopChat:e.stopChat,listTurnToolCalls:e.listTurnToolCalls,getChatToolCall:e.getChatToolCall,answerChatToolCall:e.answerChatToolCall,listChatTurnArtifacts:e.listChatTurnArtifacts,getChatTurnArtifact:e.getChatTurnArtifact,getChatTurnCost:e.getChatTurnCost,startChatVoice:e.startChatVoice,getChatVoice:e.getChatVoice,closeChatVoice:e.closeChatVoice,commandChatVoice:e.commandChatVoice,createEmbeddings:e.createEmbeddings,listEndpoints:e.listEndpoints,putEndpoint:e.putEndpoint,deleteEndpoint:e.deleteEndpoint,listEnv:e.listEnv,listEnvAllowances:e.listEnvAllowances,deleteEnvAllowance:e.deleteEnvAllowance,listEnvHostRequests:e.listEnvHostRequests,allowEnvHostRequest:e.allowEnvHostRequest,dismissEnvHostRequest:e.dismissEnvHostRequest,putEnv:e.putEnv,deleteEnv:e.deleteEnv,allowEnvHost:e.allowEnvHost,listEnvironments:e.listEnvironments,createEnvironment:e.createEnvironment,getEnvironment:e.getEnvironment,putEnvironment:e.putEnvironment,deleteEnvironment:e.deleteEnvironment,createEnvironmentBuild:e.createEnvironmentBuild,getEnvironmentBuild:e.getEnvironmentBuild,createImage:e.createImage,getImage:e.getImage,getImageFile:e.getImageFile,deleteMachine:e.deleteMachine,cordonMachine:e.cordonMachine,resumeMachine:e.resumeMachine,listModels:e.listModels,revokePoolKey:e.revokePoolKey,listPools:e.listPools,createPool:e.createPool,deletePool:e.deletePool,listPoolKeys:e.listPoolKeys,createPoolKey:e.createPoolKey,getPoolState:e.getPoolState,listProviders:e.listProviders,connectProvider:e.connectProvider,disconnectProvider:e.disconnectProvider,createResponse:e.createResponse,getResponse:e.getResponse,cancelResponse:e.cancelResponse,followResponse:e.followResponse,getSettings:e.getSettings,putSettings:e.putSettings,getSpend:e.getSpend,askSupport:e.askSupport,listTools:e.listTools,listUsage:e.listUsage,gatewayAudioSpeech:e.gatewayAudioSpeech,gatewayAudioTranscriptions:e.gatewayAudioTranscriptions,gatewayChatCompletions:e.gatewayChatCompletions,gatewayEmbeddings:e.gatewayEmbeddings,gatewayImagesGenerations:e.gatewayImagesGenerations,gatewayAnthropicMessages:e.gatewayAnthropicMessages,gatewayListModels:e.gatewayListModels,gatewayResponses:e.gatewayResponses,createVideo:e.createVideo,getVideo:e.getVideo,cancelVideo:e.cancelVideo,listTriggers:e.listTriggers,createTrigger:e.createTrigger,getTrigger:e.getTrigger,deleteTrigger:e.deleteTrigger,updateTrigger:e.updateTrigger,testTrigger:e.testTrigger,listWaits:e.listWaits,getWait:e.getWait,signalWait:e.signalWait,cancelWait:e.cancelWait,listWorkflowRuns:e.listWorkflowRuns,createWorkflowRun:e.createWorkflowRun,getWorkflowRun:e.getWorkflowRun,recordWorkflowStep:e.recordWorkflowStep,completeWorkflowRun:e.completeWorkflowRun,replayWorkflowRun:e.replayWorkflowRun,stopRunTree:e.stopRunTree,getMemory:e.getMemory,putMemory:e.putMemory,deleteMemory:e.deleteMemory,searchMemory:e.searchMemory,listActorGroupMembers:e.listActorGroupMembers,addActorGroupMember:e.addActorGroupMember,broadcastActorGroup:e.broadcastActorGroup,callA2Arpc:e.callA2Arpc,putMcpUserCredential:e.putMcpUserCredential,deleteMcpUserCredential:e.deleteMcpUserCredential,startMcpoAuth:e.startMcpoAuth,listTemplates:e.listTemplates,getTemplate:e.getTemplate,putTemplate:e.putTemplate,deleteTemplate:e.deleteTemplate,publishTemplate:e.publishTemplate,rollbackTemplate:e.rollbackTemplate,listTemplateVersions:e.listTemplateVersions,listUserSpend:e.listUserSpend,getUserQuota:e.getUserQuota,putUserQuota:e.putUserQuota,deleteUserQuota:e.deleteUserQuota,clientAttestChallenge:e.clientAttestChallenge,runClientTemplate:e.runClientTemplate,voiceClientTemplate:e.voiceClientTemplate},analytics:{listAudiences:o.listAudiences,createAudience:o.createAudience,previewAudience:o.previewAudience,getAudience:o.getAudience,deleteAudience:o.deleteAudience,updateAudience:o.updateAudience,listAudienceMembers:o.listAudienceMembers,alias:o.alias,batch:o.batch,getEventBreakdown:o.getEventBreakdown,capture:o.capture,sendConsoleHistory:o.sendConsoleHistory,getConsoleConfig:o.getConsoleConfig,listConsoleRecords:o.listConsoleRecords,listEventNames:o.listEventNames,listEvents:o.listEvents,getEventTimeline:o.getEventTimeline,runFunnel:o.runFunnel,identify:o.identify,page:o.page,sendPerf:o.sendPerf,listPerfGroups:o.listPerfGroups,getPerfConfig:o.getPerfConfig,getPerfTimeline:o.getPerfTimeline,listRequestLines:o.listRequestLines,getMachineTraffic:o.getMachineTraffic,runRetention:o.runRetention,screen:o.screen,getSettings:o.getSettings,putSettings:o.putSettings,getSummary:o.getSummary,listTraces:o.listTraces,sendTrace:o.sendTrace,sendTraceBatch:o.sendTraceBatch,getTraceHops:o.getTraceHops,listSessionTraces:o.listSessionTraces,getTraceSummary:o.getTraceSummary,getTraceTimeline:o.getTraceTimeline,searchPeople:o.searchPeople,setPersonProperties:o.setPersonProperties,getPerson:o.getPerson,listPersonEvents:o.listPersonEvents,getEventCatalog:o.getEventCatalog,defineEvent:o.defineEvent},auth:{adminVerifyDeviceAssertion:r.adminVerifyDeviceAssertion,adminGetAttestPolicy:r.adminGetAttestPolicy,adminGetAttestObservations:r.adminGetAttestObservations,adminRecordAttestObservations:r.adminRecordAttestObservations,adminListAuditEvents:r.adminListAuditEvents,adminExportAuditEvents:r.adminExportAuditEvents,adminVerifyAuditTrail:r.adminVerifyAuditTrail,adminGetAuthSettings:r.adminGetAuthSettings,adminUpdateAuthSettings:r.adminUpdateAuthSettings,adminGetBreachWatch:r.adminGetBreachWatch,adminListHooks:r.adminListHooks,adminCreateHook:r.adminCreateHook,adminUpdateHook:r.adminUpdateHook,adminDeleteHook:r.adminDeleteHook,adminListHookExecutions:r.adminListHookExecutions,adminListIntegrations:r.adminListIntegrations,adminPutIntegration:r.adminPutIntegration,adminDeleteIntegration:r.adminDeleteIntegration,adminListOAuthClients:r.adminListOAuthClients,adminCreateOAuthClient:r.adminCreateOAuthClient,adminGetOAuthClient:r.adminGetOAuthClient,adminDeleteOAuthClient:r.adminDeleteOAuthClient,adminUpdateOAuthClient:r.adminUpdateOAuthClient,adminListProviders:r.adminListProviders,adminGetPhoneSettings:r.adminGetPhoneSettings,adminUpdatePhoneSettings:r.adminUpdatePhoneSettings,adminToggleProvider:r.adminToggleProvider,adminListRoles:r.adminListRoles,adminUpsertRole:r.adminUpsertRole,adminDeleteRole:r.adminDeleteRole,adminListServiceAccounts:r.adminListServiceAccounts,adminCreateServiceAccount:r.adminCreateServiceAccount,adminGetServiceAccount:r.adminGetServiceAccount,adminRevokeServiceAccount:r.adminRevokeServiceAccount,adminRotateServiceAccount:r.adminRotateServiceAccount,adminListSessions:r.adminListSessions,adminRevokeSession:r.adminRevokeSession,adminListSigningKeys:r.adminListSigningKeys,adminRotateSigningKey:r.adminRotateSigningKey,socialAdminConfig:r.socialAdminConfig,socialCredentialPut:r.socialCredentialPut,socialCredentialDelete:r.socialCredentialDelete,socialProviderPatch:r.socialProviderPatch,adminGetStats:r.adminGetStats,adminSendTestTemplate:r.adminSendTestTemplate,adminListTestUsers:r.adminListTestUsers,adminCreateTestUsers:r.adminCreateTestUsers,adminSetTestUserPhone:r.adminSetTestUserPhone,adminCreateTestSignupAddress:r.adminCreateTestSignupAddress,adminDeleteTestUser:r.adminDeleteTestUser,adminCreateCustomToken:r.adminCreateCustomToken,adminListUsers:r.adminListUsers,adminCreateUser:r.adminCreateUser,adminImportUsers:r.adminImportUsers,adminGetUser:r.adminGetUser,adminDeleteUser:r.adminDeleteUser,adminUpdateUser:r.adminUpdateUser,adminBanUser:r.adminBanUser,adminGetUserConsents:r.adminGetUserConsents,adminRevokeUserCredentials:r.adminRevokeUserCredentials,adminExportUser:r.adminExportUser,adminListUserMfaFactors:r.adminListUserMfaFactors,adminResetUserMfa:r.adminResetUserMfa,adminResetUserPassword:r.adminResetUserPassword,adminListUserRoles:r.adminListUserRoles,adminAssignUserRole:r.adminAssignUserRole,adminRevokeUserRole:r.adminRevokeUserRole,adminRevokeUserSessions:r.adminRevokeUserSessions,adminUnbanUser:r.adminUnbanUser,adminGetInstallationConsents:r.adminGetInstallationConsents,adminRefuseConsents:r.adminRefuseConsents,adminInviteUser:r.adminInviteUser},calls:{adminListCalls:u.adminListCalls,adminGetCall:u.adminGetCall,adminEndCall:u.adminEndCall,createCallTicket:u.createCallTicket,adminGetCallTranscription:u.adminGetCallTranscription,adminStartCallTranscription:u.adminStartCallTranscription,adminStopCallTranscription:u.adminStopCallTranscription,adminIngestCallTranscriptionAudio:u.adminIngestCallTranscriptionAudio,getCallSettings:u.getCallSettings,putCallSettings:u.putCallSettings,rotateCallHookSecret:u.rotateCallHookSecret},campaigns:{listBroadcasts:c.listBroadcasts,createBroadcast:c.createBroadcast,recordBroadcastConversion:c.recordBroadcastConversion,getBroadcast:c.getBroadcast,updateBroadcast:c.updateBroadcast,deleteBroadcast:c.deleteBroadcast,cancelBroadcast:c.cancelBroadcast,pauseBroadcast:c.pauseBroadcast,startBroadcast:c.startBroadcast,getBroadcastStats:c.getBroadcastStats,listTrackingLinks:c.listTrackingLinks,createTrackingLink:c.createTrackingLink,attributeLinkConversion:c.attributeLinkConversion,getTrackingLink:c.getTrackingLink,updateTrackingLink:c.updateTrackingLink,deleteTrackingLink:c.deleteTrackingLink,getTrackingLinkStats:c.getTrackingLinkStats,listOnSiteCampaigns:c.listOnSiteCampaigns,createOnSiteCampaign:c.createOnSiteCampaign,createOnSiteImpression:c.createOnSiteImpression,recordOnSiteEvent:c.recordOnSiteEvent,listOnSiteMessages:c.listOnSiteMessages,getOnSiteSettings:c.getOnSiteSettings,putOnSiteSettings:c.putOnSiteSettings,listOnSiteTemplates:c.listOnSiteTemplates,getOnSiteCampaign:c.getOnSiteCampaign,updateOnSiteCampaign:c.updateOnSiteCampaign,deleteOnSiteCampaign:c.deleteOnSiteCampaign,getOnSiteCampaignStats:c.getOnSiteCampaignStats},commerce:{listBrands:t.listBrands,createBrand:t.createBrand,createCart:t.createCart,getCart:t.getCart,updateCart:t.updateCart,checkoutCart:t.checkoutCart,addCartItem:t.addCartItem,deleteCartItem:t.deleteCartItem,updateCartItem:t.updateCartItem,applyCartPromoCode:t.applyCartPromoCode,removeCartPromoCode:t.removeCartPromoCode,selectCartShipping:t.selectCartShipping,storefrontListBrands:t.storefrontListBrands,storefrontListCategories:t.storefrontListCategories,storefrontListChannels:t.storefrontListChannels,storefrontListCollections:t.storefrontListCollections,storefrontListProducts:t.storefrontListProducts,storefrontSearchProducts:t.storefrontSearchProducts,storefrontSuggest:t.storefrontSuggest,storefrontRecommendProducts:t.storefrontRecommendProducts,storefrontProductRecommendations:t.storefrontProductRecommendations,storefrontGetProduct:t.storefrontGetProduct,storefrontListProductReviews:t.storefrontListProductReviews,storefrontListRegions:t.storefrontListRegions,storefrontListStores:t.storefrontListStores,storefrontGetStore:t.storefrontGetStore,storefrontListStoreReviews:t.storefrontListStoreReviews,listCategories:t.listCategories,createCategory:t.createCategory,listChannels:t.listChannels,createChannel:t.createChannel,attachChannelRegion:t.attachChannelRegion,attachChannelStore:t.attachChannelStore,detachChannelStore:t.detachChannelStore,listCollections:t.listCollections,createCollection:t.createCollection,addCollectionProduct:t.addCollectionProduct,removeCollectionProduct:t.removeCollectionProduct,createDigitalAsset:t.createDigitalAsset,updateFulfillment:t.updateFulfillment,addShipmentEvent:t.addShipmentEvent,listDiscoveryStrategies:t.listDiscoveryStrategies,createDiscoveryStrategy:t.createDiscoveryStrategy,getDiscoveryStrategy:t.getDiscoveryStrategy,deleteDiscoveryStrategy:t.deleteDiscoveryStrategy,updateDiscoveryStrategy:t.updateDiscoveryStrategy,listMerchandisingRules:t.listMerchandisingRules,createMerchandisingRule:t.createMerchandisingRule,getMerchandisingRule:t.getMerchandisingRule,deleteMerchandisingRule:t.deleteMerchandisingRule,updateMerchandisingRule:t.updateMerchandisingRule,listSearchSynonyms:t.listSearchSynonyms,createSearchSynonym:t.createSearchSynonym,deleteSearchSynonym:t.deleteSearchSynonym,refreshDiscoverySignals:t.refreshDiscoverySignals,listHooks:t.listHooks,upsertHook:t.upsertHook,deleteHook:t.deleteHook,listInventory:t.listInventory,adjustInventory:t.adjustInventory,bulkSyncInventory:t.bulkSyncInventory,listInventoryMovements:t.listInventoryMovements,listInvoices:t.listInvoices,createInvoice:t.createInvoice,updateInvoice:t.updateInvoice,listListings:t.listListings,createListing:t.createListing,updateListing:t.updateListing,importLicenseKeys:t.importLicenseKeys,upsertPrice:t.upsertPrice,createMediaAsset:t.createMediaAsset,listOrders:t.listOrders,getGuestOrder:t.getGuestOrder,getOrder:t.getOrder,markOrderPaid:t.markOrderPaid,listPriceLists:t.listPriceLists,createPriceList:t.createPriceList,listProducts:t.listProducts,createProduct:t.createProduct,createQuickProduct:t.createQuickProduct,getProduct:t.getProduct,updateProduct:t.updateProduct,approveProduct:t.approveProduct,upsertProductOption:t.upsertProductOption,createVariant:t.createVariant,listRegions:t.listRegions,createRegion:t.createRegion,updateRegion:t.updateRegion,listReturns:t.listReturns,approveReturn:t.approveReturn,completeReturn:t.completeReturn,receiveReturn:t.receiveReturn,adminListReviews:t.adminListReviews,adminDeleteReview:t.adminDeleteReview,adminModerateReview:t.adminModerateReview,getCommerceSettings:t.getCommerceSettings,updateCommerceSettings:t.updateCommerceSettings,listSettlements:t.listSettlements,generateSettlement:t.generateSettlement,markSettlementPaid:t.markSettlementPaid,listShippingOptions:t.listShippingOptions,createShippingOption:t.createShippingOption,listShippingProfiles:t.listShippingProfiles,createShippingProfile:t.createShippingProfile,listStockLocations:t.listStockLocations,createStockLocation:t.createStockLocation,listStoreOrders:t.listStoreOrders,getStoreOrder:t.getStoreOrder,cancelStoreOrder:t.cancelStoreOrder,createFulfillment:t.createFulfillment,createReturn:t.createReturn,listStores:t.listStores,createStore:t.createStore,getStore:t.getStore,updateStore:t.updateStore,sellerUpdateFulfillment:t.sellerUpdateFulfillment,sellerAddShipmentEvent:t.sellerAddShipmentEvent,sellerListInventory:t.sellerListInventory,sellerAdjustInventory:t.sellerAdjustInventory,sellerBulkSyncInventory:t.sellerBulkSyncInventory,sellerListListings:t.sellerListListings,sellerCreateListing:t.sellerCreateListing,sellerUpdateListing:t.sellerUpdateListing,sellerImportLicenseKeys:t.sellerImportLicenseKeys,sellerUpsertPrice:t.sellerUpsertPrice,sellerListStockLocations:t.sellerListStockLocations,sellerCreateStockLocation:t.sellerCreateStockLocation,addStoreMember:t.addStoreMember,removeStoreMember:t.removeStoreMember,sellerGetMetrics:t.sellerGetMetrics,sellerListStoreOrders:t.sellerListStoreOrders,sellerGetStoreOrder:t.sellerGetStoreOrder,sellerCancelStoreOrder:t.sellerCancelStoreOrder,sellerCreateFulfillment:t.sellerCreateFulfillment,onboardStorePaymentAccount:t.onboardStorePaymentAccount,sellerOnboardPayouts:t.sellerOnboardPayouts,sellerOnboardingLink:t.sellerOnboardingLink,sellerListProducts:t.sellerListProducts,sellerCreateProduct:t.sellerCreateProduct,sellerCreateQuickProduct:t.sellerCreateQuickProduct,sellerCreatePromotionRule:t.sellerCreatePromotionRule,sellerListReturns:t.sellerListReturns,sellerApproveReturn:t.sellerApproveReturn,sellerCompleteReturn:t.sellerCompleteReturn,sellerReceiveReturn:t.sellerReceiveReturn,sellerListReviews:t.sellerListReviews,sellerReplyReview:t.sellerReplyReview,sellerListSettlements:t.sellerListSettlements,sellerCreateShippingOption:t.sellerCreateShippingOption,listTaxRates:t.listTaxRates,upsertTaxRate:t.upsertTaxRate,updateVariant:t.updateVariant,setBundleItems:t.setBundleItems,recomputeVariantBuyBox:t.recomputeVariantBuyBox,revokePromotionCode:t.revokePromotionCode,evaluatePromotions:t.evaluatePromotions,holdPromotions:t.holdPromotions,commitPromotionHold:t.commitPromotionHold,releasePromotionHold:t.releasePromotionHold,listPromotionRedemptions:t.listPromotionRedemptions,reversePromotionRedemption:t.reversePromotionRedemption,listPromotionRules:t.listPromotionRules,createPromotionRule:t.createPromotionRule,getPromotionRule:t.getPromotionRule,archivePromotionRule:t.archivePromotionRule,updatePromotionRule:t.updatePromotionRule,upsertPromotionBudget:t.upsertPromotionBudget,listPromotionCodes:t.listPromotionCodes,createPromotionCode:t.createPromotionCode,generatePromotionCodeBatch:t.generatePromotionCodeBatch},flags:{getValues:p.getValues,batchUserValues:p.batchUserValues,getDelta:p.getDelta,getEvaluations:p.getEvaluations,listExperiments:p.listExperiments,startExperiment:p.startExperiment,getExperiment:p.getExperiment,getExperimentResults:p.getExperimentResults,stopExperiment:p.stopExperiment,declareExperimentWinner:p.declareExperimentWinner,getCurrentInstallations:p.getCurrentInstallations,getInstallationsDaily:p.getInstallationsDaily,getSnapshot:p.getSnapshot,listDefinitions:p.listDefinitions,getDefinition:p.getDefinition,putDefinition:p.putDefinition,deleteDefinition:p.deleteDefinition,activateTemplates:p.activateTemplates,getActiveTemplate:p.getActiveTemplate,getTemplateCapabilities:p.getTemplateCapabilities,getTemplateDraft:p.getTemplateDraft,createTemplateDraft:p.createTemplateDraft,discardTemplateDraft:p.discardTemplateDraft,putTemplateParameter:p.putTemplateParameter,removeTemplateParameter:p.removeTemplateParameter,reviewTemplateDraft:p.reviewTemplateDraft,publishTemplate:p.publishTemplate,getPublishReceipt:p.getPublishReceipt,restoreTemplateVersion:p.restoreTemplateVersion,listTemplateVersions:p.listTemplateVersions,getTemplateVersion:p.getTemplateVersion,getUserValues:p.getUserValues,putUserValues:p.putUserValues,deleteUserValues:p.deleteUserValues,putUserValue:p.putUserValue,deleteUserValue:p.deleteUserValue},iap:{getAppleAccount:a.getAppleAccount,disconnectApple:a.disconnectApple,createAppleGrant:a.createAppleGrant,getAppleReadiness:a.getAppleReadiness,setXcodeCertificate:a.setXcodeCertificate,clearXcodeCertificate:a.clearXcodeCertificate,setXcodeOfferKey:a.setXcodeOfferKey,getCatalog:a.getCatalog,saveCatalog:a.saveCatalog,planCatalog:a.planCatalog,getCatalogPlan:a.getCatalogPlan,confirmCatalogPlan:a.confirmCatalogPlan,declineCatalogPlan:a.declineCatalogPlan,listCatalogRevisions:a.listCatalogRevisions,getCatalogRevision:a.getCatalogRevision,restoreCatalogRevision:a.restoreCatalogRevision,validateCatalog:a.validateCatalog,listCharts:a.listCharts,getChartsOverview:a.getChartsOverview,getChart:a.getChart,createCheckout:a.createCheckout,createCheckoutRedemption:a.createCheckoutRedemption,listCoupons:a.listCoupons,createCoupon:a.createCoupon,getCoupon:a.getCoupon,revokeCoupon:a.revokeCoupon,listCouponCodes:a.listCouponCodes,searchCustomers:a.searchCustomers,getCustomer:a.getCustomer,grantCredits:a.grantCredits,listCreditEntries:a.listCreditEntries,forgiveCredits:a.forgiveCredits,listCustomerGrants:a.listCustomerGrants,grantEntitlement:a.grantEntitlement,revokeGrant:a.revokeGrant,getCustomerHistory:a.getCustomerHistory,holdSpend:a.holdSpend,setCustomerLimit:a.setCustomerLimit,clearCustomerLimit:a.clearCustomerLimit,grantLimit:a.grantLimit,spend:a.spend,commitSpend:a.commitSpend,extendHold:a.extendHold,releaseSpend:a.releaseSpend,reverseSpend:a.reverseSpend,cancelSubscription:a.cancelSubscription,extendSubscription:a.extendSubscription,refundSubscription:a.refundSubscription,listExperiments:a.listExperiments,startExperiment:a.startExperiment,getExperiment:a.getExperiment,getExperimentResults:a.getExperimentResults,stopExperiment:a.stopExperiment,declareExperimentWinner:a.declareExperimentWinner,getGoogleAccount:a.getGoogleAccount,connectGoogle:a.connectGoogle,disconnectGoogle:a.disconnectGoogle,getOfferings:a.getOfferings,getOfferStats:a.getOfferStats,listPaywalls:a.listPaywalls,createPaywall:a.createPaywall,listPaywallAssets:a.listPaywallAssets,registerPaywallAsset:a.registerPaywallAsset,deletePaywallAsset:a.deletePaywallAsset,listPaywallTemplates:a.listPaywallTemplates,getPaywallTemplateAsset:a.getPaywallTemplateAsset,validatePaywall:a.validatePaywall,getPaywall:a.getPaywall,deletePaywall:a.deletePaywall,savePaywallDraft:a.savePaywallDraft,publishPaywall:a.publishPaywall,listPaywallVersions:a.listPaywallVersions,getPaywallVersion:a.getPaywallVersion,listPlacements:a.listPlacements,listAttributeKeys:a.listAttributeKeys,setPlacement:a.setPlacement,deletePlacement:a.deletePlacement,recordPaywallExposure:a.recordPaywallExposure,getPlacementPaywall:a.getPlacementPaywall,previewPlacement:a.previewPlacement,getPlacementResults:a.getPlacementResults,getPlacementRules:a.getPlacementRules,setPlacementRules:a.setPlacementRules,getSettings:a.getSettings,updateSettings:a.updateSettings},journeys:{listJourneys:m.listJourneys,createJourney:m.createJourney,listBlueprints:m.listBlueprints,listPersonRuns:m.listPersonRuns,simulateJourney:m.simulateJourney,listStoreBlueprints:m.listStoreBlueprints,activateStoreBlueprint:m.activateStoreBlueprint,deleteStoreBlueprint:m.deleteStoreBlueprint,validateJourney:m.validateJourney,getJourney:m.getJourney,updateJourney:m.updateJourney,deleteJourney:m.deleteJourney,copyJourney:m.copyJourney,publishJourney:m.publishJourney,listJourneyRuns:m.listJourneyRuns,getJourneyStats:m.getJourneyStats,stopJourney:m.stopJourney,testJourney:m.testJourney},machines:{listMachines:n.listMachines,createMachine:n.createMachine,listMachineSizes:n.listMachineSizes,getMachineNetwork:n.getMachineNetwork,connectGitHub:n.connectGitHub,listInstallations:n.listInstallations,linkInstallation:n.linkInstallation,shareInstallation:n.shareInstallation,unlinkInstallation:n.unlinkInstallation,listRepositories:n.listRepositories,getMachine:n.getMachine,deleteMachine:n.deleteMachine,updateMachine:n.updateMachine,listBuilds:n.listBuilds,deployMachine:n.deployMachine,listMachinePreviews:n.listMachinePreviews,putMachinePreview:n.putMachinePreview,deleteMachinePreview:n.deleteMachinePreview,listMachineDomains:n.listMachineDomains,addMachineDomain:n.addMachineDomain,deleteMachineDomain:n.deleteMachineDomain,updateMachineDomain:n.updateMachineDomain,getBuild:n.getBuild,getBuildLog:n.getBuildLog,rollbackMachine:n.rollbackMachine,listDatabases:n.listDatabases,createDatabase:n.createDatabase,listDatabaseSizes:n.listDatabaseSizes,getDatabase:n.getDatabase,deleteDatabase:n.deleteDatabase,updateDatabase:n.updateDatabase,undeleteDatabase:n.undeleteDatabase,purgeDatabase:n.purgeDatabase,getDatabaseCredentials:n.getDatabaseCredentials,changeDatabasePassword:n.changeDatabasePassword,readMachineLogs:n.readMachineLogs,execInMachine:n.execInMachine,listMachineExecs:n.listMachineExecs,getMachineMetrics:n.getMachineMetrics,getMachineContract:n.getMachineContract,restoreDatabase:n.restoreDatabase,getDatabaseSchema:n.getDatabaseSchema,getDatabaseMetrics:n.getDatabaseMetrics,queryDatabase:n.queryDatabase,listCrons:n.listCrons,listCronRuns:n.listCronRuns,runCron:n.runCron,pauseCron:n.pauseCron,resumeCron:n.resumeCron,listTasks:n.listTasks,enqueueTask:n.enqueueTask,getTask:n.getTask,cancelTask:n.cancelTask,retryTask:n.retryTask,listTaskTypes:n.listTaskTypes,makeTemplatedTestUsers:n.makeTemplatedTestUsers,templateTestUser:n.templateTestUser,deleteTemplatedTestUser:n.deleteTemplatedTestUser,listSites:n.listSites,createSite:n.createSite,getSite:n.getSite,deleteSite:n.deleteSite,updateSite:n.updateSite,listSiteReleases:n.listSiteReleases,createSiteRelease:n.createSiteRelease,uploadSiteFile:n.uploadSiteFile,finishSiteRelease:n.finishSiteRelease,rollbackSite:n.rollbackSite,listSiteBuilds:n.listSiteBuilds,deploySite:n.deploySite,listSitePreviews:n.listSitePreviews,listSiteDomains:n.listSiteDomains,addSiteDomain:n.addSiteDomain,deleteSiteDomain:n.deleteSiteDomain,updateSiteDomain:n.updateSiteDomain,getSiteBuild:n.getSiteBuild,authorizeSitePreview:n.authorizeSitePreview,authorizeMachinePreview:n.authorizeMachinePreview,openMachinePreview:n.openMachinePreview,moveMachine:n.moveMachine,moveSite:n.moveSite,moveDatabase:n.moveDatabase,cancelSiteBuild:n.cancelSiteBuild,cancelBuild:n.cancelBuild,listSiteHooks:n.listSiteHooks,createSiteHook:n.createSiteHook,deleteSiteHook:n.deleteSiteHook,listMachineHooks:n.listMachineHooks,createMachineHook:n.createMachineHook,deleteMachineHook:n.deleteMachineHook,detectProject:n.detectProject,createPreviewPass:n.createPreviewPass,listPreviewLinks:n.listPreviewLinks,createPreviewLink:n.createPreviewLink,deletePreviewLink:n.deletePreviewLink,listEnvironmentDomains:n.listEnvironmentDomains,addEnvironmentDomain:n.addEnvironmentDomain,deleteEnvironmentDomain:n.deleteEnvironmentDomain,setEnvironmentSignInDomain:n.setEnvironmentSignInDomain},messaging:{adminAccessLog:h.adminAccessLog,adminListConversations:h.adminListConversations,adminCreateConversation:h.adminCreateConversation,adminGetConversation:h.adminGetConversation,adminDeleteConversation:h.adminDeleteConversation,adminUpdateConversation:h.adminUpdateConversation,adminAddMembers:h.adminAddMembers,adminRemoveMember:h.adminRemoveMember,adminListMessages:h.adminListMessages,adminSendMessage:h.adminSendMessage,adminDeleteMessage:h.adminDeleteMessage,adminFileUrl:h.adminFileUrl,adminPutProfile:h.adminPutProfile,adminListReports:h.adminListReports,adminGetReport:h.adminGetReport,adminReportFileUrl:h.adminReportFileUrl,adminResolveReport:h.adminResolveReport,getSettings:h.getSettings,putSettings:h.putSettings,rotateHookSecret:h.rotateHookSecret},notify:{getDeliverability:g.getDeliverability,listDevices:g.listDevices,getDeviceStats:g.getDeviceStats,deleteMyDevice:g.deleteMyDevice,sendEmail:g.sendEmail,listInAppCampaigns:g.listInAppCampaigns,createInAppCampaign:g.createInAppCampaign,getInAppCampaign:g.getInAppCampaign,putInAppCampaign:g.putInAppCampaign,deleteInAppCampaign:g.deleteInAppCampaign,getInAppCampaignStats:g.getInAppCampaignStats,listInAppTemplates:g.listInAppTemplates,sendInbox:g.sendInbox,listInboxMessages:g.listInboxMessages,listNotifyMessages:g.listNotifyMessages,getNotifyMessage:g.getNotifyMessage,cancelMessage:g.cancelMessage,getMetricsSummary:g.getMetricsSummary,listNotifyProviders:g.listNotifyProviders,putNotifyProvider:g.putNotifyProvider,deleteNotifyProvider:g.deleteNotifyProvider,sendPush:g.sendPush,getNotifySettings:g.getNotifySettings,putNotifySettings:g.putNotifySettings,sendSms:g.sendSms,listEmailTemplates:g.listEmailTemplates,getEmailTemplate:g.getEmailTemplate,putEmailTemplate:g.putEmailTemplate,deleteEmailTemplate:g.deleteEmailTemplate,listPushTemplates:g.listPushTemplates,getPushTemplate:g.getPushTemplate,putPushTemplate:g.putPushTemplate,deletePushTemplate:g.deletePushTemplate,listSmsTemplates:g.listSmsTemplates,getSmsTemplate:g.getSmsTemplate,putSmsTemplate:g.putSmsTemplate,deleteSmsTemplate:g.deleteSmsTemplate,listWhatsAppTemplates:g.listWhatsAppTemplates,getWhatsAppTemplate:g.getWhatsAppTemplate,putWhatsAppTemplate:g.putWhatsAppTemplate,deleteWhatsAppTemplate:g.deleteWhatsAppTemplate,listTestUserMessages:g.listTestUserMessages,listTopics:g.listTopics,createTopic:g.createTopic,deleteTopic:g.deleteTopic,changeTopic:g.changeTopic,addTopicSubscribers:g.addTopicSubscribers,removeTopicSubscriber:g.removeTopicSubscriber,listUserDevices:g.listUserDevices,getUserPreferences:g.getUserPreferences,setUserPreferences:g.setUserPreferences,startVerification:g.startVerification,checkVerification:g.checkVerification,getWebPushStatus:g.getWebPushStatus,sendWhatsApp:g.sendWhatsApp,listWhatsAppInbound:g.listWhatsAppInbound},payments:{auditCashFlow:d.auditCashFlow,auditDrift:d.auditDrift,auditLedger:d.auditLedger,exportAuditLedgerCsv:d.exportAuditLedgerCsv,getCapabilities:d.getCapabilities,listChannels:d.listChannels,connectChannel:d.connectChannel,createChannelGrant:d.createChannelGrant,getChannel:d.getChannel,deleteChannel:d.deleteChannel,checkChannel:d.checkChannel,setDefaultChannel:d.setDefaultChannel,listDisputes:d.listDisputes,lookupInstallments:d.lookupInstallments,listIntents:d.listIntents,createIntent:d.createIntent,getIntent:d.getIntent,listIntentAttempts:d.listIntentAttempts,cancelIntent:d.cancelIntent,captureIntent:d.captureIntent,confirmIntent:d.confirmIntent,submitIntentOtp:d.submitIntentOtp,listRefunds:d.listRefunds,createRefund:d.createRefund,listRoutingRules:d.listRoutingRules,replaceRoutingRules:d.replaceRoutingRules,getSellerAccount:d.getSellerAccount,listSellerLedger:d.listSellerLedger,getSettings:d.getSettings,updateSettings:d.updateSettings,listPaymentSplits:d.listPaymentSplits,updatePaymentSplit:d.updatePaymentSplit,approvePaymentSplit:d.approvePaymentSplit,disapprovePaymentSplit:d.disapprovePaymentSplit,refundPaymentSplit:d.refundPaymentSplit,createStripeAppGrant:d.createStripeAppGrant,listSubMerchants:d.listSubMerchants,upsertSubMerchant:d.upsertSubMerchant,getSubMerchant:d.getSubMerchant,createSubMerchantOnboardingLink:d.createSubMerchantOnboardingLink,syncSubMerchant:d.syncSubMerchant,listSubscriptions:d.listSubscriptions,createSubscription:d.createSubscription,cancelSubscription:d.cancelSubscription,extendSubscription:d.extendSubscription,listWallets:d.listWallets,upsertWallet:d.upsertWallet,chargeWallet:d.chargeWallet,creditWallet:d.creditWallet,getCustomerWallets:d.getCustomerWallets,freezeWallet:d.freezeWallet,createWalletHold:d.createWalletHold,commitWalletHold:d.commitWalletHold,releaseWalletHold:d.releaseWalletHold,voidPendingWalletCredits:d.voidPendingWalletCredits,transferWallet:d.transferWallet},realtime:{broadcast:_.broadcast,getChannels:_.getChannels,putChannels:_.putChannels,getLimits:_.getLimits,putLimits:_.putLimits,revalidate:_.revalidate,writeState:_.writeState,getStats:_.getStats},secrets:{listSecretAudit:y.listSecretAudit,listFieldKeys:y.listFieldKeys,getFieldKeys:y.getFieldKeys,openFields:y.openFields,sealPlaceholder:y.sealPlaceholder,rotateFieldKeys:y.rotateFieldKeys,listTransitKeys:y.listTransitKeys,getTransitKeys:y.getTransitKeys,getTransitPublicKeys:y.getTransitPublicKeys,rotateTransitKeys:y.rotateTransitKeys,retireTransitKey:y.retireTransitKey,listSecrets:y.listSecrets,getEnvironmentValues:y.getEnvironmentValues,getSecret:y.getSecret,putSecret:y.putSecret,deleteSecret:y.deleteSecret,rollbackSecret:y.rollbackSecret,listSecretVersions:y.listSecretVersions},storage:{listBuckets:v.listBuckets,getBucket:v.getBucket,putBucket:v.putBucket,deleteBucket:v.deleteBucket,copyObject:v.copyObject,moveObject:v.moveObject,listObjects:v.listObjects,getObject:v.getObject,putObject:v.putObject,deleteObject:v.deleteObject,headObject:v.headObject,createSignedUrl:v.createSignedUrl,createUploadUrl:v.createUploadUrl,getStorageStats:v.getStorageStats},stores:{listActions:l.listActions,getAction:l.getAction,confirmAction:l.confirmAction,declineAction:l.declineAction,getAppleAccount:l.getAppleAccount,disconnectApple:l.disconnectApple,checkAppleAccount:l.checkAppleAccount,createAppleGrant:l.createAppleGrant,getSandboxReadiness:l.getSandboxReadiness,listSandboxTesters:l.listSandboxTesters,clearSandboxPurchaseHistory:l.clearSandboxPurchaseHistory,updateSandboxTester:l.updateSandboxTester,listApps:l.listApps,listFeedback:l.listFeedback,getFeedback:l.getFeedback,listGroups:l.listGroups,createGroup:l.createGroup,linkApp:l.linkApp,getListing:l.getListing,setListing:l.setListing,planListing:l.planListing,createPackage:l.createPackage,uploadScreenshot:l.uploadScreenshot,getReviewInfo:l.getReviewInfo,setReviewInfo:l.setReviewInfo,getUploadKey:l.getUploadKey,getAppStoreVersion:l.getAppStoreVersion,prepareAppStoreVersion:l.prepareAppStoreVersion,planPhasedRelease:l.planPhasedRelease,planReleaseVersion:l.planReleaseVersion,planSubmitReview:l.planSubmitReview,planWithdrawReview:l.planWithdrawReview,getAppVitals:l.getAppVitals,getAppWebhook:l.getAppWebhook,makeAppWebhook:l.makeAppWebhook,pingAppWebhook:l.pingAppWebhook,getGoogleAccount:l.getGoogleAccount,connectGoogle:l.connectGoogle,disconnectGoogle:l.disconnectGoogle,checkGoogleAccount:l.checkGoogleAccount,deleteGroup:l.deleteGroup,renameGroup:l.renameGroup,addGroupBuild:l.addGroupBuild,listTesters:l.listTesters,setTesters:l.setTesters,listPackages:l.listPackages,getPackage:l.getPackage,planBetaReview:l.planBetaReview,listDeliveries:l.listDeliveries,deliver:l.deliver,getSignedBundleLink:l.getSignedBundleLink,planExpire:l.planExpire,planExportCompliance:l.planExportCompliance,setWhatToTest:l.setWhatToTest,getAppleSession:l.getAppleSession,disconnectAppleSession:l.disconnectAppleSession,checkAppleSession:l.checkAppleSession,createAppleIdGrant:l.createAppleIdGrant,getAppReview:l.getAppReview,getReviewAttachment:l.getReviewAttachment,setReviewDraft:l.setReviewDraft,sendReviewDraft:l.sendReviewDraft,getAppPrivacy:l.getAppPrivacy,setAppPrivacy:l.setAppPrivacy,makeAppRecord:l.makeAppRecord,removeAppRecord:l.removeAppRecord,listMadeAppleKeys:l.listMadeAppleKeys,makeAppleKey:l.makeAppleKey,revokeMadeAppleKey:l.revokeMadeAppleKey,shareAppleSession:l.shareAppleSession,unshareAppleSession:l.unshareAppleSession,listInvitations:l.listInvitations,invitePerson:l.invitePerson,revokeInvitation:l.revokeInvitation,listDevices:l.listDevices},workspaces:{listWorkspaces:b.listWorkspaces,createWorkspace:b.createWorkspace,testWorkspaceByos:b.testWorkspaceByos,listProjectS3Keys:b.listProjectS3Keys,createProjectS3Key:b.createProjectS3Key,deleteProjectS3Key:b.deleteProjectS3Key,getWorkspace:b.getWorkspace,deleteWorkspace:b.deleteWorkspace,updateWorkspaceStorage:b.updateWorkspaceStorage,getWorkspaceFiles:b.getWorkspaceFiles,putWorkspaceFile:b.putWorkspaceFile,deleteWorkspaceFile:b.deleteWorkspaceFile,listWorkspaceTokens:b.listWorkspaceTokens,createWorkspaceToken:b.createWorkspaceToken,deleteWorkspaceToken:b.deleteWorkspaceToken,listWorkspaceLocks:b.listWorkspaceLocks,acquireWorkspaceLock:b.acquireWorkspaceLock,releaseWorkspaceLock:b.releaseWorkspaceLock}}}function J(s){return{orgs:{async list(e){return s.send({op:"orgs.list",method:"GET",path:"/v1/orgs",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e?.signal})},async create(e){return s.send({op:"orgs.create",method:"POST",path:"/v1/orgs",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async get(e){return s.send({op:"orgs.get",method:"GET",path:"/v1/orgs/"+i("orgs.get","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async takeAway(e){return s.send({op:"orgs.takeAway",method:"DELETE",path:"/v1/orgs/"+i("orgs.takeAway","id",e.path.id),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async rename(e){return s.send({op:"orgs.rename",method:"PATCH",path:"/v1/orgs/"+i("orgs.rename","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async members(e){return s.send({op:"orgs.members",method:"GET",path:"/v1/orgs/"+i("orgs.members","id",e.path.id)+"/members",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async auditLog(e){return s.send({op:"orgs.auditLog",method:"GET",path:"/v1/orgs/"+i("orgs.auditLog","id",e.path.id)+"/audit",auth:[["PalbaseBearer"]],answers:{200:"json"},query:e.query,signal:e.signal})}},invitations:{async mine(e){return s.send({op:"invitations.mine",method:"GET",path:"/v1/invitations",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e?.signal})},async accept(e){return s.send({op:"invitations.accept",method:"POST",path:"/v1/invitations/"+i("invitations.accept","id",e.path.id)+"/accept",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})}},orgWebhooks:{async list(e){return s.send({op:"orgWebhooks.list",method:"GET",path:"/v1/orgs/"+i("orgWebhooks.list","id",e.path.id)+"/webhooks",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async add(e){return s.send({op:"orgWebhooks.add",method:"POST",path:"/v1/orgs/"+i("orgWebhooks.add","id",e.path.id)+"/webhooks",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async remove(e){return s.send({op:"orgWebhooks.remove",method:"DELETE",path:"/v1/orgs/"+i("orgWebhooks.remove","id",e.path.id)+"/webhooks/"+i("orgWebhooks.remove","endpoint",e.path.endpoint),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})}},projects:{async mine(e){return s.send({op:"projects.mine",method:"GET",path:"/v1/projects",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e?.signal})},async environmentsMine(e){return s.send({op:"projects.environmentsMine",method:"GET",path:"/v1/environments",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e?.signal})},async list(e){return s.send({op:"projects.list",method:"GET",path:"/v1/orgs/"+i("projects.list","id",e.path.id)+"/projects",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async create(e){return s.send({op:"projects.create",method:"POST",path:"/v1/orgs/"+i("projects.create","id",e.path.id)+"/projects",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async get(e){return s.send({op:"projects.get",method:"GET",path:"/v1/projects/"+i("projects.get","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async remove(e){return s.send({op:"projects.remove",method:"DELETE",path:"/v1/projects/"+i("projects.remove","id",e.path.id),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async rename(e){return s.send({op:"projects.rename",method:"PATCH",path:"/v1/projects/"+i("projects.rename","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async addEnvironment(e){return s.send({op:"projects.addEnvironment",method:"POST",path:"/v1/projects/"+i("projects.addEnvironment","id",e.path.id)+"/environments",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async environment(e){return s.send({op:"projects.environment",method:"GET",path:"/v1/environments/"+i("projects.environment","ref",e.path.ref),auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async removeEnvironment(e){return s.send({op:"projects.removeEnvironment",method:"DELETE",path:"/v1/environments/"+i("projects.removeEnvironment","ref",e.path.ref),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,query:e.query,headers:e.headers,signal:e.signal})},async renameEnvironment(e){return s.send({op:"projects.renameEnvironment",method:"PATCH",path:"/v1/environments/"+i("projects.renameEnvironment","ref",e.path.ref),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async keys(e){return s.send({op:"projects.keys",method:"GET",path:"/v1/environments/"+i("projects.keys","ref",e.path.ref)+"/keys",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async usage(e){return s.send({op:"projects.usage",method:"GET",path:"/v1/environments/"+i("projects.usage","ref",e.path.ref)+"/usage",auth:[["PalbaseBearer"]],answers:{200:"json"},query:e.query,signal:e.signal})},async personalKey(e){return s.send({op:"projects.personalKey",method:"POST",path:"/v1/environments/"+i("projects.personalKey","ref",e.path.ref)+"/personal-key",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async revokePersonalKey(e){return s.send({op:"projects.revokePersonalKey",method:"DELETE",path:"/v1/environments/"+i("projects.revokePersonalKey","ref",e.path.ref)+"/personal-key/"+i("projects.revokePersonalKey","key",e.path.key),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async shareInstallation(e){return s.send({op:"projects.shareInstallation",method:"POST",path:"/v1/environments/"+i("projects.shareInstallation","ref",e.path.ref)+"/github/installations",auth:[["PalbaseBearer"]],answers:{},ownResponse:!0,idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}},apps:{async list(e){return s.send({op:"apps.list",method:"GET",path:"/v1/projects/"+i("apps.list","id",e.path.id)+"/apps",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async create(e){return s.send({op:"apps.create",method:"POST",path:"/v1/projects/"+i("apps.create","id",e.path.id)+"/apps",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async get(e){return s.send({op:"apps.get",method:"GET",path:"/v1/projects/"+i("apps.get","id",e.path.id)+"/apps/"+i("apps.get","app",e.path.app),auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async remove(e){return s.send({op:"apps.remove",method:"DELETE",path:"/v1/projects/"+i("apps.remove","id",e.path.id)+"/apps/"+i("apps.remove","app",e.path.app),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async update(e){return s.send({op:"apps.update",method:"PATCH",path:"/v1/projects/"+i("apps.update","id",e.path.id)+"/apps/"+i("apps.update","app",e.path.app),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async restore(e){return s.send({op:"apps.restore",method:"POST",path:"/v1/projects/"+i("apps.restore","id",e.path.id)+"/apps/"+i("apps.restore","app",e.path.app)+"/restore",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async setIn(e){return s.send({op:"apps.setIn",method:"PUT",path:"/v1/environments/"+i("apps.setIn","ref",e.path.ref)+"/apps/"+i("apps.setIn","app",e.path.app),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async removeFrom(e){return s.send({op:"apps.removeFrom",method:"DELETE",path:"/v1/environments/"+i("apps.removeFrom","ref",e.path.ref)+"/apps/"+i("apps.removeFrom","app",e.path.app),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async config(e){return s.send({op:"apps.config",method:"GET",path:"/v1/environments/"+i("apps.config","ref",e.path.ref)+"/apps/"+i("apps.config","app",e.path.app)+"/config",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})}},snippets:{async list(e){return s.send({op:"snippets.list",method:"GET",path:"/v1/environments/"+i("snippets.list","ref",e.path.ref)+"/snippets",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async create(e){return s.send({op:"snippets.create",method:"POST",path:"/v1/environments/"+i("snippets.create","ref",e.path.ref)+"/snippets",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async remove(e){return s.send({op:"snippets.remove",method:"DELETE",path:"/v1/environments/"+i("snippets.remove","ref",e.path.ref)+"/snippets/"+i("snippets.remove","id",e.path.id),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async change(e){return s.send({op:"snippets.change",method:"PATCH",path:"/v1/environments/"+i("snippets.change","ref",e.path.ref)+"/snippets/"+i("snippets.change","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}},chartViews:{async list(e){return s.send({op:"chartViews.list",method:"GET",path:"/v1/environments/"+i("chartViews.list","ref",e.path.ref)+"/chart-views",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async create(e){return s.send({op:"chartViews.create",method:"POST",path:"/v1/environments/"+i("chartViews.create","ref",e.path.ref)+"/chart-views",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async remove(e){return s.send({op:"chartViews.remove",method:"DELETE",path:"/v1/environments/"+i("chartViews.remove","ref",e.path.ref)+"/chart-views/"+i("chartViews.remove","id",e.path.id),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async change(e){return s.send({op:"chartViews.change",method:"PATCH",path:"/v1/environments/"+i("chartViews.change","ref",e.path.ref)+"/chart-views/"+i("chartViews.change","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}},webhooks:{async list(e){return s.send({op:"webhooks.list",method:"GET",path:"/v1/environments/"+i("webhooks.list","ref",e.path.ref)+"/webhooks",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async add(e){return s.send({op:"webhooks.add",method:"POST",path:"/v1/environments/"+i("webhooks.add","ref",e.path.ref)+"/webhooks",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deliveries(e){return s.send({op:"webhooks.deliveries",method:"GET",path:"/v1/environments/"+i("webhooks.deliveries","ref",e.path.ref)+"/webhooks/deliveries",auth:[["PalbaseBearer"]],answers:{200:"json"},query:e.query,signal:e.signal})},async redeliver(e){return s.send({op:"webhooks.redeliver",method:"POST",path:"/v1/environments/"+i("webhooks.redeliver","ref",e.path.ref)+"/webhooks/deliveries/"+i("webhooks.redeliver","delivery",e.path.delivery)+"/redeliver",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async change(e){return s.send({op:"webhooks.change",method:"PUT",path:"/v1/environments/"+i("webhooks.change","ref",e.path.ref)+"/webhooks/"+i("webhooks.change","endpoint",e.path.endpoint),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async remove(e){return s.send({op:"webhooks.remove",method:"DELETE",path:"/v1/environments/"+i("webhooks.remove","ref",e.path.ref)+"/webhooks/"+i("webhooks.remove","endpoint",e.path.endpoint),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})}},environmentTokens:{async list(e){return s.send({op:"environmentTokens.list",method:"GET",path:"/v1/environments/"+i("environmentTokens.list","ref",e.path.ref)+"/tokens",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async mint(e){return s.send({op:"environmentTokens.mint",method:"POST",path:"/v1/environments/"+i("environmentTokens.mint","ref",e.path.ref)+"/tokens",auth:[["PalbaseBearer"],[]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async revoke(e){return s.send({op:"environmentTokens.revoke",method:"DELETE",path:"/v1/environments/"+i("environmentTokens.revoke","ref",e.path.ref)+"/tokens/"+i("environmentTokens.revoke","id",e.path.id),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})}},billing:{async bill(e){return s.send({op:"billing.bill",method:"GET",path:"/v1/orgs/"+i("billing.bill","id",e.path.id)+"/billing",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async confirm(e){return s.send({op:"billing.confirm",method:"POST",path:"/v1/orgs/"+i("billing.confirm","id",e.path.id)+"/billing/checkout/"+i("billing.confirm","session",e.path.session)+"/confirm",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async cards(e){return s.send({op:"billing.cards",method:"GET",path:"/v1/orgs/"+i("billing.cards","id",e.path.id)+"/billing/cards",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async defaultCard(e){return s.send({op:"billing.defaultCard",method:"PUT",path:"/v1/orgs/"+i("billing.defaultCard","id",e.path.id)+"/billing/cards/"+i("billing.defaultCard","card",e.path.card)+"/default",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async removeCard(e){return s.send({op:"billing.removeCard",method:"DELETE",path:"/v1/orgs/"+i("billing.removeCard","id",e.path.id)+"/billing/cards/"+i("billing.removeCard","card",e.path.card),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async customer(e){return s.send({op:"billing.customer",method:"GET",path:"/v1/orgs/"+i("billing.customer","id",e.path.id)+"/billing/customer",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async setCustomer(e){return s.send({op:"billing.setCustomer",method:"PUT",path:"/v1/orgs/"+i("billing.setCustomer","id",e.path.id)+"/billing/customer",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async charges(e){return s.send({op:"billing.charges",method:"GET",path:"/v1/orgs/"+i("billing.charges","id",e.path.id)+"/billing/charges",auth:[["PalbaseBearer"]],answers:{200:"json"},query:e.query,signal:e.signal})},async csv(e){return s.send({op:"billing.csv",method:"GET",path:"/v1/orgs/"+i("billing.csv","id",e.path.id)+"/billing/charges.csv",auth:[["PalbaseBearer"]],answers:{},ownResponse:!0,query:e.query,signal:e.signal})},async invoices(e){return s.send({op:"billing.invoices",method:"GET",path:"/v1/orgs/"+i("billing.invoices","id",e.path.id)+"/billing/invoices",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async payer(e){return s.send({op:"billing.payer",method:"PUT",path:"/v1/orgs/"+i("billing.payer","id",e.path.id)+"/billing/payer",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async paid(e){return s.send({op:"billing.paid",method:"GET",path:"/v1/orgs/"+i("billing.paid","id",e.path.id)+"/billing/paid",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async stopPaying(e){return s.send({op:"billing.stopPaying",method:"DELETE",path:"/v1/orgs/"+i("billing.stopPaying","id",e.path.id)+"/billing/paid/"+i("billing.stopPaying","org",e.path.org),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async report(e){return s.send({op:"billing.report",method:"GET",path:"/v1/orgs/"+i("billing.report","id",e.path.id)+"/billing/report",auth:[["PalbaseBearer"]],answers:{200:"json"},query:e.query,signal:e.signal})},async reportCsv(e){return s.send({op:"billing.reportCsv",method:"GET",path:"/v1/orgs/"+i("billing.reportCsv","id",e.path.id)+"/billing/report.csv",auth:[["PalbaseBearer"]],answers:{},ownResponse:!0,query:e.query,signal:e.signal})},async project(e){return s.send({op:"billing.project",method:"GET",path:"/v1/orgs/"+i("billing.project","id",e.path.id)+"/billing/projects/"+i("billing.project","project",e.path.project),auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async steer(e){return s.send({op:"billing.steer",method:"PATCH",path:"/v1/orgs/"+i("billing.steer","id",e.path.id)+"/billing/projects/"+i("billing.steer","project",e.path.project),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async freeze(e){return s.send({op:"billing.freeze",method:"PATCH",path:"/v1/orgs/"+i("billing.freeze","id",e.path.id)+"/billing/environments/"+i("billing.freeze","ref",e.path.ref),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}},accessRequests:{async request(e){return s.send({op:"accessRequests.request",method:"POST",path:"/v1/access-requests",auth:[["PalbaseBearer"],[]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}},docs:{async search(e){return s.send({op:"docs.search",method:"GET",path:"/v1/docs/search",auth:[["PalbaseBearer"],[]],answers:{200:"json"},query:e.query,signal:e.signal})}}}}function N(s){let{mint:e,revoke:o}=s;return async r=>{let u=await e(r),c=r.body?.role,t=r.body?.on_behalf_of;if(c===void 0&&t===void 0)return u;let p=u.data,a=[];if(c!==void 0&&p.role!==c&&a.push(`role ${c} (it came back ${p.role==null?"at its minter's":p.role})`),t!==void 0&&p.on_behalf_of!==t.trim()&&a.push("on_behalf_of"),a.length===0)return u;let m;try{await o({path:{ref:r.path.ref,id:String(p.id)}})}catch(h){m=h}let n=`Studio minted the token without the ${a.join(" and ")} asked for \u2014 it is older than this SDK`;throw new P({op:"environmentTokens.mint",status:0,code:"token_role_not_kept",message:m===void 0?`environmentTokens.mint: ${n}; the token (${p.id}) was revoked at once and is not returned \u2014 mint it again once Studio is updated`:`environmentTokens.mint: ${n}, and revoking it failed (${m instanceof Error?m.message:String(m)}) \u2014 revoke token ${p.id} of environment ${r.path.ref} yourself, now`,cause:m})}}var S={pbo_:"an organization's",pbu_:"an account's",pbe_:"an environment's"},te=/^[A-Za-z0-9_-]*$/,$=64,f=44;function X(s){if(typeof s!="string"||s==="")return"token is missing: pass an access token, an organization's (pbo_\u2026), an account's (pbu_\u2026) or an environment's (pbe_\u2026)";let e=s.slice(0,4);if(!Object.hasOwn(S,e))return`token has the wrong prefix: an access token starts with pbo_ (an organization's), pbu_ (an account's) or pbe_ (an environment's)${/^pb_[a-z0-9]+_[cs]/.test(s)?" \u2014 a project key belongs in palbase/server or palbase/web":""}`;let o=s.slice(4);if(o.length!==$)return`token has the wrong length: ${S[e]} access token is ${e} and ${$} characters, this one has ${o.length} after it`;if(!te.test(o))return`token is not ${S[e]} access token: after ${e} come base64url characters alone (A\u2013Z, a\u2013z, 0\u20139, - and _)`;let r=re(o),u=(r[f]<<24|r[f+1]<<16|r[f+2]<<8|r[f+3])>>>0;if(ie(e,r.subarray(0,f))!==u)return"token's checksum does not match: it was mistyped or cut, or made before access tokens carried one \u2014 make a new token"}function se(s){return X(s)===void 0}function Y(s){let e=X(s);if(e!==void 0)throw new TypeError(e)}var ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function re(s){let e=new Uint8Array(s.length*6/8),o=0,r=0,u=0;for(let c of s)o=o<<6|ne.indexOf(c),r+=6,r>=8&&(r-=8,e[u++]=o>>r&255);return e}var Q=(()=>{let s=new Uint32Array(256);for(let e=0;e<256;e++){let o=e;for(let r=0;r<8;r++)o=o&1?3988292384^o>>>1:o>>>1;s[e]=o>>>0}return s})();function ie(s,e){let o=4294967295;for(let r=0;r<s.length;r++)o=Q[(o^s.charCodeAt(r))&255]^o>>>8;for(let r of e)o=Q[(o^r)&255]^o>>>8;return(o^4294967295)>>>0}var Z="palbase.studio",ae="palbase";function oe(){let s=globalThis;return typeof s.window<"u"||typeof s.document<"u"||typeof s.importScripts=="function"||F()}var C=class{domain;#e;#t=new Map;constructor(e){if(oe())throw new TypeError("palbase/cloud runs on a server: its access token opens the organization's projects, so it never goes into a browser, a web worker or a mobile app \u2014 keep it on your server, and have your app call that");Y(e?.token);let o=e.domain??Z;if(typeof o!="string"||!/^[a-z0-9-]+(\.[a-z0-9-]+)+$/.test(o))throw new TypeError(`domain ${JSON.stringify(o)} is not a domain`);this.domain=o;let r=e.token;this.#e=c=>z(k({baseUrl:c,credentials:{token:r},fetch:e.fetch,solveProofOfWork:!1}),e.retry??H);let u=J(this.#e(`https://palbase.app.${o}`));u.environmentTokens.mint=N(u.environmentTokens),Object.assign(this,u)}project(e){if(typeof e!="string"||!/^[a-z0-9]{1,63}$/.test(e))throw new TypeError(`${JSON.stringify(e)} is not an environment's ref`);let o=this.#t.get(e);return o||(o=q(this.#e(e===ae?`https://connect.${this.domain}`:`https://${e}.${this.domain}`)),this.#t.set(e,o)),o}};export{Z as DEFAULT_DOMAIN,C as PalbaseCloud,P as PalbaseError,se as tokenIsWellFormed};
|
|
1
|
+
/*! palbase 0.76.0 — Palbase SDK License (see LICENSE) */
|
|
2
|
+
import{a as F}from"../chunks/KEGVHELA.js";import{a as w,b as R,c as T,e as A,f as E,g as j,h as L,i as M,j as x,k as I,l as D,m as B,n as U,o as G,p as O,q as W,r as K,s as V}from"../chunks/3VGWTVKI.js";import{a as H,b as z}from"../chunks/SVWF7ABJ.js";import{b as P,c as i,d as k}from"../chunks/UOW74IHY.js";import"../chunks/ISMWEEGW.js";import"../chunks/D6NOE76D.js";function q(s){let e=w.client(s),o=R.client(s),r=T.client(s),u=A.client(s),c=E.client(s),t=j.client(s),p=L.client(s),a=M.client(s),m=x.client(s),n=I.client(s),h=D.client(s),g=B.client(s),d=U.client(s),_=G.client(s),y=O.client(s),v=W.client(s),l=K.client(s),b=V.client(s);return{ai:{draftAgent:e.draftAgent,listAgents:e.listAgents,getAgent:e.getAgent,putAgent:e.putAgent,deleteAgent:e.deleteAgent,publishAgent:e.publishAgent,rollbackAgent:e.rollbackAgent,listAgentVersions:e.listAgentVersions,createAudioSpeech:e.createAudioSpeech,createAudioTranscription:e.createAudioTranscription,listChats:e.listChats,createChat:e.createChat,getChat:e.getChat,deleteChat:e.deleteChat,decideChatApproval:e.decideChatApproval,getChatExecution:e.getChatExecution,patchChatExecution:e.patchChatExecution,forkChat:e.forkChat,getChatGoal:e.getChatGoal,setChatGoal:e.setChatGoal,clearChatGoal:e.clearChatGoal,updateChatGoal:e.updateChatGoal,handoffChat:e.handoffChat,putChatMember:e.putChatMember,deleteChatMember:e.deleteChatMember,listChatMessages:e.listChatMessages,sendChatMessage:e.sendChatMessage,getChatMessageAttachment:e.getChatMessageAttachment,listChatParts:e.listChatParts,putChatPipe:e.putChatPipe,deleteChatPipe:e.deleteChatPipe,sendSubagentMessage:e.sendSubagentMessage,stopSubagent:e.stopSubagent,stopChat:e.stopChat,listTurnToolCalls:e.listTurnToolCalls,getChatToolCall:e.getChatToolCall,answerChatToolCall:e.answerChatToolCall,listChatTurnArtifacts:e.listChatTurnArtifacts,getChatTurnArtifact:e.getChatTurnArtifact,getChatTurnCost:e.getChatTurnCost,startChatVoice:e.startChatVoice,getChatVoice:e.getChatVoice,closeChatVoice:e.closeChatVoice,commandChatVoice:e.commandChatVoice,createEmbeddings:e.createEmbeddings,listEndpoints:e.listEndpoints,putEndpoint:e.putEndpoint,deleteEndpoint:e.deleteEndpoint,listEnv:e.listEnv,listEnvAllowances:e.listEnvAllowances,deleteEnvAllowance:e.deleteEnvAllowance,listEnvHostRequests:e.listEnvHostRequests,allowEnvHostRequest:e.allowEnvHostRequest,dismissEnvHostRequest:e.dismissEnvHostRequest,putEnv:e.putEnv,deleteEnv:e.deleteEnv,allowEnvHost:e.allowEnvHost,listEnvironments:e.listEnvironments,createEnvironment:e.createEnvironment,getEnvironment:e.getEnvironment,putEnvironment:e.putEnvironment,deleteEnvironment:e.deleteEnvironment,createEnvironmentBuild:e.createEnvironmentBuild,getEnvironmentBuild:e.getEnvironmentBuild,createImage:e.createImage,getImage:e.getImage,getImageFile:e.getImageFile,deleteMachine:e.deleteMachine,cordonMachine:e.cordonMachine,resumeMachine:e.resumeMachine,listModels:e.listModels,revokePoolKey:e.revokePoolKey,listPools:e.listPools,createPool:e.createPool,deletePool:e.deletePool,listPoolKeys:e.listPoolKeys,createPoolKey:e.createPoolKey,getPoolState:e.getPoolState,listProviders:e.listProviders,connectProvider:e.connectProvider,disconnectProvider:e.disconnectProvider,createResponse:e.createResponse,getResponse:e.getResponse,cancelResponse:e.cancelResponse,followResponse:e.followResponse,getSettings:e.getSettings,putSettings:e.putSettings,getSpend:e.getSpend,askSupport:e.askSupport,listTools:e.listTools,listUsage:e.listUsage,gatewayAudioSpeech:e.gatewayAudioSpeech,gatewayAudioTranscriptions:e.gatewayAudioTranscriptions,gatewayChatCompletions:e.gatewayChatCompletions,gatewayEmbeddings:e.gatewayEmbeddings,gatewayImagesGenerations:e.gatewayImagesGenerations,gatewayAnthropicMessages:e.gatewayAnthropicMessages,gatewayListModels:e.gatewayListModels,gatewayResponses:e.gatewayResponses,createVideo:e.createVideo,getVideo:e.getVideo,cancelVideo:e.cancelVideo,listTriggers:e.listTriggers,createTrigger:e.createTrigger,getTrigger:e.getTrigger,deleteTrigger:e.deleteTrigger,updateTrigger:e.updateTrigger,testTrigger:e.testTrigger,listWaits:e.listWaits,getWait:e.getWait,signalWait:e.signalWait,cancelWait:e.cancelWait,listWorkflowRuns:e.listWorkflowRuns,createWorkflowRun:e.createWorkflowRun,getWorkflowRun:e.getWorkflowRun,recordWorkflowStep:e.recordWorkflowStep,completeWorkflowRun:e.completeWorkflowRun,replayWorkflowRun:e.replayWorkflowRun,stopRunTree:e.stopRunTree,getMemory:e.getMemory,putMemory:e.putMemory,deleteMemory:e.deleteMemory,searchMemory:e.searchMemory,listActorGroupMembers:e.listActorGroupMembers,addActorGroupMember:e.addActorGroupMember,broadcastActorGroup:e.broadcastActorGroup,callA2Arpc:e.callA2Arpc,putMcpUserCredential:e.putMcpUserCredential,deleteMcpUserCredential:e.deleteMcpUserCredential,startMcpoAuth:e.startMcpoAuth,listTemplates:e.listTemplates,getTemplate:e.getTemplate,putTemplate:e.putTemplate,deleteTemplate:e.deleteTemplate,publishTemplate:e.publishTemplate,rollbackTemplate:e.rollbackTemplate,listTemplateVersions:e.listTemplateVersions,listUserSpend:e.listUserSpend,getUserQuota:e.getUserQuota,putUserQuota:e.putUserQuota,deleteUserQuota:e.deleteUserQuota,clientAttestChallenge:e.clientAttestChallenge,runClientTemplate:e.runClientTemplate,voiceClientTemplate:e.voiceClientTemplate},analytics:{listAudiences:o.listAudiences,createAudience:o.createAudience,previewAudience:o.previewAudience,getAudience:o.getAudience,deleteAudience:o.deleteAudience,updateAudience:o.updateAudience,listAudienceMembers:o.listAudienceMembers,alias:o.alias,batch:o.batch,getEventBreakdown:o.getEventBreakdown,capture:o.capture,sendConsoleHistory:o.sendConsoleHistory,getConsoleConfig:o.getConsoleConfig,listConsoleRecords:o.listConsoleRecords,listEventNames:o.listEventNames,listEvents:o.listEvents,getEventTimeline:o.getEventTimeline,runFunnel:o.runFunnel,identify:o.identify,page:o.page,sendPerf:o.sendPerf,listPerfGroups:o.listPerfGroups,getPerfConfig:o.getPerfConfig,getPerfTimeline:o.getPerfTimeline,listRequestLines:o.listRequestLines,getMachineTraffic:o.getMachineTraffic,runRetention:o.runRetention,screen:o.screen,getSettings:o.getSettings,putSettings:o.putSettings,getSummary:o.getSummary,listTraces:o.listTraces,sendTrace:o.sendTrace,sendTraceBatch:o.sendTraceBatch,getTraceHops:o.getTraceHops,listSessionTraces:o.listSessionTraces,getTraceSummary:o.getTraceSummary,getTraceTimeline:o.getTraceTimeline,searchPeople:o.searchPeople,setPersonProperties:o.setPersonProperties,getPerson:o.getPerson,listPersonEvents:o.listPersonEvents,getEventCatalog:o.getEventCatalog,defineEvent:o.defineEvent},auth:{adminVerifyDeviceAssertion:r.adminVerifyDeviceAssertion,adminGetAttestPolicy:r.adminGetAttestPolicy,adminGetAttestObservations:r.adminGetAttestObservations,adminRecordAttestObservations:r.adminRecordAttestObservations,adminListAuditEvents:r.adminListAuditEvents,adminExportAuditEvents:r.adminExportAuditEvents,adminVerifyAuditTrail:r.adminVerifyAuditTrail,adminGetAuthSettings:r.adminGetAuthSettings,adminUpdateAuthSettings:r.adminUpdateAuthSettings,adminGetBreachWatch:r.adminGetBreachWatch,adminListHooks:r.adminListHooks,adminCreateHook:r.adminCreateHook,adminUpdateHook:r.adminUpdateHook,adminDeleteHook:r.adminDeleteHook,adminListHookExecutions:r.adminListHookExecutions,adminListIntegrations:r.adminListIntegrations,adminPutIntegration:r.adminPutIntegration,adminDeleteIntegration:r.adminDeleteIntegration,adminListOAuthClients:r.adminListOAuthClients,adminCreateOAuthClient:r.adminCreateOAuthClient,adminGetOAuthClient:r.adminGetOAuthClient,adminDeleteOAuthClient:r.adminDeleteOAuthClient,adminUpdateOAuthClient:r.adminUpdateOAuthClient,adminListProviders:r.adminListProviders,adminGetPhoneSettings:r.adminGetPhoneSettings,adminUpdatePhoneSettings:r.adminUpdatePhoneSettings,adminToggleProvider:r.adminToggleProvider,adminListRoles:r.adminListRoles,adminUpsertRole:r.adminUpsertRole,adminDeleteRole:r.adminDeleteRole,adminListServiceAccounts:r.adminListServiceAccounts,adminCreateServiceAccount:r.adminCreateServiceAccount,adminGetServiceAccount:r.adminGetServiceAccount,adminRevokeServiceAccount:r.adminRevokeServiceAccount,adminRotateServiceAccount:r.adminRotateServiceAccount,adminListSessions:r.adminListSessions,adminRevokeSession:r.adminRevokeSession,adminListSigningKeys:r.adminListSigningKeys,adminRotateSigningKey:r.adminRotateSigningKey,socialAdminConfig:r.socialAdminConfig,socialCredentialPut:r.socialCredentialPut,socialCredentialDelete:r.socialCredentialDelete,socialProviderPatch:r.socialProviderPatch,adminGetStats:r.adminGetStats,adminSendTestTemplate:r.adminSendTestTemplate,adminListTestUsers:r.adminListTestUsers,adminCreateTestUsers:r.adminCreateTestUsers,adminSetTestUserPhone:r.adminSetTestUserPhone,adminCreateTestSignupAddress:r.adminCreateTestSignupAddress,adminDeleteTestUser:r.adminDeleteTestUser,adminCreateCustomToken:r.adminCreateCustomToken,adminListUsers:r.adminListUsers,adminCreateUser:r.adminCreateUser,adminImportUsers:r.adminImportUsers,adminGetUser:r.adminGetUser,adminDeleteUser:r.adminDeleteUser,adminUpdateUser:r.adminUpdateUser,adminBanUser:r.adminBanUser,adminGetUserConsents:r.adminGetUserConsents,adminRevokeUserCredentials:r.adminRevokeUserCredentials,adminExportUser:r.adminExportUser,adminListUserMfaFactors:r.adminListUserMfaFactors,adminResetUserMfa:r.adminResetUserMfa,adminResetUserPassword:r.adminResetUserPassword,adminListUserRoles:r.adminListUserRoles,adminAssignUserRole:r.adminAssignUserRole,adminRevokeUserRole:r.adminRevokeUserRole,adminRevokeUserSessions:r.adminRevokeUserSessions,adminUnbanUser:r.adminUnbanUser,adminGetInstallationConsents:r.adminGetInstallationConsents,adminRefuseConsents:r.adminRefuseConsents,adminInviteUser:r.adminInviteUser},calls:{adminListCalls:u.adminListCalls,adminGetCall:u.adminGetCall,adminEndCall:u.adminEndCall,createCallTicket:u.createCallTicket,adminGetCallTranscription:u.adminGetCallTranscription,adminStartCallTranscription:u.adminStartCallTranscription,adminStopCallTranscription:u.adminStopCallTranscription,adminIngestCallTranscriptionAudio:u.adminIngestCallTranscriptionAudio,getCallSettings:u.getCallSettings,putCallSettings:u.putCallSettings,rotateCallHookSecret:u.rotateCallHookSecret},campaigns:{listBroadcasts:c.listBroadcasts,createBroadcast:c.createBroadcast,recordBroadcastConversion:c.recordBroadcastConversion,getBroadcast:c.getBroadcast,updateBroadcast:c.updateBroadcast,deleteBroadcast:c.deleteBroadcast,cancelBroadcast:c.cancelBroadcast,pauseBroadcast:c.pauseBroadcast,startBroadcast:c.startBroadcast,getBroadcastStats:c.getBroadcastStats,listTrackingLinks:c.listTrackingLinks,createTrackingLink:c.createTrackingLink,attributeLinkConversion:c.attributeLinkConversion,getTrackingLink:c.getTrackingLink,updateTrackingLink:c.updateTrackingLink,deleteTrackingLink:c.deleteTrackingLink,getTrackingLinkStats:c.getTrackingLinkStats,listOnSiteCampaigns:c.listOnSiteCampaigns,createOnSiteCampaign:c.createOnSiteCampaign,createOnSiteImpression:c.createOnSiteImpression,recordOnSiteEvent:c.recordOnSiteEvent,listOnSiteMessages:c.listOnSiteMessages,getOnSiteSettings:c.getOnSiteSettings,putOnSiteSettings:c.putOnSiteSettings,listOnSiteTemplates:c.listOnSiteTemplates,getOnSiteCampaign:c.getOnSiteCampaign,updateOnSiteCampaign:c.updateOnSiteCampaign,deleteOnSiteCampaign:c.deleteOnSiteCampaign,getOnSiteCampaignStats:c.getOnSiteCampaignStats},commerce:{listBrands:t.listBrands,createBrand:t.createBrand,createCart:t.createCart,getCart:t.getCart,updateCart:t.updateCart,checkoutCart:t.checkoutCart,addCartItem:t.addCartItem,deleteCartItem:t.deleteCartItem,updateCartItem:t.updateCartItem,applyCartPromoCode:t.applyCartPromoCode,removeCartPromoCode:t.removeCartPromoCode,selectCartShipping:t.selectCartShipping,storefrontListBrands:t.storefrontListBrands,storefrontListCategories:t.storefrontListCategories,storefrontListChannels:t.storefrontListChannels,storefrontListCollections:t.storefrontListCollections,storefrontListProducts:t.storefrontListProducts,storefrontSearchProducts:t.storefrontSearchProducts,storefrontSuggest:t.storefrontSuggest,storefrontRecommendProducts:t.storefrontRecommendProducts,storefrontProductRecommendations:t.storefrontProductRecommendations,storefrontGetProduct:t.storefrontGetProduct,storefrontListProductReviews:t.storefrontListProductReviews,storefrontListRegions:t.storefrontListRegions,storefrontListStores:t.storefrontListStores,storefrontGetStore:t.storefrontGetStore,storefrontListStoreReviews:t.storefrontListStoreReviews,listCategories:t.listCategories,createCategory:t.createCategory,listChannels:t.listChannels,createChannel:t.createChannel,attachChannelRegion:t.attachChannelRegion,attachChannelStore:t.attachChannelStore,detachChannelStore:t.detachChannelStore,listCollections:t.listCollections,createCollection:t.createCollection,addCollectionProduct:t.addCollectionProduct,removeCollectionProduct:t.removeCollectionProduct,createDigitalAsset:t.createDigitalAsset,updateFulfillment:t.updateFulfillment,addShipmentEvent:t.addShipmentEvent,listDiscoveryStrategies:t.listDiscoveryStrategies,createDiscoveryStrategy:t.createDiscoveryStrategy,getDiscoveryStrategy:t.getDiscoveryStrategy,deleteDiscoveryStrategy:t.deleteDiscoveryStrategy,updateDiscoveryStrategy:t.updateDiscoveryStrategy,listMerchandisingRules:t.listMerchandisingRules,createMerchandisingRule:t.createMerchandisingRule,getMerchandisingRule:t.getMerchandisingRule,deleteMerchandisingRule:t.deleteMerchandisingRule,updateMerchandisingRule:t.updateMerchandisingRule,listSearchSynonyms:t.listSearchSynonyms,createSearchSynonym:t.createSearchSynonym,deleteSearchSynonym:t.deleteSearchSynonym,refreshDiscoverySignals:t.refreshDiscoverySignals,listHooks:t.listHooks,upsertHook:t.upsertHook,deleteHook:t.deleteHook,listInventory:t.listInventory,adjustInventory:t.adjustInventory,bulkSyncInventory:t.bulkSyncInventory,listInventoryMovements:t.listInventoryMovements,listInvoices:t.listInvoices,createInvoice:t.createInvoice,updateInvoice:t.updateInvoice,listListings:t.listListings,createListing:t.createListing,updateListing:t.updateListing,importLicenseKeys:t.importLicenseKeys,upsertPrice:t.upsertPrice,createMediaAsset:t.createMediaAsset,listOrders:t.listOrders,getGuestOrder:t.getGuestOrder,getOrder:t.getOrder,markOrderPaid:t.markOrderPaid,listPriceLists:t.listPriceLists,createPriceList:t.createPriceList,listProducts:t.listProducts,createProduct:t.createProduct,createQuickProduct:t.createQuickProduct,getProduct:t.getProduct,updateProduct:t.updateProduct,approveProduct:t.approveProduct,upsertProductOption:t.upsertProductOption,createVariant:t.createVariant,listRegions:t.listRegions,createRegion:t.createRegion,updateRegion:t.updateRegion,listReturns:t.listReturns,approveReturn:t.approveReturn,completeReturn:t.completeReturn,receiveReturn:t.receiveReturn,adminListReviews:t.adminListReviews,adminDeleteReview:t.adminDeleteReview,adminModerateReview:t.adminModerateReview,getCommerceSettings:t.getCommerceSettings,updateCommerceSettings:t.updateCommerceSettings,listSettlements:t.listSettlements,generateSettlement:t.generateSettlement,markSettlementPaid:t.markSettlementPaid,listShippingOptions:t.listShippingOptions,createShippingOption:t.createShippingOption,listShippingProfiles:t.listShippingProfiles,createShippingProfile:t.createShippingProfile,listStockLocations:t.listStockLocations,createStockLocation:t.createStockLocation,listStoreOrders:t.listStoreOrders,getStoreOrder:t.getStoreOrder,cancelStoreOrder:t.cancelStoreOrder,createFulfillment:t.createFulfillment,createReturn:t.createReturn,listStores:t.listStores,createStore:t.createStore,getStore:t.getStore,updateStore:t.updateStore,sellerUpdateFulfillment:t.sellerUpdateFulfillment,sellerAddShipmentEvent:t.sellerAddShipmentEvent,sellerListInventory:t.sellerListInventory,sellerAdjustInventory:t.sellerAdjustInventory,sellerBulkSyncInventory:t.sellerBulkSyncInventory,sellerListListings:t.sellerListListings,sellerCreateListing:t.sellerCreateListing,sellerUpdateListing:t.sellerUpdateListing,sellerImportLicenseKeys:t.sellerImportLicenseKeys,sellerUpsertPrice:t.sellerUpsertPrice,sellerListStockLocations:t.sellerListStockLocations,sellerCreateStockLocation:t.sellerCreateStockLocation,addStoreMember:t.addStoreMember,removeStoreMember:t.removeStoreMember,sellerGetMetrics:t.sellerGetMetrics,sellerListStoreOrders:t.sellerListStoreOrders,sellerGetStoreOrder:t.sellerGetStoreOrder,sellerCancelStoreOrder:t.sellerCancelStoreOrder,sellerCreateFulfillment:t.sellerCreateFulfillment,onboardStorePaymentAccount:t.onboardStorePaymentAccount,sellerOnboardPayouts:t.sellerOnboardPayouts,sellerOnboardingLink:t.sellerOnboardingLink,sellerListProducts:t.sellerListProducts,sellerCreateProduct:t.sellerCreateProduct,sellerCreateQuickProduct:t.sellerCreateQuickProduct,sellerCreatePromotionRule:t.sellerCreatePromotionRule,sellerListReturns:t.sellerListReturns,sellerApproveReturn:t.sellerApproveReturn,sellerCompleteReturn:t.sellerCompleteReturn,sellerReceiveReturn:t.sellerReceiveReturn,sellerListReviews:t.sellerListReviews,sellerReplyReview:t.sellerReplyReview,sellerListSettlements:t.sellerListSettlements,sellerCreateShippingOption:t.sellerCreateShippingOption,listTaxRates:t.listTaxRates,upsertTaxRate:t.upsertTaxRate,updateVariant:t.updateVariant,setBundleItems:t.setBundleItems,recomputeVariantBuyBox:t.recomputeVariantBuyBox,revokePromotionCode:t.revokePromotionCode,evaluatePromotions:t.evaluatePromotions,holdPromotions:t.holdPromotions,commitPromotionHold:t.commitPromotionHold,releasePromotionHold:t.releasePromotionHold,listPromotionRedemptions:t.listPromotionRedemptions,reversePromotionRedemption:t.reversePromotionRedemption,listPromotionRules:t.listPromotionRules,createPromotionRule:t.createPromotionRule,getPromotionRule:t.getPromotionRule,archivePromotionRule:t.archivePromotionRule,updatePromotionRule:t.updatePromotionRule,upsertPromotionBudget:t.upsertPromotionBudget,listPromotionCodes:t.listPromotionCodes,createPromotionCode:t.createPromotionCode,generatePromotionCodeBatch:t.generatePromotionCodeBatch},flags:{getValues:p.getValues,batchUserValues:p.batchUserValues,getDelta:p.getDelta,getEvaluations:p.getEvaluations,listExperiments:p.listExperiments,startExperiment:p.startExperiment,getExperiment:p.getExperiment,getExperimentResults:p.getExperimentResults,stopExperiment:p.stopExperiment,declareExperimentWinner:p.declareExperimentWinner,getCurrentInstallations:p.getCurrentInstallations,getInstallationsDaily:p.getInstallationsDaily,getSnapshot:p.getSnapshot,listDefinitions:p.listDefinitions,getDefinition:p.getDefinition,putDefinition:p.putDefinition,deleteDefinition:p.deleteDefinition,activateTemplates:p.activateTemplates,getActiveTemplate:p.getActiveTemplate,getTemplateCapabilities:p.getTemplateCapabilities,getTemplateDraft:p.getTemplateDraft,createTemplateDraft:p.createTemplateDraft,discardTemplateDraft:p.discardTemplateDraft,putTemplateParameter:p.putTemplateParameter,removeTemplateParameter:p.removeTemplateParameter,reviewTemplateDraft:p.reviewTemplateDraft,publishTemplate:p.publishTemplate,getPublishReceipt:p.getPublishReceipt,restoreTemplateVersion:p.restoreTemplateVersion,listTemplateVersions:p.listTemplateVersions,getTemplateVersion:p.getTemplateVersion,getUserValues:p.getUserValues,putUserValues:p.putUserValues,deleteUserValues:p.deleteUserValues,putUserValue:p.putUserValue,deleteUserValue:p.deleteUserValue},iap:{getAppleAccount:a.getAppleAccount,disconnectApple:a.disconnectApple,createAppleGrant:a.createAppleGrant,getAppleReadiness:a.getAppleReadiness,setXcodeCertificate:a.setXcodeCertificate,clearXcodeCertificate:a.clearXcodeCertificate,setXcodeOfferKey:a.setXcodeOfferKey,getCatalog:a.getCatalog,saveCatalog:a.saveCatalog,planCatalog:a.planCatalog,getCatalogPlan:a.getCatalogPlan,confirmCatalogPlan:a.confirmCatalogPlan,declineCatalogPlan:a.declineCatalogPlan,listCatalogRevisions:a.listCatalogRevisions,getCatalogRevision:a.getCatalogRevision,restoreCatalogRevision:a.restoreCatalogRevision,validateCatalog:a.validateCatalog,listCharts:a.listCharts,getChartsOverview:a.getChartsOverview,getChart:a.getChart,createCheckout:a.createCheckout,createCheckoutRedemption:a.createCheckoutRedemption,listCoupons:a.listCoupons,createCoupon:a.createCoupon,getCoupon:a.getCoupon,revokeCoupon:a.revokeCoupon,listCouponCodes:a.listCouponCodes,searchCustomers:a.searchCustomers,getCustomer:a.getCustomer,grantCredits:a.grantCredits,listCreditEntries:a.listCreditEntries,forgiveCredits:a.forgiveCredits,listCustomerGrants:a.listCustomerGrants,grantEntitlement:a.grantEntitlement,revokeGrant:a.revokeGrant,getCustomerHistory:a.getCustomerHistory,holdSpend:a.holdSpend,setCustomerLimit:a.setCustomerLimit,clearCustomerLimit:a.clearCustomerLimit,grantLimit:a.grantLimit,spend:a.spend,commitSpend:a.commitSpend,extendHold:a.extendHold,releaseSpend:a.releaseSpend,reverseSpend:a.reverseSpend,cancelSubscription:a.cancelSubscription,extendSubscription:a.extendSubscription,refundSubscription:a.refundSubscription,listExperiments:a.listExperiments,startExperiment:a.startExperiment,getExperiment:a.getExperiment,getExperimentResults:a.getExperimentResults,stopExperiment:a.stopExperiment,declareExperimentWinner:a.declareExperimentWinner,getGoogleAccount:a.getGoogleAccount,connectGoogle:a.connectGoogle,disconnectGoogle:a.disconnectGoogle,getOfferings:a.getOfferings,getOfferStats:a.getOfferStats,listPaywalls:a.listPaywalls,createPaywall:a.createPaywall,listPaywallAssets:a.listPaywallAssets,registerPaywallAsset:a.registerPaywallAsset,deletePaywallAsset:a.deletePaywallAsset,listPaywallTemplates:a.listPaywallTemplates,getPaywallTemplateAsset:a.getPaywallTemplateAsset,validatePaywall:a.validatePaywall,getPaywall:a.getPaywall,deletePaywall:a.deletePaywall,savePaywallDraft:a.savePaywallDraft,publishPaywall:a.publishPaywall,listPaywallVersions:a.listPaywallVersions,getPaywallVersion:a.getPaywallVersion,listPlacements:a.listPlacements,listAttributeKeys:a.listAttributeKeys,setPlacement:a.setPlacement,deletePlacement:a.deletePlacement,recordPaywallExposure:a.recordPaywallExposure,getPlacementPaywall:a.getPlacementPaywall,previewPlacement:a.previewPlacement,getPlacementResults:a.getPlacementResults,getPlacementRules:a.getPlacementRules,setPlacementRules:a.setPlacementRules,getSettings:a.getSettings,updateSettings:a.updateSettings},journeys:{listJourneys:m.listJourneys,createJourney:m.createJourney,listBlueprints:m.listBlueprints,listPersonRuns:m.listPersonRuns,simulateJourney:m.simulateJourney,listStoreBlueprints:m.listStoreBlueprints,activateStoreBlueprint:m.activateStoreBlueprint,deleteStoreBlueprint:m.deleteStoreBlueprint,validateJourney:m.validateJourney,getJourney:m.getJourney,updateJourney:m.updateJourney,deleteJourney:m.deleteJourney,copyJourney:m.copyJourney,publishJourney:m.publishJourney,listJourneyRuns:m.listJourneyRuns,getJourneyStats:m.getJourneyStats,stopJourney:m.stopJourney,testJourney:m.testJourney},machines:{listMachines:n.listMachines,createMachine:n.createMachine,listMachineSizes:n.listMachineSizes,getMachineNetwork:n.getMachineNetwork,connectGitHub:n.connectGitHub,listInstallations:n.listInstallations,linkInstallation:n.linkInstallation,shareInstallation:n.shareInstallation,unlinkInstallation:n.unlinkInstallation,listRepositories:n.listRepositories,getMachine:n.getMachine,deleteMachine:n.deleteMachine,updateMachine:n.updateMachine,listBuilds:n.listBuilds,deployMachine:n.deployMachine,listMachinePreviews:n.listMachinePreviews,putMachinePreview:n.putMachinePreview,deleteMachinePreview:n.deleteMachinePreview,listMachineDomains:n.listMachineDomains,addMachineDomain:n.addMachineDomain,deleteMachineDomain:n.deleteMachineDomain,updateMachineDomain:n.updateMachineDomain,getBuild:n.getBuild,getBuildLog:n.getBuildLog,rollbackMachine:n.rollbackMachine,listDatabases:n.listDatabases,createDatabase:n.createDatabase,listDatabaseSizes:n.listDatabaseSizes,getDatabase:n.getDatabase,deleteDatabase:n.deleteDatabase,updateDatabase:n.updateDatabase,undeleteDatabase:n.undeleteDatabase,purgeDatabase:n.purgeDatabase,getDatabaseCredentials:n.getDatabaseCredentials,changeDatabasePassword:n.changeDatabasePassword,readMachineLogs:n.readMachineLogs,execInMachine:n.execInMachine,listMachineExecs:n.listMachineExecs,getMachineMetrics:n.getMachineMetrics,getMachineContract:n.getMachineContract,restoreDatabase:n.restoreDatabase,getDatabaseSchema:n.getDatabaseSchema,getDatabaseMetrics:n.getDatabaseMetrics,queryDatabase:n.queryDatabase,listCrons:n.listCrons,listCronRuns:n.listCronRuns,runCron:n.runCron,pauseCron:n.pauseCron,resumeCron:n.resumeCron,listTasks:n.listTasks,enqueueTask:n.enqueueTask,getTask:n.getTask,cancelTask:n.cancelTask,retryTask:n.retryTask,listTaskTypes:n.listTaskTypes,makeTemplatedTestUsers:n.makeTemplatedTestUsers,templateTestUser:n.templateTestUser,deleteTemplatedTestUser:n.deleteTemplatedTestUser,listSites:n.listSites,createSite:n.createSite,getSite:n.getSite,deleteSite:n.deleteSite,updateSite:n.updateSite,listSiteReleases:n.listSiteReleases,createSiteRelease:n.createSiteRelease,uploadSiteFile:n.uploadSiteFile,finishSiteRelease:n.finishSiteRelease,rollbackSite:n.rollbackSite,listSiteBuilds:n.listSiteBuilds,deploySite:n.deploySite,listSitePreviews:n.listSitePreviews,listSiteDomains:n.listSiteDomains,addSiteDomain:n.addSiteDomain,deleteSiteDomain:n.deleteSiteDomain,updateSiteDomain:n.updateSiteDomain,getSiteBuild:n.getSiteBuild,authorizeSitePreview:n.authorizeSitePreview,authorizeMachinePreview:n.authorizeMachinePreview,openMachinePreview:n.openMachinePreview,moveMachine:n.moveMachine,moveSite:n.moveSite,moveDatabase:n.moveDatabase,cancelSiteBuild:n.cancelSiteBuild,cancelBuild:n.cancelBuild,listSiteHooks:n.listSiteHooks,createSiteHook:n.createSiteHook,deleteSiteHook:n.deleteSiteHook,listMachineHooks:n.listMachineHooks,createMachineHook:n.createMachineHook,deleteMachineHook:n.deleteMachineHook,detectProject:n.detectProject,createPreviewPass:n.createPreviewPass,listPreviewLinks:n.listPreviewLinks,createPreviewLink:n.createPreviewLink,deletePreviewLink:n.deletePreviewLink,listEnvironmentDomains:n.listEnvironmentDomains,addEnvironmentDomain:n.addEnvironmentDomain,deleteEnvironmentDomain:n.deleteEnvironmentDomain,setEnvironmentSignInDomain:n.setEnvironmentSignInDomain},messaging:{adminAccessLog:h.adminAccessLog,adminListConversations:h.adminListConversations,adminCreateConversation:h.adminCreateConversation,adminGetConversation:h.adminGetConversation,adminDeleteConversation:h.adminDeleteConversation,adminUpdateConversation:h.adminUpdateConversation,adminAddMembers:h.adminAddMembers,adminRemoveMember:h.adminRemoveMember,adminListMessages:h.adminListMessages,adminSendMessage:h.adminSendMessage,adminDeleteMessage:h.adminDeleteMessage,adminFileUrl:h.adminFileUrl,adminPutProfile:h.adminPutProfile,adminListReports:h.adminListReports,adminGetReport:h.adminGetReport,adminReportFileUrl:h.adminReportFileUrl,adminResolveReport:h.adminResolveReport,getSettings:h.getSettings,putSettings:h.putSettings,rotateHookSecret:h.rotateHookSecret},notify:{getDeliverability:g.getDeliverability,listDevices:g.listDevices,getDeviceStats:g.getDeviceStats,deleteMyDevice:g.deleteMyDevice,sendEmail:g.sendEmail,listInAppCampaigns:g.listInAppCampaigns,createInAppCampaign:g.createInAppCampaign,getInAppCampaign:g.getInAppCampaign,putInAppCampaign:g.putInAppCampaign,deleteInAppCampaign:g.deleteInAppCampaign,getInAppCampaignStats:g.getInAppCampaignStats,listInAppTemplates:g.listInAppTemplates,sendInbox:g.sendInbox,listInboxMessages:g.listInboxMessages,listNotifyMessages:g.listNotifyMessages,getNotifyMessage:g.getNotifyMessage,cancelMessage:g.cancelMessage,getMetricsSummary:g.getMetricsSummary,listNotifyProviders:g.listNotifyProviders,putNotifyProvider:g.putNotifyProvider,deleteNotifyProvider:g.deleteNotifyProvider,sendPush:g.sendPush,getNotifySettings:g.getNotifySettings,putNotifySettings:g.putNotifySettings,sendSms:g.sendSms,listEmailTemplates:g.listEmailTemplates,getEmailTemplate:g.getEmailTemplate,putEmailTemplate:g.putEmailTemplate,deleteEmailTemplate:g.deleteEmailTemplate,listPushTemplates:g.listPushTemplates,getPushTemplate:g.getPushTemplate,putPushTemplate:g.putPushTemplate,deletePushTemplate:g.deletePushTemplate,listSmsTemplates:g.listSmsTemplates,getSmsTemplate:g.getSmsTemplate,putSmsTemplate:g.putSmsTemplate,deleteSmsTemplate:g.deleteSmsTemplate,listWhatsAppTemplates:g.listWhatsAppTemplates,getWhatsAppTemplate:g.getWhatsAppTemplate,putWhatsAppTemplate:g.putWhatsAppTemplate,deleteWhatsAppTemplate:g.deleteWhatsAppTemplate,listTestUserMessages:g.listTestUserMessages,listTopics:g.listTopics,createTopic:g.createTopic,deleteTopic:g.deleteTopic,changeTopic:g.changeTopic,addTopicSubscribers:g.addTopicSubscribers,removeTopicSubscriber:g.removeTopicSubscriber,listUserDevices:g.listUserDevices,getUserPreferences:g.getUserPreferences,setUserPreferences:g.setUserPreferences,startVerification:g.startVerification,checkVerification:g.checkVerification,getWebPushStatus:g.getWebPushStatus,sendWhatsApp:g.sendWhatsApp,listWhatsAppInbound:g.listWhatsAppInbound},payments:{auditCashFlow:d.auditCashFlow,auditDrift:d.auditDrift,auditLedger:d.auditLedger,exportAuditLedgerCsv:d.exportAuditLedgerCsv,getCapabilities:d.getCapabilities,listChannels:d.listChannels,connectChannel:d.connectChannel,createChannelGrant:d.createChannelGrant,getChannel:d.getChannel,deleteChannel:d.deleteChannel,checkChannel:d.checkChannel,setDefaultChannel:d.setDefaultChannel,listDisputes:d.listDisputes,lookupInstallments:d.lookupInstallments,listIntents:d.listIntents,createIntent:d.createIntent,getIntent:d.getIntent,listIntentAttempts:d.listIntentAttempts,cancelIntent:d.cancelIntent,captureIntent:d.captureIntent,confirmIntent:d.confirmIntent,submitIntentOtp:d.submitIntentOtp,listRefunds:d.listRefunds,createRefund:d.createRefund,listRoutingRules:d.listRoutingRules,replaceRoutingRules:d.replaceRoutingRules,getSellerAccount:d.getSellerAccount,listSellerLedger:d.listSellerLedger,getSettings:d.getSettings,updateSettings:d.updateSettings,listPaymentSplits:d.listPaymentSplits,updatePaymentSplit:d.updatePaymentSplit,approvePaymentSplit:d.approvePaymentSplit,disapprovePaymentSplit:d.disapprovePaymentSplit,refundPaymentSplit:d.refundPaymentSplit,createStripeAppGrant:d.createStripeAppGrant,listSubMerchants:d.listSubMerchants,upsertSubMerchant:d.upsertSubMerchant,getSubMerchant:d.getSubMerchant,createSubMerchantOnboardingLink:d.createSubMerchantOnboardingLink,syncSubMerchant:d.syncSubMerchant,listSubscriptions:d.listSubscriptions,createSubscription:d.createSubscription,cancelSubscription:d.cancelSubscription,extendSubscription:d.extendSubscription,listWallets:d.listWallets,upsertWallet:d.upsertWallet,chargeWallet:d.chargeWallet,creditWallet:d.creditWallet,getCustomerWallets:d.getCustomerWallets,freezeWallet:d.freezeWallet,createWalletHold:d.createWalletHold,commitWalletHold:d.commitWalletHold,releaseWalletHold:d.releaseWalletHold,voidPendingWalletCredits:d.voidPendingWalletCredits,transferWallet:d.transferWallet},realtime:{broadcast:_.broadcast,getChannels:_.getChannels,putChannels:_.putChannels,getLimits:_.getLimits,putLimits:_.putLimits,revalidate:_.revalidate,writeState:_.writeState,getStats:_.getStats},secrets:{listSecretAudit:y.listSecretAudit,listFieldKeys:y.listFieldKeys,getFieldKeys:y.getFieldKeys,openFields:y.openFields,sealPlaceholder:y.sealPlaceholder,rotateFieldKeys:y.rotateFieldKeys,listTransitKeys:y.listTransitKeys,getTransitKeys:y.getTransitKeys,getTransitPublicKeys:y.getTransitPublicKeys,rotateTransitKeys:y.rotateTransitKeys,retireTransitKey:y.retireTransitKey,listSecrets:y.listSecrets,getEnvironmentValues:y.getEnvironmentValues,getSecret:y.getSecret,putSecret:y.putSecret,deleteSecret:y.deleteSecret,rollbackSecret:y.rollbackSecret,listSecretVersions:y.listSecretVersions},storage:{listBuckets:v.listBuckets,getBucket:v.getBucket,putBucket:v.putBucket,deleteBucket:v.deleteBucket,copyObject:v.copyObject,moveObject:v.moveObject,listObjects:v.listObjects,getObject:v.getObject,putObject:v.putObject,deleteObject:v.deleteObject,headObject:v.headObject,createSignedUrl:v.createSignedUrl,createUploadUrl:v.createUploadUrl,getStorageStats:v.getStorageStats},stores:{listActions:l.listActions,getAction:l.getAction,confirmAction:l.confirmAction,declineAction:l.declineAction,getAppleAccount:l.getAppleAccount,disconnectApple:l.disconnectApple,checkAppleAccount:l.checkAppleAccount,createAppleGrant:l.createAppleGrant,getSandboxReadiness:l.getSandboxReadiness,listSandboxTesters:l.listSandboxTesters,clearSandboxPurchaseHistory:l.clearSandboxPurchaseHistory,updateSandboxTester:l.updateSandboxTester,listApps:l.listApps,listFeedback:l.listFeedback,getFeedback:l.getFeedback,listGroups:l.listGroups,createGroup:l.createGroup,linkApp:l.linkApp,getListing:l.getListing,setListing:l.setListing,planListing:l.planListing,createPackage:l.createPackage,uploadScreenshot:l.uploadScreenshot,getReviewInfo:l.getReviewInfo,setReviewInfo:l.setReviewInfo,getUploadKey:l.getUploadKey,getAppStoreVersion:l.getAppStoreVersion,prepareAppStoreVersion:l.prepareAppStoreVersion,planPhasedRelease:l.planPhasedRelease,planReleaseVersion:l.planReleaseVersion,planSubmitReview:l.planSubmitReview,planWithdrawReview:l.planWithdrawReview,getAppVitals:l.getAppVitals,getAppWebhook:l.getAppWebhook,makeAppWebhook:l.makeAppWebhook,pingAppWebhook:l.pingAppWebhook,getGoogleAccount:l.getGoogleAccount,connectGoogle:l.connectGoogle,disconnectGoogle:l.disconnectGoogle,checkGoogleAccount:l.checkGoogleAccount,deleteGroup:l.deleteGroup,renameGroup:l.renameGroup,addGroupBuild:l.addGroupBuild,listTesters:l.listTesters,setTesters:l.setTesters,listPackages:l.listPackages,getPackage:l.getPackage,planBetaReview:l.planBetaReview,listDeliveries:l.listDeliveries,deliver:l.deliver,getSignedBundleLink:l.getSignedBundleLink,planExpire:l.planExpire,planExportCompliance:l.planExportCompliance,setWhatToTest:l.setWhatToTest,getAppleSession:l.getAppleSession,disconnectAppleSession:l.disconnectAppleSession,checkAppleSession:l.checkAppleSession,createAppleIdGrant:l.createAppleIdGrant,getAppReview:l.getAppReview,getReviewAttachment:l.getReviewAttachment,setReviewDraft:l.setReviewDraft,sendReviewDraft:l.sendReviewDraft,getAppPrivacy:l.getAppPrivacy,setAppPrivacy:l.setAppPrivacy,makeAppRecord:l.makeAppRecord,removeAppRecord:l.removeAppRecord,listMadeAppleKeys:l.listMadeAppleKeys,makeAppleKey:l.makeAppleKey,revokeMadeAppleKey:l.revokeMadeAppleKey,shareAppleSession:l.shareAppleSession,unshareAppleSession:l.unshareAppleSession,listInvitations:l.listInvitations,invitePerson:l.invitePerson,revokeInvitation:l.revokeInvitation,listDevices:l.listDevices},workspaces:{listWorkspaces:b.listWorkspaces,createWorkspace:b.createWorkspace,testWorkspaceByos:b.testWorkspaceByos,listProjectS3Keys:b.listProjectS3Keys,createProjectS3Key:b.createProjectS3Key,deleteProjectS3Key:b.deleteProjectS3Key,getWorkspace:b.getWorkspace,deleteWorkspace:b.deleteWorkspace,updateWorkspaceStorage:b.updateWorkspaceStorage,getWorkspaceFiles:b.getWorkspaceFiles,putWorkspaceFile:b.putWorkspaceFile,deleteWorkspaceFile:b.deleteWorkspaceFile,listWorkspaceTokens:b.listWorkspaceTokens,createWorkspaceToken:b.createWorkspaceToken,deleteWorkspaceToken:b.deleteWorkspaceToken,listWorkspaceLocks:b.listWorkspaceLocks,acquireWorkspaceLock:b.acquireWorkspaceLock,releaseWorkspaceLock:b.releaseWorkspaceLock}}}function J(s){return{orgs:{async list(e){return s.send({op:"orgs.list",method:"GET",path:"/v1/orgs",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e?.signal})},async create(e){return s.send({op:"orgs.create",method:"POST",path:"/v1/orgs",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async get(e){return s.send({op:"orgs.get",method:"GET",path:"/v1/orgs/"+i("orgs.get","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async takeAway(e){return s.send({op:"orgs.takeAway",method:"DELETE",path:"/v1/orgs/"+i("orgs.takeAway","id",e.path.id),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async rename(e){return s.send({op:"orgs.rename",method:"PATCH",path:"/v1/orgs/"+i("orgs.rename","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async members(e){return s.send({op:"orgs.members",method:"GET",path:"/v1/orgs/"+i("orgs.members","id",e.path.id)+"/members",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async auditLog(e){return s.send({op:"orgs.auditLog",method:"GET",path:"/v1/orgs/"+i("orgs.auditLog","id",e.path.id)+"/audit",auth:[["PalbaseBearer"]],answers:{200:"json"},query:e.query,signal:e.signal})}},invitations:{async mine(e){return s.send({op:"invitations.mine",method:"GET",path:"/v1/invitations",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e?.signal})},async accept(e){return s.send({op:"invitations.accept",method:"POST",path:"/v1/invitations/"+i("invitations.accept","id",e.path.id)+"/accept",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})}},orgWebhooks:{async list(e){return s.send({op:"orgWebhooks.list",method:"GET",path:"/v1/orgs/"+i("orgWebhooks.list","id",e.path.id)+"/webhooks",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async add(e){return s.send({op:"orgWebhooks.add",method:"POST",path:"/v1/orgs/"+i("orgWebhooks.add","id",e.path.id)+"/webhooks",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async remove(e){return s.send({op:"orgWebhooks.remove",method:"DELETE",path:"/v1/orgs/"+i("orgWebhooks.remove","id",e.path.id)+"/webhooks/"+i("orgWebhooks.remove","endpoint",e.path.endpoint),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})}},projects:{async mine(e){return s.send({op:"projects.mine",method:"GET",path:"/v1/projects",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e?.signal})},async environmentsMine(e){return s.send({op:"projects.environmentsMine",method:"GET",path:"/v1/environments",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e?.signal})},async list(e){return s.send({op:"projects.list",method:"GET",path:"/v1/orgs/"+i("projects.list","id",e.path.id)+"/projects",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async create(e){return s.send({op:"projects.create",method:"POST",path:"/v1/orgs/"+i("projects.create","id",e.path.id)+"/projects",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async get(e){return s.send({op:"projects.get",method:"GET",path:"/v1/projects/"+i("projects.get","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async remove(e){return s.send({op:"projects.remove",method:"DELETE",path:"/v1/projects/"+i("projects.remove","id",e.path.id),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async rename(e){return s.send({op:"projects.rename",method:"PATCH",path:"/v1/projects/"+i("projects.rename","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async addEnvironment(e){return s.send({op:"projects.addEnvironment",method:"POST",path:"/v1/projects/"+i("projects.addEnvironment","id",e.path.id)+"/environments",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async environment(e){return s.send({op:"projects.environment",method:"GET",path:"/v1/environments/"+i("projects.environment","ref",e.path.ref),auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async removeEnvironment(e){return s.send({op:"projects.removeEnvironment",method:"DELETE",path:"/v1/environments/"+i("projects.removeEnvironment","ref",e.path.ref),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,query:e.query,headers:e.headers,signal:e.signal})},async renameEnvironment(e){return s.send({op:"projects.renameEnvironment",method:"PATCH",path:"/v1/environments/"+i("projects.renameEnvironment","ref",e.path.ref),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async keys(e){return s.send({op:"projects.keys",method:"GET",path:"/v1/environments/"+i("projects.keys","ref",e.path.ref)+"/keys",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async usage(e){return s.send({op:"projects.usage",method:"GET",path:"/v1/environments/"+i("projects.usage","ref",e.path.ref)+"/usage",auth:[["PalbaseBearer"]],answers:{200:"json"},query:e.query,signal:e.signal})},async personalKey(e){return s.send({op:"projects.personalKey",method:"POST",path:"/v1/environments/"+i("projects.personalKey","ref",e.path.ref)+"/personal-key",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async revokePersonalKey(e){return s.send({op:"projects.revokePersonalKey",method:"DELETE",path:"/v1/environments/"+i("projects.revokePersonalKey","ref",e.path.ref)+"/personal-key/"+i("projects.revokePersonalKey","key",e.path.key),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async shareInstallation(e){return s.send({op:"projects.shareInstallation",method:"POST",path:"/v1/environments/"+i("projects.shareInstallation","ref",e.path.ref)+"/github/installations",auth:[["PalbaseBearer"]],answers:{},ownResponse:!0,idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}},apps:{async list(e){return s.send({op:"apps.list",method:"GET",path:"/v1/projects/"+i("apps.list","id",e.path.id)+"/apps",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async create(e){return s.send({op:"apps.create",method:"POST",path:"/v1/projects/"+i("apps.create","id",e.path.id)+"/apps",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async get(e){return s.send({op:"apps.get",method:"GET",path:"/v1/projects/"+i("apps.get","id",e.path.id)+"/apps/"+i("apps.get","app",e.path.app),auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async remove(e){return s.send({op:"apps.remove",method:"DELETE",path:"/v1/projects/"+i("apps.remove","id",e.path.id)+"/apps/"+i("apps.remove","app",e.path.app),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async update(e){return s.send({op:"apps.update",method:"PATCH",path:"/v1/projects/"+i("apps.update","id",e.path.id)+"/apps/"+i("apps.update","app",e.path.app),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async restore(e){return s.send({op:"apps.restore",method:"POST",path:"/v1/projects/"+i("apps.restore","id",e.path.id)+"/apps/"+i("apps.restore","app",e.path.app)+"/restore",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async setIn(e){return s.send({op:"apps.setIn",method:"PUT",path:"/v1/environments/"+i("apps.setIn","ref",e.path.ref)+"/apps/"+i("apps.setIn","app",e.path.app),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async removeFrom(e){return s.send({op:"apps.removeFrom",method:"DELETE",path:"/v1/environments/"+i("apps.removeFrom","ref",e.path.ref)+"/apps/"+i("apps.removeFrom","app",e.path.app),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async config(e){return s.send({op:"apps.config",method:"GET",path:"/v1/environments/"+i("apps.config","ref",e.path.ref)+"/apps/"+i("apps.config","app",e.path.app)+"/config",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})}},snippets:{async list(e){return s.send({op:"snippets.list",method:"GET",path:"/v1/environments/"+i("snippets.list","ref",e.path.ref)+"/snippets",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async create(e){return s.send({op:"snippets.create",method:"POST",path:"/v1/environments/"+i("snippets.create","ref",e.path.ref)+"/snippets",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async remove(e){return s.send({op:"snippets.remove",method:"DELETE",path:"/v1/environments/"+i("snippets.remove","ref",e.path.ref)+"/snippets/"+i("snippets.remove","id",e.path.id),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async change(e){return s.send({op:"snippets.change",method:"PATCH",path:"/v1/environments/"+i("snippets.change","ref",e.path.ref)+"/snippets/"+i("snippets.change","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}},chartViews:{async list(e){return s.send({op:"chartViews.list",method:"GET",path:"/v1/environments/"+i("chartViews.list","ref",e.path.ref)+"/chart-views",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async create(e){return s.send({op:"chartViews.create",method:"POST",path:"/v1/environments/"+i("chartViews.create","ref",e.path.ref)+"/chart-views",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async remove(e){return s.send({op:"chartViews.remove",method:"DELETE",path:"/v1/environments/"+i("chartViews.remove","ref",e.path.ref)+"/chart-views/"+i("chartViews.remove","id",e.path.id),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async change(e){return s.send({op:"chartViews.change",method:"PATCH",path:"/v1/environments/"+i("chartViews.change","ref",e.path.ref)+"/chart-views/"+i("chartViews.change","id",e.path.id),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}},webhooks:{async list(e){return s.send({op:"webhooks.list",method:"GET",path:"/v1/environments/"+i("webhooks.list","ref",e.path.ref)+"/webhooks",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async add(e){return s.send({op:"webhooks.add",method:"POST",path:"/v1/environments/"+i("webhooks.add","ref",e.path.ref)+"/webhooks",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async deliveries(e){return s.send({op:"webhooks.deliveries",method:"GET",path:"/v1/environments/"+i("webhooks.deliveries","ref",e.path.ref)+"/webhooks/deliveries",auth:[["PalbaseBearer"]],answers:{200:"json"},query:e.query,signal:e.signal})},async redeliver(e){return s.send({op:"webhooks.redeliver",method:"POST",path:"/v1/environments/"+i("webhooks.redeliver","ref",e.path.ref)+"/webhooks/deliveries/"+i("webhooks.redeliver","delivery",e.path.delivery)+"/redeliver",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async change(e){return s.send({op:"webhooks.change",method:"PUT",path:"/v1/environments/"+i("webhooks.change","ref",e.path.ref)+"/webhooks/"+i("webhooks.change","endpoint",e.path.endpoint),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async remove(e){return s.send({op:"webhooks.remove",method:"DELETE",path:"/v1/environments/"+i("webhooks.remove","ref",e.path.ref)+"/webhooks/"+i("webhooks.remove","endpoint",e.path.endpoint),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})}},environmentTokens:{async list(e){return s.send({op:"environmentTokens.list",method:"GET",path:"/v1/environments/"+i("environmentTokens.list","ref",e.path.ref)+"/tokens",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async mint(e){return s.send({op:"environmentTokens.mint",method:"POST",path:"/v1/environments/"+i("environmentTokens.mint","ref",e.path.ref)+"/tokens",auth:[["PalbaseBearer"],[]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async revoke(e){return s.send({op:"environmentTokens.revoke",method:"DELETE",path:"/v1/environments/"+i("environmentTokens.revoke","ref",e.path.ref)+"/tokens/"+i("environmentTokens.revoke","id",e.path.id),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})}},billing:{async bill(e){return s.send({op:"billing.bill",method:"GET",path:"/v1/orgs/"+i("billing.bill","id",e.path.id)+"/billing",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async confirm(e){return s.send({op:"billing.confirm",method:"POST",path:"/v1/orgs/"+i("billing.confirm","id",e.path.id)+"/billing/checkout/"+i("billing.confirm","session",e.path.session)+"/confirm",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async cards(e){return s.send({op:"billing.cards",method:"GET",path:"/v1/orgs/"+i("billing.cards","id",e.path.id)+"/billing/cards",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async defaultCard(e){return s.send({op:"billing.defaultCard",method:"PUT",path:"/v1/orgs/"+i("billing.defaultCard","id",e.path.id)+"/billing/cards/"+i("billing.defaultCard","card",e.path.card)+"/default",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async removeCard(e){return s.send({op:"billing.removeCard",method:"DELETE",path:"/v1/orgs/"+i("billing.removeCard","id",e.path.id)+"/billing/cards/"+i("billing.removeCard","card",e.path.card),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,signal:e.signal})},async customer(e){return s.send({op:"billing.customer",method:"GET",path:"/v1/orgs/"+i("billing.customer","id",e.path.id)+"/billing/customer",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async setCustomer(e){return s.send({op:"billing.setCustomer",method:"PUT",path:"/v1/orgs/"+i("billing.setCustomer","id",e.path.id)+"/billing/customer",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async charges(e){return s.send({op:"billing.charges",method:"GET",path:"/v1/orgs/"+i("billing.charges","id",e.path.id)+"/billing/charges",auth:[["PalbaseBearer"]],answers:{200:"json"},query:e.query,signal:e.signal})},async csv(e){return s.send({op:"billing.csv",method:"GET",path:"/v1/orgs/"+i("billing.csv","id",e.path.id)+"/billing/charges.csv",auth:[["PalbaseBearer"]],answers:{},ownResponse:!0,query:e.query,signal:e.signal})},async invoices(e){return s.send({op:"billing.invoices",method:"GET",path:"/v1/orgs/"+i("billing.invoices","id",e.path.id)+"/billing/invoices",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async payer(e){return s.send({op:"billing.payer",method:"PUT",path:"/v1/orgs/"+i("billing.payer","id",e.path.id)+"/billing/payer",auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async paid(e){return s.send({op:"billing.paid",method:"GET",path:"/v1/orgs/"+i("billing.paid","id",e.path.id)+"/billing/paid",auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async stopPaying(e){return s.send({op:"billing.stopPaying",method:"DELETE",path:"/v1/orgs/"+i("billing.stopPaying","id",e.path.id)+"/billing/paid/"+i("billing.stopPaying","org",e.path.org),auth:[["PalbaseBearer"]],answers:{204:"empty"},idempotent:!0,headers:e.headers,signal:e.signal})},async report(e){return s.send({op:"billing.report",method:"GET",path:"/v1/orgs/"+i("billing.report","id",e.path.id)+"/billing/report",auth:[["PalbaseBearer"]],answers:{200:"json"},query:e.query,signal:e.signal})},async reportCsv(e){return s.send({op:"billing.reportCsv",method:"GET",path:"/v1/orgs/"+i("billing.reportCsv","id",e.path.id)+"/billing/report.csv",auth:[["PalbaseBearer"]],answers:{},ownResponse:!0,query:e.query,signal:e.signal})},async project(e){return s.send({op:"billing.project",method:"GET",path:"/v1/orgs/"+i("billing.project","id",e.path.id)+"/billing/projects/"+i("billing.project","project",e.path.project),auth:[["PalbaseBearer"]],answers:{200:"json"},signal:e.signal})},async steer(e){return s.send({op:"billing.steer",method:"PATCH",path:"/v1/orgs/"+i("billing.steer","id",e.path.id)+"/billing/projects/"+i("billing.steer","project",e.path.project),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})},async freeze(e){return s.send({op:"billing.freeze",method:"PATCH",path:"/v1/orgs/"+i("billing.freeze","id",e.path.id)+"/billing/environments/"+i("billing.freeze","ref",e.path.ref),auth:[["PalbaseBearer"]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}},accessRequests:{async request(e){return s.send({op:"accessRequests.request",method:"POST",path:"/v1/access-requests",auth:[["PalbaseBearer"],[]],answers:{200:"json"},idempotent:!0,headers:e.headers,body:{kind:"json",contentType:"application/json",value:e.body},signal:e.signal})}},docs:{async search(e){return s.send({op:"docs.search",method:"GET",path:"/v1/docs/search",auth:[["PalbaseBearer"],[]],answers:{200:"json"},query:e.query,signal:e.signal})}}}}function N(s){let{mint:e,revoke:o}=s;return async r=>{let u=await e(r),c=r.body?.role,t=r.body?.on_behalf_of;if(c===void 0&&t===void 0)return u;let p=u.data,a=[];if(c!==void 0&&p.role!==c&&a.push(`role ${c} (it came back ${p.role==null?"at its minter's":p.role})`),t!==void 0&&p.on_behalf_of!==t.trim()&&a.push("on_behalf_of"),a.length===0)return u;let m;try{await o({path:{ref:r.path.ref,id:String(p.id)}})}catch(h){m=h}let n=`Studio minted the token without the ${a.join(" and ")} asked for \u2014 it is older than this SDK`;throw new P({op:"environmentTokens.mint",status:0,code:"token_role_not_kept",message:m===void 0?`environmentTokens.mint: ${n}; the token (${p.id}) was revoked at once and is not returned \u2014 mint it again once Studio is updated`:`environmentTokens.mint: ${n}, and revoking it failed (${m instanceof Error?m.message:String(m)}) \u2014 revoke token ${p.id} of environment ${r.path.ref} yourself, now`,cause:m})}}var S={pbo_:"an organization's",pbu_:"an account's",pbe_:"an environment's"},te=/^[A-Za-z0-9_-]*$/,$=64,f=44;function X(s){if(typeof s!="string"||s==="")return"token is missing: pass an access token, an organization's (pbo_\u2026), an account's (pbu_\u2026) or an environment's (pbe_\u2026)";let e=s.slice(0,4);if(!Object.hasOwn(S,e))return`token has the wrong prefix: an access token starts with pbo_ (an organization's), pbu_ (an account's) or pbe_ (an environment's)${/^pb_[a-z0-9]+_[cs]/.test(s)?" \u2014 a project key belongs in palbase/server or palbase/web":""}`;let o=s.slice(4);if(o.length!==$)return`token has the wrong length: ${S[e]} access token is ${e} and ${$} characters, this one has ${o.length} after it`;if(!te.test(o))return`token is not ${S[e]} access token: after ${e} come base64url characters alone (A\u2013Z, a\u2013z, 0\u20139, - and _)`;let r=re(o),u=(r[f]<<24|r[f+1]<<16|r[f+2]<<8|r[f+3])>>>0;if(ie(e,r.subarray(0,f))!==u)return"token's checksum does not match: it was mistyped or cut, or made before access tokens carried one \u2014 make a new token"}function se(s){return X(s)===void 0}function Y(s){let e=X(s);if(e!==void 0)throw new TypeError(e)}var ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function re(s){let e=new Uint8Array(s.length*6/8),o=0,r=0,u=0;for(let c of s)o=o<<6|ne.indexOf(c),r+=6,r>=8&&(r-=8,e[u++]=o>>r&255);return e}var Q=(()=>{let s=new Uint32Array(256);for(let e=0;e<256;e++){let o=e;for(let r=0;r<8;r++)o=o&1?3988292384^o>>>1:o>>>1;s[e]=o>>>0}return s})();function ie(s,e){let o=4294967295;for(let r=0;r<s.length;r++)o=Q[(o^s.charCodeAt(r))&255]^o>>>8;for(let r of e)o=Q[(o^r)&255]^o>>>8;return(o^4294967295)>>>0}var Z="palbase.studio",ae="palbase";function oe(){let s=globalThis;return typeof s.window<"u"||typeof s.document<"u"||typeof s.importScripts=="function"||F()}var C=class{domain;#e;#t=new Map;constructor(e){if(oe())throw new TypeError("palbase/cloud runs on a server: its access token opens the organization's projects, so it never goes into a browser, a web worker or a mobile app \u2014 keep it on your server, and have your app call that");Y(e?.token);let o=e.domain??Z;if(typeof o!="string"||!/^[a-z0-9-]+(\.[a-z0-9-]+)+$/.test(o))throw new TypeError(`domain ${JSON.stringify(o)} is not a domain`);this.domain=o;let r=e.token;this.#e=c=>z(k({baseUrl:c,credentials:{token:r},fetch:e.fetch,solveProofOfWork:!1}),e.retry??H);let u=J(this.#e(`https://palbase.app.${o}`));u.environmentTokens.mint=N(u.environmentTokens),Object.assign(this,u)}project(e){if(typeof e!="string"||!/^[a-z0-9]{1,63}$/.test(e))throw new TypeError(`${JSON.stringify(e)} is not an environment's ref`);let o=this.#t.get(e);return o||(o=q(this.#e(e===ae?`https://connect.${this.domain}`:`https://${e}.${this.domain}`)),this.#t.set(e,o)),o}};export{Z as DEFAULT_DOMAIN,C as PalbaseCloud,P as PalbaseError,se as tokenIsWellFormed};
|
package/dist/refuse/ai-sdk.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! palbase 0.
|
|
1
|
+
/*! palbase 0.76.0 — Palbase SDK License (see LICENSE) */
|
|
2
2
|
throw new Error("palbase/ai-sdk is for servers: it speaks with the project secret key, which never goes into a browser or a mobile app \u2014 call your backend, and let it ask the model");
|
package/dist/refuse/ai.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! palbase 0.
|
|
1
|
+
/*! palbase 0.76.0 — Palbase SDK License (see LICENSE) */
|
|
2
2
|
throw new Error("palbase/ai is for servers: it speaks with the project secret key, which never goes into a browser or a mobile app \u2014 call your backend, and let it ask the model");
|
package/dist/refuse/backend.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! palbase 0.
|
|
1
|
+
/*! palbase 0.76.0 — Palbase SDK License (see LICENSE) */
|
|
2
2
|
throw new Error("palbase/backend is a server framework: it runs on your backend, never in a browser or a mobile app \u2014 apps use palbase/web (or the native SDKs)");
|
package/dist/refuse/cloud.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! palbase 0.
|
|
1
|
+
/*! palbase 0.76.0 — Palbase SDK License (see LICENSE) */
|
|
2
2
|
throw new Error("palbase/cloud is for servers: its access token opens the organization's projects, so it belongs on your server and never in a browser or a mobile app \u2014 have your app call your server");
|
package/dist/refuse/server.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! palbase 0.
|
|
1
|
+
/*! palbase 0.76.0 — Palbase SDK License (see LICENSE) */
|
|
2
2
|
throw new Error("palbase/server is for servers: its secret key never goes into a browser or a mobile app \u2014 apps use palbase/web (or the native SDKs) with the publishable key");
|
package/dist/server/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! palbase 0.
|
|
2
|
-
import{A as E,B as F,C as G,D as H,E as I,F as J,G as K,a as e,b as f,c as g,d as h,e as i,f as j,g as k,h as l,i as m,j as n,k as o,l as p,m as q,n as r,o as s,p as t,q as u,r as v,s as w,t as x,u as y,v as z,w as A,x as B,y as C,z as D}from"../chunks/
|
|
1
|
+
/*! palbase 0.76.0 — Palbase SDK License (see LICENSE) */
|
|
2
|
+
import{A as E,B as F,C as G,D as H,E as I,F as J,G as K,a as e,b as f,c as g,d as h,e as i,f as j,g as k,h as l,i as m,j as n,k as o,l as p,m as q,n as r,o as s,p as t,q as u,r as v,s as w,t as x,u as y,v as z,w as A,x as B,y as C,z as D}from"../chunks/5RNXCTOO.js";import{a as c,b as d}from"../chunks/BRDO3ZPT.js";import"../chunks/KEGVHELA.js";import{t as b}from"../chunks/3VGWTVKI.js";import"../chunks/A3I7H7QN.js";import"../chunks/SVWF7ABJ.js";import{b as a}from"../chunks/UOW74IHY.js";import"../chunks/ISMWEEGW.js";import"../chunks/D6NOE76D.js";export{o as AuthUnavailable,b as EVENT_TYPES,c as FieldError,d as Fields,a as PalbaseError,t as ReservationSettled,n as TokenError,q as TokenVerifier,f as Transit,e as TransitRefusal,g as TransitRequest,x as WalletHoldSettled,i as WebhookSignatureError,D as createCommerceHookHandler,E as createDiscoveryRankHookHandler,h as createServer,F as isCampaignsEvent,A as isCommerceEvent,s as isEntitled,G as isJourneysEvent,z as isPaymentsEvent,B as isPromotionsEvent,v as isRetryableDecline,K as loadSecrets,H as pages,J as platformOwn,I as processOwn,r as requestAddress,p as sessionStanding,w as settleWalletHold,l as signatureHeader,C as verifyCommerceHookSignature,k as verifySignature,j as verifyWebhook,m as verifyWebhookRequest,u as withReservation,y as withWalletHold};
|
package/dist/server/testing.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! palbase 0.
|
|
2
|
-
import{a,b,c,d,e}from"../chunks/
|
|
1
|
+
/*! palbase 0.76.0 — Palbase SDK License (see LICENSE) */
|
|
2
|
+
import{a,b,c,d,e}from"../chunks/Q4UWBIJ6.js";import"../chunks/BRDO3ZPT.js";import"../chunks/ISMWEEGW.js";import"../chunks/D6NOE76D.js";export{b as TestApiError,e as api,c as createTestApi,a as testFields,d as testRun};
|