@pontive/server 1.25.0 → 1.26.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/{client-DWO-uz9e.js → client-BI4W1IJJ.js} +10 -6
- package/dist/client-BI4W1IJJ.js.map +1 -0
- package/dist/client-fmMA2Var.cjs +2 -0
- package/dist/client-fmMA2Var.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/management/generated/namespaces.d.cts +7 -3
- package/dist/management/generated/namespaces.d.ts +7 -3
- package/dist/management/generated/types.d.cts +25 -2
- package/dist/management/generated/types.d.ts +25 -2
- package/dist/management.cjs +1 -1
- package/dist/management.js +1 -1
- package/package.json +1 -1
- package/dist/client-D80_tH4S.cjs +0 -2
- package/dist/client-D80_tH4S.cjs.map +0 -1
- package/dist/client-DWO-uz9e.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("./client-D80_tH4S.cjs"),k=require("./keyless.cjs"),y=require("./management-credential--CmS8XaV.cjs"),D=require("jose"),me=10080*60;function te(e){const t=e.clientSecret?"server":"browser",n=["issuer","clientId"];t==="server"&&n.push("sessionSecret");for(const o of n)if(!e[o]){const c={issuer:"PONTIVE_ISSUER",clientId:"PONTIVE_CLIENT_ID",sessionSecret:"PONTIVE_SESSION_SECRET"}[o];throw new Error(`@pontive/server: ${o} is required${c?` (pass it, or set ${c})`:""}`)}if(t==="server"&&e.sessionSecret.length<32)throw new Error("@pontive/server: sessionSecret must be at least 32 characters");if(e.baseUrl)try{new URL(e.baseUrl)}catch{throw new Error(`@pontive/server: baseUrl "${e.baseUrl}" is not an absolute URL`)}return{mode:t,authPath:(e.authPath??"/__pontive").replace(/\/+$/,""),issuer:e.issuer.replace(/\/+$/,""),clientId:e.clientId,clientSecret:e.clientSecret||void 0,sessionSecret:e.sessionSecret??"",baseUrl:e.baseUrl?new URL(e.baseUrl).origin:void 0,scopes:e.scopes??"openid email profile offline_access",basePath:(e.basePath??"/api/auth").replace(/\/+$/,""),redirectUri:e.redirectUri,signInPath:e.signInPath??"/login",afterSignInPath:e.afterSignInPath??"/",prompt:e.prompt,cookieName:e.cookieName??"pontive_session",secureCookies:e.secureCookies,iframeSafe:e.iframeSafe??"auto",previewCallback:e.previewCallback??"auto",sessionMaxAgeSeconds:e.sessionMaxAgeSeconds??me,refreshSkewSeconds:e.refreshSkewSeconds??60,fetch:e.fetch??((...o)=>fetch(...o)),logger:e.logger??console}}const H=3500,j=16;function C(e){const t=new Map;if(!e)return t;for(const n of e.split(";")){const o=n.indexOf("=");if(o<0)continue;const c=n.slice(0,o).trim();!c||t.has(c)||t.set(c,n.slice(o+1).trim())}return t}function W(e){return[...e].map(([t,n])=>`${t}=${n}`).join("; ")}function N(e,t,n){const o=n.sameSite??"Lax",c=[`${e}=${t}`,"Path=/","HttpOnly",`SameSite=${o}`,`Max-Age=${n.maxAge}`];return(n.secure||o==="None")&&c.push("Secure"),c.join("; ")}function A(e,t){return t===0?e:`${e}.${t}`}function ve(e,t){const n=e.get(t);if(n===void 0)return null;let o=n;for(let c=1;c<j;c++){const a=e.get(A(t,c));if(a===void 0)break;o+=a}return o}function Se(e,t,n,o){const c=[],a=Math.max(1,Math.ceil(n.length/H));for(let i=0;i<a;i++){const l=n.slice(i*H,(i+1)*H);e.set(A(t,i),l),c.push(N(A(t,i),l,o))}for(let i=a;i<j;i++){const l=A(t,i);if(!e.has(l))break;e.delete(l),c.push(N(l,"",{...o,maxAge:0}))}return c}function K(e,t,n){const o=[];for(let c=0;c<j;c++){const a=A(t,c);if(!e.has(a)){if(c>0)break;continue}e.delete(a),o.push(N(a,"",{...n,maxAge:0}))}return o}const V="switch-organization",ne="organization_error",G=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):[];function re(e){const t=e.org_id;return typeof t!="string"||t===""?null:{id:t,roles:G(e.roles),permissions:G(e.permissions)}}function Ee(e){try{return D.decodeJwt(e)}catch{return{}}}function ye(e,t,n="/"){const o=new URLSearchParams({organization_id:t,returnTo:n});return`${e}/${V}?${o.toString()}`}const oe="__Host-pontive_access",se="__Secure-pontive_session_state";function ke(e){const t=n=>typeof e[n]=="string"?e[n]:void 0;return{id:t("sub")??"",email:t("email"),name:t("name")??t("email"),username:t("preferred_username"),picture:t("picture"),emailVerified:e.email_verified===!0}}function ge(e){const t={issuer:e.issuer,clientId:e.clientId},n=new Map;function o(i){for(const[l,d]of n)d.expiresAt<=i&&n.delete(l)}async function c(i,l){const d=Date.now();o(d);const u=await y.sha256Hex(i),h=n.get(u);if(h)return h.profile;const m=y.userInfo(t,e.fetch,i).catch(S=>(n.delete(u),e.logger.warn("[pontive] could not read the user's profile:",S instanceof Error?S.message:String(S)),null));return n.set(u,{expiresAt:l,profile:m}),m}async function a(i){const l=C(i).get(oe);if(!l)return null;let d;try{d=await y.verifyJwt(t,e.fetch,l)}catch(m){return m.code!=="ERR_JWT_EXPIRED"&&e.logger.warn("[pontive] access token cookie refused:",m instanceof Error?m.message:String(m)),null}const u=(d.exp??0)*1e3,h=await c(l,u);return{user:ke({...h,...d,sub:d.sub}),accessToken:l,expiresAt:u,sessionId:typeof d.sid=="string"?d.sid:void 0,organization:re(d),claims:d}}return{async handle(i){const l=new URL(i.url);if(l.pathname!==`${e.basePath}/${V}`)return null;const d=l.searchParams.get("organization_id"),u=_e(l.searchParams.get("returnTo"));if(!d)return B(u);const h=new URL(`${e.authPath}/oauth2/session`,l.origin);return h.searchParams.set("client_id",e.clientId),h.searchParams.set("return_to",u),h.searchParams.set("organization_id",d),B(h.pathname+h.search)},getSession:a,async refresh(i){const l=i.headers.get("cookie"),d=await a(l),u={session:d,setCookies:[],cookieHeader:l??""};if(d||!C(l).has(se))return u;const h=new URL(i.url),m=new URL(`${e.authPath}/oauth2/session`,h.origin);return m.searchParams.set("client_id",e.clientId),m.searchParams.set("return_to",h.pathname+h.search),{...u,handshake:m.pathname+m.search}}}}function _e(e){return e&&e.startsWith("/")&&!e.startsWith("//")&&!e.startsWith("/\\")?e:"/"}function B(e){return new Response(null,{status:302,headers:{location:e,"cache-control":"no-store"}})}const Pe=["lovable.app","lovableproject.com","lovable.dev","vusercontent.net","v0.dev","v0.app","webcontainer-api.io","webcontainer.io","replit.dev","replit.app","lp.dev","bolt.host","csb.app"];function Ie(e){const t=e.toLowerCase().replace(/\.$/,"");return Pe.some(n=>t===n||t.endsWith(`.${n}`))}const be={lovable:["*.lovableproject.com","*.lovable.app","*.lovable.dev"],v0:["*.vusercontent.net","*.lite.vusercontent.net","*.v0.app","*.v0.dev"],vercel:["*.vercel.app"],replit:["*.replit.dev","*.*.replit.dev","*.replit.app"],bolt:["*.bolt.host","*.webcontainer-api.io","*.local-credentialless.webcontainer-api.io","*.local-corp.webcontainer-api.io"],codesandbox:["*.csb.app"]},Te="/oauth2/preview-callback",Re="pontive:authorization-response",Ue=/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/;function Ce(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!=="https:"||t.port!==""||t.origin!==e)return null;const n=t.hostname.split(".");for(const[o,c]of Object.entries(be))for(const a of c){const i=a.split(".");if(i.length===n.length&&i.every((l,d)=>l==="*"?Ue.test(n[d]):l===n[d]))return o}return null}function Oe(e,t){return`${e.replace(/\/$/,"")}${Te}?origin=${encodeURIComponent(t)}`}const Ae=3e4;class Ne{constructor(t=Ae){this.recentMs=t}recentMs;inFlight=new Map;recent=new Map;async run(t,n){const o=await y.sha256Hex(t);this.sweep();const c=this.recent.get(o);if(c)return c.result;let a=this.inFlight.get(o);return a||(a=n().then(i=>(this.recent.set(o,{at:Date.now(),result:i}),i)).finally(()=>this.inFlight.delete(o)),this.inFlight.set(o,a)),a}sweep(){const t=Date.now()-this.recentMs;for(const[n,o]of this.recent)o.at<t&&this.recent.delete(n)}}const J=new Map;function ie(e){let t=J.get(e);return t||(t=crypto.subtle.digest("SHA-256",new TextEncoder().encode(e)).then(n=>new Uint8Array(n)),J.set(e,t)),t}async function Z(e,t,n){return new D.EncryptJWT(e).setProtectedHeader({alg:"dir",enc:"A256GCM"}).setIssuedAt().setExpirationTime(`${n}s`).encrypt(await ie(t))}async function X(e,t){try{const{payload:n}=await D.jwtDecrypt(e,await ie(t));return n}catch{return null}}const $e=900,Y=600;function Q(e,t){return e&&e.startsWith("/")&&!e.startsWith("//")&&!e.startsWith("/\\")?e:t}function T(e,t=[]){const n=new Headers({location:e,"cache-control":"no-store"});for(const o of t)n.append("set-cookie",o);return new Response(null,{status:302,headers:n})}const Le="pontive:popup-complete";function xe(e,t,n){const c=`<!doctype html><meta charset="utf-8"><title>Signing in</title><script type="application/json" id="pontive-popup">${JSON.stringify({message:{type:Le,url:e},origin:t}).replace(/</g,"\\u003c")}<\/script><script>(function(){var d=JSON.parse(document.getElementById("pontive-popup").textContent);var go=function(){window.location.replace(d.message.url)};if(window.opener&&window.opener!==window){try{window.opener.postMessage(d.message,d.origin)}catch(e){}window.close();setTimeout(go,1000)}else{go()}})()<\/script>`,a=new Headers({"content-type":"text/html; charset=utf-8","cache-control":"no-store","content-security-policy":"default-src 'none'; script-src 'unsafe-inline'","x-content-type-options":"nosniff"});for(const i of n)a.append("set-cookie",i);return new Response(c,{status:200,headers:a})}function Ve(e){const t=y.randomValue(),o=`<!doctype html><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Sign in</title><style>body{font-family:system-ui,sans-serif;margin:4rem auto;max-width:28rem;padding:0 1rem}</style><p>This preview signs in in a new window.</p><p><button id="go" type="button">Sign in</button></p><p id="status"></p><script type="application/json" id="pontive-preview-signin">${JSON.stringify({...e,type:Re}).replace(/</g,"\\u003c")}<\/script><script nonce="${t}">(function(){var d=JSON.parse(document.getElementById("pontive-preview-signin").textContent);var s=document.getElementById("status");var w=null;window.addEventListener("message",function(e){if(!w||e.source!==w||e.origin!==d.authOrigin)return;var m=e.data;if(!m||m.type!==d.type||!m.response||typeof m.response!=="object")return;var u=new URL(d.callbackUrl);["code","state","iss","error","error_description","error_uri"].forEach(function(k){var v=m.response[k];if(typeof v==="string")u.searchParams.set(k,v)});try{w.close()}catch(x){}if(u.origin===location.origin)location.replace(u.toString())});document.getElementById("go").addEventListener("click",function(){w=window.open(d.popupUrl,"pontive_signin_popup","popup=yes,width=500,height=680");s.textContent=w?"Finish signing in in the new window.":"The sign-in window was blocked. Allow popups for this site and try again."})})()<\/script>`;return new Response(o,{status:200,headers:{"content-type":"text/html; charset=utf-8","cache-control":"no-store","content-security-policy":`default-src 'none'; script-src 'nonce-${t}'; style-src 'unsafe-inline'; base-uri 'none'; form-action 'none'`,"x-content-type-options":"nosniff","referrer-policy":"no-referrer"}})}function I(e,t){if(e.baseUrl)return e.baseUrl;const n=t.headers.get("x-forwarded-host")?.split(",")[0]?.trim()||t.headers.get("host")?.trim();if(n){const o=t.headers.get("x-forwarded-proto")?.split(",")[0]?.trim()||new URL(t.url).protocol.replace(":","");try{return new URL(`${o}://${n}`).origin}catch{}}return new URL(t.url).origin}function Me(e){const t=o=>typeof e[o]=="string"?e[o]:void 0,n=t("name")??([t("given_name"),t("family_name")].filter(Boolean).join(" ")||void 0)??t("email");return{id:e.sub??"",email:t("email"),name:n,username:t("preferred_username"),picture:t("picture"),emailVerified:e.email_verified===!0}}function q(e){return Date.now()+(e.expires_in??$e)*1e3}function ae(e){return e.mode==="browser"?ge(e):He(e)}function He(e){const t={issuer:e.issuer,clientId:e.clientId,clientSecret:e.clientSecret},n=`${e.cookieName}_tx`,o=new Ne,c=r=>e.secureCookies??I(e,r).startsWith("https:"),a=r=>e.iframeSafe===!0||e.iframeSafe==="auto"&&Ie(new URL(I(e,r)).hostname),i=(r,s)=>a(r)?{maxAge:s,secure:!0,sameSite:"None"}:{maxAge:s,secure:c(r)},l=r=>e.previewCallback==="always"||e.previewCallback==="auto"&&Ce(I(e,r))!==null,d=r=>`${I(e,r)}${e.basePath}/callback`,u=r=>l(r)?Oe(e.issuer,I(e,r)):e.redirectUri??d(r),h=(r,s)=>{const p=new URL(e.signInPath,I(e,r));return s&&p.searchParams.set("error",s),p.toString()};async function m(r){const s=ve(r,e.cookieName);if(s===null)return null;const p=await X(s,e.sessionSecret);return p||e.logger.warn("[pontive] session cookie could not be read (sealed with another secret, or truncated)"),p}async function S(r,s,p){const f=await Z({...s},e.sessionSecret,e.sessionMaxAgeSeconds);return Se(r,e.cookieName,f,i(p,e.sessionMaxAgeSeconds))}function b(r){const{refreshToken:s,...p}=r,f=Ee(r.accessToken);return{...p,organization:re(f),claims:f}}async function O(r){const s=new URL(r.url),p=l(r),f=s.searchParams.get("popup")==="1";if(p&&!f){const v=new URL(`${e.basePath}/login`,I(e,r));return s.searchParams.forEach((g,U)=>v.searchParams.set(U,g)),v.searchParams.set("popup","1"),Ve({popupUrl:v.toString(),authOrigin:new URL(e.issuer).origin,callbackUrl:d(r)})}const E={state:y.randomValue(),verifier:y.randomValue(),nonce:y.randomValue(),returnTo:Q(s.searchParams.get("returnTo")??s.searchParams.get("next"),e.afterSignInPath),popup:f,redirectUri:u(r),previewCallback:p},w=await y.authorizationUrl(t,e.fetch,{redirectUri:E.redirectUri,scopes:e.scopes,state:E.state,nonce:E.nonce,codeChallenge:await y.pkceChallenge(E.verifier),prompt:e.prompt,organizationId:s.searchParams.get("organization_id")??void 0,loginHint:s.searchParams.get("login_hint")??void 0}),P=await Z({...E},e.sessionSecret,Y);return T(w,[N(n,P,i(r,Y))])}async function $(r){const s=new URL(r.url),p=C(r.headers.get("cookie")),f=[N(n,"",i(r,0))],E=p.get(n),w=E?await X(E,e.sessionSecret):null,P=s.searchParams.get("code"),v=_=>w?.popup&&!w.previewCallback?xe(_,I(e,r),f):T(_,f),g=s.searchParams.get("error");if(g)return v(h(r,g));if(!w||!P||s.searchParams.get("state")!==w.state)return v(h(r,"invalid_state"));const U=s.searchParams.get("iss");if(w.previewCallback&&U!==null&&U!==e.issuer)return v(h(r,"invalid_issuer"));try{const _=await y.exchangeCode(t,e.fetch,{code:P,codeVerifier:w.verifier,redirectUri:w.redirectUri??u(r)});if(!_.id_token)throw new Error("the token response carried no id_token; is the openid scope requested?");const M=await y.verifyIdToken(t,e.fetch,_.id_token,w.nonce),we={user:Me(M),accessToken:_.access_token,refreshToken:_.refresh_token,expiresAt:q(_),sessionId:typeof M.sid=="string"?M.sid:void 0};f.push(...await S(p,we,r))}catch(_){return e.logger.warn("[pontive] sign-in failed:",_ instanceof Error?_.message:String(_)),v(h(r,"exchange_failed"))}return v(new URL(w.returnTo,I(e,r)).toString())}async function L(r){const s=C(r.headers.get("cookie")),p=await m(s),f=K(s,e.cookieName,i(r,0));let E=h(r);try{E=await y.endSessionUrl(t,e.fetch,{postLogoutRedirectUri:h(r),sessionId:p?.sessionId})??E}catch(w){e.logger.warn("[pontive] could not reach the issuer to end its session:",w instanceof Error?w.message:String(w))}return T(E,f)}function F(r,s){return{...r,accessToken:s.access_token,refreshToken:s.refresh_token??r.refreshToken,expiresAt:q(s)}}async function de(r){const s=new URL(r.url),p=C(r.headers.get("cookie")),f=Q(s.searchParams.get("returnTo"),e.afterSignInPath),E=s.searchParams.get("organization_id"),w=g=>{const U=new URL(f,I(e,r));return g&&U.searchParams.set(ne,g),U.toString()},P=await m(p);if(!P?.refreshToken)return T(h(r));if(!E)return T(w("invalid_request"));let v;try{v=await y.refreshTokens(t,e.fetch,P.refreshToken,E)}catch(g){return g instanceof y.TokenEndpointError&&g.code==="invalid_request"?T(w("not_a_member")):(e.logger.warn("[pontive] organization switch failed:",g instanceof Error?g.message:String(g)),T(w("switch_failed")))}return T(w(),await S(p,F(P,v),r))}async function fe(r){try{const s=await y.refreshTokens(t,e.fetch,r.refreshToken);return F(r,s)}catch(s){if(s instanceof y.TokenEndpointError&&s.status>=400&&s.status<500)return e.logger.warn("[pontive] refresh refused; signing out:",s.message),null;throw s}}return{async handle(r){const{pathname:s}=new URL(r.url);if(!s.startsWith(`${e.basePath}/`))return null;const p=s.slice(e.basePath.length+1);return p==="login"&&r.method==="GET"?O(r):p==="callback"&&r.method==="GET"?$(r):p==="logout"&&(r.method==="GET"||r.method==="POST")?L(r):p===V&&(r.method==="GET"||r.method==="POST")?de(r):null},async getSession(r){const s=await m(C(r));return s?Date.now()>=s.expiresAt?(e.logger.warn("[pontive] the session's access token has expired and getSession cannot refresh it. Run the SDK's middleware on this path so it refreshes before the request is handled."),null):b(s):null},async refresh(r){const s=C(r.headers.get("cookie")),p=v=>({session:v,setCookies:[],cookieHeader:r.headers.get("cookie")??""}),f=await m(s);if(!f)return p(null);if(new URL(r.url).pathname.startsWith(`${e.basePath}/`))return p(Date.now()<f.expiresAt?b(f):null);if(Date.now()<f.expiresAt-e.refreshSkewSeconds*1e3)return p(b(f));const E=()=>({session:null,setCookies:K(s,e.cookieName,i(r,0)),cookieHeader:W(s)});if(!f.refreshToken)return E();let w;try{w=await o.run(f.refreshToken,()=>fe(f))}catch(v){return e.logger.warn("[pontive] refresh failed, will retry:",v instanceof Error?v.message:String(v)),p(Date.now()<f.expiresAt?b(f):null)}if(!w)return E();const P=await S(s,w,r);return{session:b(w),setCookies:P,cookieHeader:W(s)}}}}const ce="1.25.0",le="claim";function ze(e={},t={}){const n=R.processEnv(),o=R.withEnvFallback(e,n);if(R.keylessApplies(o,n))return De(o,t);const c=te(o),a=R.isDevelopment(n)?()=>he(ue(t),c.issuer):async()=>null;return pe(c,ae(c),a)}function ue(e){if(e.projectDir)return e.projectDir;const t=globalThis.process;if(typeof t?.cwd!="function")throw new k.KeylessUnavailableError("keyless mode needs a project directory (process.cwd)");return t.cwd()}async function he(e,t){try{const n=await k.readKeylessRecord(e);return n?.claim_token&&n.issuer.replace(/\/+$/,"")===t?n:null}catch{return null}}function x(e,t){return new Response(`${t}
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("./client-fmMA2Var.cjs"),k=require("./keyless.cjs"),y=require("./management-credential--CmS8XaV.cjs"),D=require("jose"),me=10080*60;function te(e){const t=e.clientSecret?"server":"browser",n=["issuer","clientId"];t==="server"&&n.push("sessionSecret");for(const o of n)if(!e[o]){const c={issuer:"PONTIVE_ISSUER",clientId:"PONTIVE_CLIENT_ID",sessionSecret:"PONTIVE_SESSION_SECRET"}[o];throw new Error(`@pontive/server: ${o} is required${c?` (pass it, or set ${c})`:""}`)}if(t==="server"&&e.sessionSecret.length<32)throw new Error("@pontive/server: sessionSecret must be at least 32 characters");if(e.baseUrl)try{new URL(e.baseUrl)}catch{throw new Error(`@pontive/server: baseUrl "${e.baseUrl}" is not an absolute URL`)}return{mode:t,authPath:(e.authPath??"/__pontive").replace(/\/+$/,""),issuer:e.issuer.replace(/\/+$/,""),clientId:e.clientId,clientSecret:e.clientSecret||void 0,sessionSecret:e.sessionSecret??"",baseUrl:e.baseUrl?new URL(e.baseUrl).origin:void 0,scopes:e.scopes??"openid email profile offline_access",basePath:(e.basePath??"/api/auth").replace(/\/+$/,""),redirectUri:e.redirectUri,signInPath:e.signInPath??"/login",afterSignInPath:e.afterSignInPath??"/",prompt:e.prompt,cookieName:e.cookieName??"pontive_session",secureCookies:e.secureCookies,iframeSafe:e.iframeSafe??"auto",previewCallback:e.previewCallback??"auto",sessionMaxAgeSeconds:e.sessionMaxAgeSeconds??me,refreshSkewSeconds:e.refreshSkewSeconds??60,fetch:e.fetch??((...o)=>fetch(...o)),logger:e.logger??console}}const H=3500,j=16;function C(e){const t=new Map;if(!e)return t;for(const n of e.split(";")){const o=n.indexOf("=");if(o<0)continue;const c=n.slice(0,o).trim();!c||t.has(c)||t.set(c,n.slice(o+1).trim())}return t}function W(e){return[...e].map(([t,n])=>`${t}=${n}`).join("; ")}function N(e,t,n){const o=n.sameSite??"Lax",c=[`${e}=${t}`,"Path=/","HttpOnly",`SameSite=${o}`,`Max-Age=${n.maxAge}`];return(n.secure||o==="None")&&c.push("Secure"),c.join("; ")}function A(e,t){return t===0?e:`${e}.${t}`}function ve(e,t){const n=e.get(t);if(n===void 0)return null;let o=n;for(let c=1;c<j;c++){const a=e.get(A(t,c));if(a===void 0)break;o+=a}return o}function Se(e,t,n,o){const c=[],a=Math.max(1,Math.ceil(n.length/H));for(let i=0;i<a;i++){const l=n.slice(i*H,(i+1)*H);e.set(A(t,i),l),c.push(N(A(t,i),l,o))}for(let i=a;i<j;i++){const l=A(t,i);if(!e.has(l))break;e.delete(l),c.push(N(l,"",{...o,maxAge:0}))}return c}function K(e,t,n){const o=[];for(let c=0;c<j;c++){const a=A(t,c);if(!e.has(a)){if(c>0)break;continue}e.delete(a),o.push(N(a,"",{...n,maxAge:0}))}return o}const V="switch-organization",ne="organization_error",G=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):[];function re(e){const t=e.org_id;return typeof t!="string"||t===""?null:{id:t,roles:G(e.roles),permissions:G(e.permissions)}}function Ee(e){try{return D.decodeJwt(e)}catch{return{}}}function ye(e,t,n="/"){const o=new URLSearchParams({organization_id:t,returnTo:n});return`${e}/${V}?${o.toString()}`}const oe="__Host-pontive_access",se="__Secure-pontive_session_state";function ke(e){const t=n=>typeof e[n]=="string"?e[n]:void 0;return{id:t("sub")??"",email:t("email"),name:t("name")??t("email"),username:t("preferred_username"),picture:t("picture"),emailVerified:e.email_verified===!0}}function ge(e){const t={issuer:e.issuer,clientId:e.clientId},n=new Map;function o(i){for(const[l,d]of n)d.expiresAt<=i&&n.delete(l)}async function c(i,l){const d=Date.now();o(d);const u=await y.sha256Hex(i),h=n.get(u);if(h)return h.profile;const m=y.userInfo(t,e.fetch,i).catch(S=>(n.delete(u),e.logger.warn("[pontive] could not read the user's profile:",S instanceof Error?S.message:String(S)),null));return n.set(u,{expiresAt:l,profile:m}),m}async function a(i){const l=C(i).get(oe);if(!l)return null;let d;try{d=await y.verifyJwt(t,e.fetch,l)}catch(m){return m.code!=="ERR_JWT_EXPIRED"&&e.logger.warn("[pontive] access token cookie refused:",m instanceof Error?m.message:String(m)),null}const u=(d.exp??0)*1e3,h=await c(l,u);return{user:ke({...h,...d,sub:d.sub}),accessToken:l,expiresAt:u,sessionId:typeof d.sid=="string"?d.sid:void 0,organization:re(d),claims:d}}return{async handle(i){const l=new URL(i.url);if(l.pathname!==`${e.basePath}/${V}`)return null;const d=l.searchParams.get("organization_id"),u=_e(l.searchParams.get("returnTo"));if(!d)return B(u);const h=new URL(`${e.authPath}/oauth2/session`,l.origin);return h.searchParams.set("client_id",e.clientId),h.searchParams.set("return_to",u),h.searchParams.set("organization_id",d),B(h.pathname+h.search)},getSession:a,async refresh(i){const l=i.headers.get("cookie"),d=await a(l),u={session:d,setCookies:[],cookieHeader:l??""};if(d||!C(l).has(se))return u;const h=new URL(i.url),m=new URL(`${e.authPath}/oauth2/session`,h.origin);return m.searchParams.set("client_id",e.clientId),m.searchParams.set("return_to",h.pathname+h.search),{...u,handshake:m.pathname+m.search}}}}function _e(e){return e&&e.startsWith("/")&&!e.startsWith("//")&&!e.startsWith("/\\")?e:"/"}function B(e){return new Response(null,{status:302,headers:{location:e,"cache-control":"no-store"}})}const Pe=["lovable.app","lovableproject.com","lovable.dev","vusercontent.net","v0.dev","v0.app","webcontainer-api.io","webcontainer.io","replit.dev","replit.app","lp.dev","bolt.host","csb.app"];function Ie(e){const t=e.toLowerCase().replace(/\.$/,"");return Pe.some(n=>t===n||t.endsWith(`.${n}`))}const be={lovable:["*.lovableproject.com","*.lovable.app","*.lovable.dev"],v0:["*.vusercontent.net","*.lite.vusercontent.net","*.v0.app","*.v0.dev"],vercel:["*.vercel.app"],replit:["*.replit.dev","*.*.replit.dev","*.replit.app"],bolt:["*.bolt.host","*.webcontainer-api.io","*.local-credentialless.webcontainer-api.io","*.local-corp.webcontainer-api.io"],codesandbox:["*.csb.app"]},Te="/oauth2/preview-callback",Re="pontive:authorization-response",Ue=/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/;function Ce(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!=="https:"||t.port!==""||t.origin!==e)return null;const n=t.hostname.split(".");for(const[o,c]of Object.entries(be))for(const a of c){const i=a.split(".");if(i.length===n.length&&i.every((l,d)=>l==="*"?Ue.test(n[d]):l===n[d]))return o}return null}function Oe(e,t){return`${e.replace(/\/$/,"")}${Te}?origin=${encodeURIComponent(t)}`}const Ae=3e4;class Ne{constructor(t=Ae){this.recentMs=t}recentMs;inFlight=new Map;recent=new Map;async run(t,n){const o=await y.sha256Hex(t);this.sweep();const c=this.recent.get(o);if(c)return c.result;let a=this.inFlight.get(o);return a||(a=n().then(i=>(this.recent.set(o,{at:Date.now(),result:i}),i)).finally(()=>this.inFlight.delete(o)),this.inFlight.set(o,a)),a}sweep(){const t=Date.now()-this.recentMs;for(const[n,o]of this.recent)o.at<t&&this.recent.delete(n)}}const J=new Map;function ie(e){let t=J.get(e);return t||(t=crypto.subtle.digest("SHA-256",new TextEncoder().encode(e)).then(n=>new Uint8Array(n)),J.set(e,t)),t}async function Z(e,t,n){return new D.EncryptJWT(e).setProtectedHeader({alg:"dir",enc:"A256GCM"}).setIssuedAt().setExpirationTime(`${n}s`).encrypt(await ie(t))}async function X(e,t){try{const{payload:n}=await D.jwtDecrypt(e,await ie(t));return n}catch{return null}}const $e=900,Y=600;function Q(e,t){return e&&e.startsWith("/")&&!e.startsWith("//")&&!e.startsWith("/\\")?e:t}function T(e,t=[]){const n=new Headers({location:e,"cache-control":"no-store"});for(const o of t)n.append("set-cookie",o);return new Response(null,{status:302,headers:n})}const Le="pontive:popup-complete";function xe(e,t,n){const c=`<!doctype html><meta charset="utf-8"><title>Signing in</title><script type="application/json" id="pontive-popup">${JSON.stringify({message:{type:Le,url:e},origin:t}).replace(/</g,"\\u003c")}<\/script><script>(function(){var d=JSON.parse(document.getElementById("pontive-popup").textContent);var go=function(){window.location.replace(d.message.url)};if(window.opener&&window.opener!==window){try{window.opener.postMessage(d.message,d.origin)}catch(e){}window.close();setTimeout(go,1000)}else{go()}})()<\/script>`,a=new Headers({"content-type":"text/html; charset=utf-8","cache-control":"no-store","content-security-policy":"default-src 'none'; script-src 'unsafe-inline'","x-content-type-options":"nosniff"});for(const i of n)a.append("set-cookie",i);return new Response(c,{status:200,headers:a})}function Ve(e){const t=y.randomValue(),o=`<!doctype html><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Sign in</title><style>body{font-family:system-ui,sans-serif;margin:4rem auto;max-width:28rem;padding:0 1rem}</style><p>This preview signs in in a new window.</p><p><button id="go" type="button">Sign in</button></p><p id="status"></p><script type="application/json" id="pontive-preview-signin">${JSON.stringify({...e,type:Re}).replace(/</g,"\\u003c")}<\/script><script nonce="${t}">(function(){var d=JSON.parse(document.getElementById("pontive-preview-signin").textContent);var s=document.getElementById("status");var w=null;window.addEventListener("message",function(e){if(!w||e.source!==w||e.origin!==d.authOrigin)return;var m=e.data;if(!m||m.type!==d.type||!m.response||typeof m.response!=="object")return;var u=new URL(d.callbackUrl);["code","state","iss","error","error_description","error_uri"].forEach(function(k){var v=m.response[k];if(typeof v==="string")u.searchParams.set(k,v)});try{w.close()}catch(x){}if(u.origin===location.origin)location.replace(u.toString())});document.getElementById("go").addEventListener("click",function(){w=window.open(d.popupUrl,"pontive_signin_popup","popup=yes,width=500,height=680");s.textContent=w?"Finish signing in in the new window.":"The sign-in window was blocked. Allow popups for this site and try again."})})()<\/script>`;return new Response(o,{status:200,headers:{"content-type":"text/html; charset=utf-8","cache-control":"no-store","content-security-policy":`default-src 'none'; script-src 'nonce-${t}'; style-src 'unsafe-inline'; base-uri 'none'; form-action 'none'`,"x-content-type-options":"nosniff","referrer-policy":"no-referrer"}})}function I(e,t){if(e.baseUrl)return e.baseUrl;const n=t.headers.get("x-forwarded-host")?.split(",")[0]?.trim()||t.headers.get("host")?.trim();if(n){const o=t.headers.get("x-forwarded-proto")?.split(",")[0]?.trim()||new URL(t.url).protocol.replace(":","");try{return new URL(`${o}://${n}`).origin}catch{}}return new URL(t.url).origin}function Me(e){const t=o=>typeof e[o]=="string"?e[o]:void 0,n=t("name")??([t("given_name"),t("family_name")].filter(Boolean).join(" ")||void 0)??t("email");return{id:e.sub??"",email:t("email"),name:n,username:t("preferred_username"),picture:t("picture"),emailVerified:e.email_verified===!0}}function q(e){return Date.now()+(e.expires_in??$e)*1e3}function ae(e){return e.mode==="browser"?ge(e):He(e)}function He(e){const t={issuer:e.issuer,clientId:e.clientId,clientSecret:e.clientSecret},n=`${e.cookieName}_tx`,o=new Ne,c=r=>e.secureCookies??I(e,r).startsWith("https:"),a=r=>e.iframeSafe===!0||e.iframeSafe==="auto"&&Ie(new URL(I(e,r)).hostname),i=(r,s)=>a(r)?{maxAge:s,secure:!0,sameSite:"None"}:{maxAge:s,secure:c(r)},l=r=>e.previewCallback==="always"||e.previewCallback==="auto"&&Ce(I(e,r))!==null,d=r=>`${I(e,r)}${e.basePath}/callback`,u=r=>l(r)?Oe(e.issuer,I(e,r)):e.redirectUri??d(r),h=(r,s)=>{const p=new URL(e.signInPath,I(e,r));return s&&p.searchParams.set("error",s),p.toString()};async function m(r){const s=ve(r,e.cookieName);if(s===null)return null;const p=await X(s,e.sessionSecret);return p||e.logger.warn("[pontive] session cookie could not be read (sealed with another secret, or truncated)"),p}async function S(r,s,p){const f=await Z({...s},e.sessionSecret,e.sessionMaxAgeSeconds);return Se(r,e.cookieName,f,i(p,e.sessionMaxAgeSeconds))}function b(r){const{refreshToken:s,...p}=r,f=Ee(r.accessToken);return{...p,organization:re(f),claims:f}}async function O(r){const s=new URL(r.url),p=l(r),f=s.searchParams.get("popup")==="1";if(p&&!f){const v=new URL(`${e.basePath}/login`,I(e,r));return s.searchParams.forEach((g,U)=>v.searchParams.set(U,g)),v.searchParams.set("popup","1"),Ve({popupUrl:v.toString(),authOrigin:new URL(e.issuer).origin,callbackUrl:d(r)})}const E={state:y.randomValue(),verifier:y.randomValue(),nonce:y.randomValue(),returnTo:Q(s.searchParams.get("returnTo")??s.searchParams.get("next"),e.afterSignInPath),popup:f,redirectUri:u(r),previewCallback:p},w=await y.authorizationUrl(t,e.fetch,{redirectUri:E.redirectUri,scopes:e.scopes,state:E.state,nonce:E.nonce,codeChallenge:await y.pkceChallenge(E.verifier),prompt:e.prompt,organizationId:s.searchParams.get("organization_id")??void 0,loginHint:s.searchParams.get("login_hint")??void 0}),P=await Z({...E},e.sessionSecret,Y);return T(w,[N(n,P,i(r,Y))])}async function $(r){const s=new URL(r.url),p=C(r.headers.get("cookie")),f=[N(n,"",i(r,0))],E=p.get(n),w=E?await X(E,e.sessionSecret):null,P=s.searchParams.get("code"),v=_=>w?.popup&&!w.previewCallback?xe(_,I(e,r),f):T(_,f),g=s.searchParams.get("error");if(g)return v(h(r,g));if(!w||!P||s.searchParams.get("state")!==w.state)return v(h(r,"invalid_state"));const U=s.searchParams.get("iss");if(w.previewCallback&&U!==null&&U!==e.issuer)return v(h(r,"invalid_issuer"));try{const _=await y.exchangeCode(t,e.fetch,{code:P,codeVerifier:w.verifier,redirectUri:w.redirectUri??u(r)});if(!_.id_token)throw new Error("the token response carried no id_token; is the openid scope requested?");const M=await y.verifyIdToken(t,e.fetch,_.id_token,w.nonce),we={user:Me(M),accessToken:_.access_token,refreshToken:_.refresh_token,expiresAt:q(_),sessionId:typeof M.sid=="string"?M.sid:void 0};f.push(...await S(p,we,r))}catch(_){return e.logger.warn("[pontive] sign-in failed:",_ instanceof Error?_.message:String(_)),v(h(r,"exchange_failed"))}return v(new URL(w.returnTo,I(e,r)).toString())}async function L(r){const s=C(r.headers.get("cookie")),p=await m(s),f=K(s,e.cookieName,i(r,0));let E=h(r);try{E=await y.endSessionUrl(t,e.fetch,{postLogoutRedirectUri:h(r),sessionId:p?.sessionId})??E}catch(w){e.logger.warn("[pontive] could not reach the issuer to end its session:",w instanceof Error?w.message:String(w))}return T(E,f)}function F(r,s){return{...r,accessToken:s.access_token,refreshToken:s.refresh_token??r.refreshToken,expiresAt:q(s)}}async function de(r){const s=new URL(r.url),p=C(r.headers.get("cookie")),f=Q(s.searchParams.get("returnTo"),e.afterSignInPath),E=s.searchParams.get("organization_id"),w=g=>{const U=new URL(f,I(e,r));return g&&U.searchParams.set(ne,g),U.toString()},P=await m(p);if(!P?.refreshToken)return T(h(r));if(!E)return T(w("invalid_request"));let v;try{v=await y.refreshTokens(t,e.fetch,P.refreshToken,E)}catch(g){return g instanceof y.TokenEndpointError&&g.code==="invalid_request"?T(w("not_a_member")):(e.logger.warn("[pontive] organization switch failed:",g instanceof Error?g.message:String(g)),T(w("switch_failed")))}return T(w(),await S(p,F(P,v),r))}async function fe(r){try{const s=await y.refreshTokens(t,e.fetch,r.refreshToken);return F(r,s)}catch(s){if(s instanceof y.TokenEndpointError&&s.status>=400&&s.status<500)return e.logger.warn("[pontive] refresh refused; signing out:",s.message),null;throw s}}return{async handle(r){const{pathname:s}=new URL(r.url);if(!s.startsWith(`${e.basePath}/`))return null;const p=s.slice(e.basePath.length+1);return p==="login"&&r.method==="GET"?O(r):p==="callback"&&r.method==="GET"?$(r):p==="logout"&&(r.method==="GET"||r.method==="POST")?L(r):p===V&&(r.method==="GET"||r.method==="POST")?de(r):null},async getSession(r){const s=await m(C(r));return s?Date.now()>=s.expiresAt?(e.logger.warn("[pontive] the session's access token has expired and getSession cannot refresh it. Run the SDK's middleware on this path so it refreshes before the request is handled."),null):b(s):null},async refresh(r){const s=C(r.headers.get("cookie")),p=v=>({session:v,setCookies:[],cookieHeader:r.headers.get("cookie")??""}),f=await m(s);if(!f)return p(null);if(new URL(r.url).pathname.startsWith(`${e.basePath}/`))return p(Date.now()<f.expiresAt?b(f):null);if(Date.now()<f.expiresAt-e.refreshSkewSeconds*1e3)return p(b(f));const E=()=>({session:null,setCookies:K(s,e.cookieName,i(r,0)),cookieHeader:W(s)});if(!f.refreshToken)return E();let w;try{w=await o.run(f.refreshToken,()=>fe(f))}catch(v){return e.logger.warn("[pontive] refresh failed, will retry:",v instanceof Error?v.message:String(v)),p(Date.now()<f.expiresAt?b(f):null)}if(!w)return E();const P=await S(s,w,r);return{session:b(w),setCookies:P,cookieHeader:W(s)}}}}const ce="1.26.0",le="claim";function ze(e={},t={}){const n=R.processEnv(),o=R.withEnvFallback(e,n);if(R.keylessApplies(o,n))return De(o,t);const c=te(o),a=R.isDevelopment(n)?()=>he(ue(t),c.issuer):async()=>null;return pe(c,ae(c),a)}function ue(e){if(e.projectDir)return e.projectDir;const t=globalThis.process;if(typeof t?.cwd!="function")throw new k.KeylessUnavailableError("keyless mode needs a project directory (process.cwd)");return t.cwd()}async function he(e,t){try{const n=await k.readKeylessRecord(e);return n?.claim_token&&n.issuer.replace(/\/+$/,"")===t?n:null}catch{return null}}function x(e,t){return new Response(`${t}
|
|
2
2
|
`,{status:e,headers:{"content-type":"text/plain; charset=utf-8","cache-control":"no-store"}})}function pe(e,t,n){const o=`${e.basePath}/${le}`;async function c(a){try{const i=await k.claimLinkFor(a,{fetch:e.fetch});return new Response(null,{status:302,headers:{location:i.url,"cache-control":"no-store","referrer-policy":"no-referrer"}})}catch(i){return i instanceof k.PontiveApiError&&i.status===409?x(409,"This Pontive instance has already been claimed. Nothing in your app changes; manage it in the Pontive dashboard."):i instanceof k.PontiveApiError&&i.status===404?x(410,k.goneMessage(a,"expired")):(e.logger.warn("[pontive] could not create a claim link:",i instanceof Error?i.message:String(i)),x(502,"Pontive could not create a claim link just now. Try again, or run `npx pontive claim`."))}}return{async handle(a){if(a.method==="GET"&&new URL(a.url).pathname===o){const i=await n();if(i)return c(i)}return t.handle(a)},getSession:a=>t.getSession(a),refresh:a=>t.refresh(a),async providerProps(){const a=await n();return{appId:e.clientId,domain:e.mode==="browser"?e.authPath:e.issuer,...a?{claimUrl:o}:{}}}}}const z=new Map,ee=new Set;function De(e,t){const n=e.logger??console;let o,c,a=!1;async function i(){const u=ue(t),h=(e.basePath??"/api/auth").replace(/\/+$/,"");let m=z.get(u);m||(m=k.ensureKeylessInstance({dir:u,redirectUris:e.redirectUri?[e.redirectUri]:k.loopbackCallbacks(h),client:{name:t.clientName??"@pontive/server",version:ce},fetch:e.fetch}),z.set(u,m),m.catch(()=>z.delete(u)));const S=await m;ee.has(u)||(ee.add(u),n.warn(`
|
|
3
3
|
${k.keylessMessage(S.record,{created:S.created})}
|
|
4
4
|
`));const b=globalThis.process;if(b?.env)for(const[$,L]of Object.entries(S.env))L!==void 0&&!b.env[$]&&(b.env[$]=L);if(!e.clientSecret&&!S.env.PONTIVE_CLIENT_SECRET)throw new Error(`@pontive/server: ${k.KEYLESS_FILE} names ${S.record.instance_id}, but PONTIVE_CLIENT_SECRET is neither in ${k.ENV_FILE} nor in the environment. Put it back, or run \`npx pontive init --reset\`.`);const O=te({...e,issuer:e.issuer||S.env.PONTIVE_ISSUER,clientId:e.clientId||S.env.PONTIVE_CLIENT_ID,clientSecret:e.clientSecret||S.env.PONTIVE_CLIENT_SECRET,sessionSecret:e.sessionSecret||S.env.PONTIVE_SESSION_SECRET,fetch:je(e.fetch,S.record,n)});return pe(O,ae(O),()=>he(u,O.issuer))}function l(){return c?Promise.reject(c):(o??=i().catch(u=>{throw o=void 0,u instanceof k.KeylessInstanceGoneError&&(c=u),u}),o)}function d(u){return u instanceof k.KeylessUnavailableError?(a||(a=!0,n.warn(`[pontive] ${u.message}. Requests here proceed without a session until the dev server restarts with the PONTIVE_* variables keyless mode wrote to .env.local.`)),!0):!1}return{async handle(u){try{return await(await l()).handle(u)}catch(h){if(d(h))return x(503,"Pontive keyless mode can't run in this runtime; restart the dev server.");throw h}},async getSession(u){try{return await(await l()).getSession(u)}catch(h){if(d(h))return null;throw h}},async refresh(u){try{return await(await l()).refresh(u)}catch(h){if(d(h))return{session:null,setCookies:[],cookieHeader:u.headers.get("cookie")??""};throw h}},async providerProps(){return(await l()).providerProps()}}}function je(e,t,n){const o=e??((...a)=>fetch(...a));let c=!1;return async(a,i)=>{const l=await o(a,i);return l.status===401&&!c&&(typeof a=="string"?a:a instanceof URL?a.toString():a.url).startsWith(t.issuer)&&(c=!0,n.warn(`[pontive] ${k.goneMessage(t,"refused")}`)),l}}exports.PONTIVE_ENV=R.PONTIVE_ENV;exports.Pontive=R.Pontive;exports.PontiveAPIError=R.PontiveAPIError;exports.PontiveConnectionError=R.PontiveConnectionError;exports.ACCESS_COOKIE=oe;exports.CLAIM_ROUTE=le;exports.ORGANIZATION_ERROR_PARAM=ne;exports.PONTIVE_SERVER_VERSION=ce;exports.SESSION_HINT_COOKIE=se;exports.SWITCH_ORGANIZATION_ROUTE=V;exports.createServerAuth=ze;exports.switchOrganizationPath=ye;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as fe, w as we, k as me, i as ve } from "./client-
|
|
2
|
-
import { h as yt, d as gt, e as Et, f as _t } from "./client-
|
|
1
|
+
import { p as fe, w as we, k as me, i as ve } from "./client-BI4W1IJJ.js";
|
|
2
|
+
import { h as yt, d as gt, e as Et, f as _t } from "./client-BI4W1IJJ.js";
|
|
3
3
|
import { readKeylessRecord as Se, KeylessUnavailableError as te, claimLinkFor as ke, PontiveApiError as D, goneMessage as ne, ensureKeylessInstance as ye, loopbackCallbacks as ge, keylessMessage as Ee, KEYLESS_FILE as _e, ENV_FILE as Pe, KeylessInstanceGoneError as be } from "./keyless.js";
|
|
4
4
|
import { v as Ie, s as re, u as Te, r as F, T as j, e as $, f as Re, p as Ue, g as Ce, h as Ae, i as Ne } from "./management-credential-CynS93TR.js";
|
|
5
5
|
import { decodeJwt as $e, jwtDecrypt as Oe, EncryptJWT as Le } from "jose";
|
|
@@ -516,7 +516,7 @@ function at(e) {
|
|
|
516
516
|
}
|
|
517
517
|
};
|
|
518
518
|
}
|
|
519
|
-
const ct = "1.
|
|
519
|
+
const ct = "1.26.0", lt = "claim";
|
|
520
520
|
function vt(e = {}, t = {}) {
|
|
521
521
|
const n = fe(), s = we(e, n);
|
|
522
522
|
if (me(s, n)) return ut(s, t);
|
|
@@ -1811,11 +1811,13 @@ export declare class BillingCurrencies {
|
|
|
1811
1811
|
* billing.catalog.v1.CurrencyService/ListCurrencies (32-billing-overview.md, API Surface, Currencies).
|
|
1812
1812
|
* Every currency billing accepts, sorted by code: its upper-case ISO 4217 code, English name, minor
|
|
1813
1813
|
* units (exponent), whether Stripe can charge it (chargeable) and Stripe's minimum charge, or null.
|
|
1814
|
-
* chargeable=true lists only the chargeable ones.
|
|
1814
|
+
* chargeable=true lists only the chargeable ones. Paged like every list.
|
|
1815
1815
|
*
|
|
1816
1816
|
* `GET /v1/billing/currencies` (ListCurrencies)
|
|
1817
|
+
*
|
|
1818
|
+
* Await it for the first page, or iterate it with `for await` for every item across pages.
|
|
1817
1819
|
*/
|
|
1818
|
-
list(params?: T.ListCurrenciesParams, options?: RequestOptions):
|
|
1820
|
+
list(params?: T.ListCurrenciesParams, options?: RequestOptions): PagePromise<T.Currency, T.CurrencyList>;
|
|
1819
1821
|
}
|
|
1820
1822
|
/**
|
|
1821
1823
|
* The `billing.customers` operations.
|
|
@@ -3653,8 +3655,10 @@ export declare class MeBilling {
|
|
|
3653
3655
|
* audience, https://{auth domain}/me/, with pontive:billing:read (D31, D48).
|
|
3654
3656
|
*
|
|
3655
3657
|
* `GET /v1/me/billing/customers` (ListMyCustomers)
|
|
3658
|
+
*
|
|
3659
|
+
* Await it for the first page, or iterate it with `for await` for every item across pages.
|
|
3656
3660
|
*/
|
|
3657
|
-
listCustomers(options?: RequestOptions):
|
|
3661
|
+
listCustomers(params?: T.ListMyCustomersParams, options?: RequestOptions): PagePromise<T.MyCustomer, T.MyCustomerList>;
|
|
3658
3662
|
/**
|
|
3659
3663
|
* billing.invoice.v1.MeInvoiceService/ListMyInvoices (37-invoicing.md, API Surface). An instance
|
|
3660
3664
|
* user's token must be issued for the instance's me audience, https://{auth domain}/me/, with
|
|
@@ -1811,11 +1811,13 @@ export declare class BillingCurrencies {
|
|
|
1811
1811
|
* billing.catalog.v1.CurrencyService/ListCurrencies (32-billing-overview.md, API Surface, Currencies).
|
|
1812
1812
|
* Every currency billing accepts, sorted by code: its upper-case ISO 4217 code, English name, minor
|
|
1813
1813
|
* units (exponent), whether Stripe can charge it (chargeable) and Stripe's minimum charge, or null.
|
|
1814
|
-
* chargeable=true lists only the chargeable ones.
|
|
1814
|
+
* chargeable=true lists only the chargeable ones. Paged like every list.
|
|
1815
1815
|
*
|
|
1816
1816
|
* `GET /v1/billing/currencies` (ListCurrencies)
|
|
1817
|
+
*
|
|
1818
|
+
* Await it for the first page, or iterate it with `for await` for every item across pages.
|
|
1817
1819
|
*/
|
|
1818
|
-
list(params?: T.ListCurrenciesParams, options?: RequestOptions):
|
|
1820
|
+
list(params?: T.ListCurrenciesParams, options?: RequestOptions): PagePromise<T.Currency, T.CurrencyList>;
|
|
1819
1821
|
}
|
|
1820
1822
|
/**
|
|
1821
1823
|
* The `billing.customers` operations.
|
|
@@ -3653,8 +3655,10 @@ export declare class MeBilling {
|
|
|
3653
3655
|
* audience, https://{auth domain}/me/, with pontive:billing:read (D31, D48).
|
|
3654
3656
|
*
|
|
3655
3657
|
* `GET /v1/me/billing/customers` (ListMyCustomers)
|
|
3658
|
+
*
|
|
3659
|
+
* Await it for the first page, or iterate it with `for await` for every item across pages.
|
|
3656
3660
|
*/
|
|
3657
|
-
listCustomers(options?: RequestOptions):
|
|
3661
|
+
listCustomers(params?: T.ListMyCustomersParams, options?: RequestOptions): PagePromise<T.MyCustomer, T.MyCustomerList>;
|
|
3658
3662
|
/**
|
|
3659
3663
|
* billing.invoice.v1.MeInvoiceService/ListMyInvoices (37-invoicing.md, API Surface). An instance
|
|
3660
3664
|
* user's token must be issued for the instance's me audience, https://{auth domain}/me/, with
|
|
@@ -3309,9 +3309,10 @@ export interface Currency {
|
|
|
3309
3309
|
name: string;
|
|
3310
3310
|
object: "currency";
|
|
3311
3311
|
}
|
|
3312
|
-
export interface
|
|
3312
|
+
export interface CurrencyList {
|
|
3313
3313
|
data: Currency[];
|
|
3314
3314
|
object: "list";
|
|
3315
|
+
pagination: Pagination;
|
|
3315
3316
|
}
|
|
3316
3317
|
export interface CurrentUser {
|
|
3317
3318
|
address?: Address;
|
|
@@ -6577,9 +6578,10 @@ export interface MyCustomer {
|
|
|
6577
6578
|
status: string;
|
|
6578
6579
|
subject: MySubject;
|
|
6579
6580
|
}
|
|
6580
|
-
export interface
|
|
6581
|
+
export interface MyCustomerList {
|
|
6581
6582
|
data: MyCustomer[];
|
|
6582
6583
|
object: "list";
|
|
6584
|
+
pagination: Pagination;
|
|
6583
6585
|
}
|
|
6584
6586
|
/**
|
|
6585
6587
|
* MyPackageRef is the package in force, with its name.
|
|
@@ -12454,6 +12456,14 @@ export interface ListCurrenciesParams {
|
|
|
12454
12456
|
* Only the currencies Stripe can charge
|
|
12455
12457
|
*/
|
|
12456
12458
|
chargeable?: boolean;
|
|
12459
|
+
/**
|
|
12460
|
+
* Page number, from 1
|
|
12461
|
+
*/
|
|
12462
|
+
page?: number;
|
|
12463
|
+
/**
|
|
12464
|
+
* Items per page, 1 to 100, default 25
|
|
12465
|
+
*/
|
|
12466
|
+
limit?: number;
|
|
12457
12467
|
}
|
|
12458
12468
|
/**
|
|
12459
12469
|
* The parameters of `ListCustomers`.
|
|
@@ -13628,6 +13638,19 @@ export interface UpdateMyCustomerParams {
|
|
|
13628
13638
|
*/
|
|
13629
13639
|
subject_id?: string;
|
|
13630
13640
|
}
|
|
13641
|
+
/**
|
|
13642
|
+
* The parameters of `ListMyCustomers`.
|
|
13643
|
+
*/
|
|
13644
|
+
export interface ListMyCustomersParams {
|
|
13645
|
+
/**
|
|
13646
|
+
* Page number, from 1
|
|
13647
|
+
*/
|
|
13648
|
+
page?: number;
|
|
13649
|
+
/**
|
|
13650
|
+
* Items per page, 1 to 100, default 25
|
|
13651
|
+
*/
|
|
13652
|
+
limit?: number;
|
|
13653
|
+
}
|
|
13631
13654
|
/**
|
|
13632
13655
|
* The parameters of `GetMyEntitlements`.
|
|
13633
13656
|
*/
|
|
@@ -3309,9 +3309,10 @@ export interface Currency {
|
|
|
3309
3309
|
name: string;
|
|
3310
3310
|
object: "currency";
|
|
3311
3311
|
}
|
|
3312
|
-
export interface
|
|
3312
|
+
export interface CurrencyList {
|
|
3313
3313
|
data: Currency[];
|
|
3314
3314
|
object: "list";
|
|
3315
|
+
pagination: Pagination;
|
|
3315
3316
|
}
|
|
3316
3317
|
export interface CurrentUser {
|
|
3317
3318
|
address?: Address;
|
|
@@ -6577,9 +6578,10 @@ export interface MyCustomer {
|
|
|
6577
6578
|
status: string;
|
|
6578
6579
|
subject: MySubject;
|
|
6579
6580
|
}
|
|
6580
|
-
export interface
|
|
6581
|
+
export interface MyCustomerList {
|
|
6581
6582
|
data: MyCustomer[];
|
|
6582
6583
|
object: "list";
|
|
6584
|
+
pagination: Pagination;
|
|
6583
6585
|
}
|
|
6584
6586
|
/**
|
|
6585
6587
|
* MyPackageRef is the package in force, with its name.
|
|
@@ -12454,6 +12456,14 @@ export interface ListCurrenciesParams {
|
|
|
12454
12456
|
* Only the currencies Stripe can charge
|
|
12455
12457
|
*/
|
|
12456
12458
|
chargeable?: boolean;
|
|
12459
|
+
/**
|
|
12460
|
+
* Page number, from 1
|
|
12461
|
+
*/
|
|
12462
|
+
page?: number;
|
|
12463
|
+
/**
|
|
12464
|
+
* Items per page, 1 to 100, default 25
|
|
12465
|
+
*/
|
|
12466
|
+
limit?: number;
|
|
12457
12467
|
}
|
|
12458
12468
|
/**
|
|
12459
12469
|
* The parameters of `ListCustomers`.
|
|
@@ -13628,6 +13638,19 @@ export interface UpdateMyCustomerParams {
|
|
|
13628
13638
|
*/
|
|
13629
13639
|
subject_id?: string;
|
|
13630
13640
|
}
|
|
13641
|
+
/**
|
|
13642
|
+
* The parameters of `ListMyCustomers`.
|
|
13643
|
+
*/
|
|
13644
|
+
export interface ListMyCustomersParams {
|
|
13645
|
+
/**
|
|
13646
|
+
* Page number, from 1
|
|
13647
|
+
*/
|
|
13648
|
+
page?: number;
|
|
13649
|
+
/**
|
|
13650
|
+
* Items per page, 1 to 100, default 25
|
|
13651
|
+
*/
|
|
13652
|
+
limit?: number;
|
|
13653
|
+
}
|
|
13631
13654
|
/**
|
|
13632
13655
|
* The parameters of `GetMyEntitlements`.
|
|
13633
13656
|
*/
|
package/dist/management.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./client-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./client-fmMA2Var.cjs");exports.APIPromise=r.APIPromise;exports.AuthenticationError=r.AuthenticationError;exports.BadRequestError=r.BadRequestError;exports.ConflictError=r.ConflictError;exports.InternalServerError=r.InternalServerError;exports.NotFoundError=r.NotFoundError;exports.Page=r.Page;exports.PagePromise=r.PagePromise;exports.PermissionDeniedError=r.PermissionDeniedError;exports.Pontive=r.Pontive;exports.PontiveAPIError=r.PontiveAPIError;exports.PontiveConnectionError=r.PontiveConnectionError;exports.PreconditionFailedError=r.PreconditionFailedError;exports.RateLimitError=r.RateLimitError;exports.UnprocessableEntityError=r.UnprocessableEntityError;exports.secretKeyRegion=r.secretKeyRegion;
|
|
2
2
|
//# sourceMappingURL=management.cjs.map
|
package/dist/management.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, a, B as s, C as i, I as n, N as t, P as E, b as P, c, d, e as m, f as g, g as l, R as v, U as A, s as I } from "./client-
|
|
1
|
+
import { A as e, a, B as s, C as i, I as n, N as t, P as E, b as P, c, d, e as m, f as g, g as l, R as v, U as A, s as I } from "./client-BI4W1IJJ.js";
|
|
2
2
|
export {
|
|
3
3
|
e as APIPromise,
|
|
4
4
|
a as AuthenticationError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pontive/server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Pontive SDK for TypeScript servers: the management API client, sessions for apps (sign-in, a sealed session cookie, safe token refresh) and resource-server middleware for APIs and MCP servers, on Web Request/Response.",
|
|
6
6
|
"type": "module",
|
package/dist/client-D80_tH4S.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const P=require("./management-credential--CmS8XaV.cjs"),v={issuer:"PONTIVE_ISSUER",clientId:"PONTIVE_CLIENT_ID",clientSecret:"PONTIVE_CLIENT_SECRET",sessionSecret:"PONTIVE_SESSION_SECRET",secretKey:"PONTIVE_SECRET_KEY",instanceId:"PONTIVE_INSTANCE_ID",managementUrl:"PONTIVE_MANAGEMENT_URL",apiUrl:"PONTIVE_API_URL",region:"PONTIVE_REGION",keyless:"PONTIVE_KEYLESS"};function b(){try{return globalThis.process?.env??{}}catch{return{}}}const y=i=>i&&i.trim()?i.trim():void 0;function F(i,e=b()){return{...i,issuer:i.issuer||y(e[v.issuer]),clientId:i.clientId||y(e[v.clientId]),clientSecret:i.clientSecret||y(e[v.clientSecret]),sessionSecret:i.sessionSecret||y(e[v.sessionSecret])}}function I(i=b()){return i.NODE_ENV==="development"}function j(i,e=b()){return I(e)&&!i.issuer&&e[v.keyless]?.trim()!=="0"}class c extends Error{status;type;code;param;docUrl;details;requestId;headers;body;constructor(e,t,r){const o=r?.error??{},a=l=>typeof l=="string"&&l?l:void 0,h=a(o.code),n=t.get("x-request-id")??void 0,m=a(o.message)??`HTTP ${e}`;super(`pontive: ${e}${h?` ${h}`:""}: ${m}${n?` (request ${n})`:""}`),this.name=new.target.name,this.status=e,this.type=a(o.type),this.code=h,this.param=a(o.param),this.docUrl=a(o.doc_url),this.details=Array.isArray(o.details)?o.details:[],this.requestId=n,this.headers=t,this.body=r}static from(e,t,r){const o=W[e]??(e>=500?U:c);return new o(e,t,r)}}class z extends c{}class L extends c{}class D extends c{}class M extends c{}class _ extends c{}class R extends c{}class N extends c{}class x extends c{}class U extends c{}const W={400:z,401:L,403:D,404:M,409:_,412:R,422:N,429:x};class O extends Error{constructor(e,t){super(e,t),this.name="PontiveConnectionError"}}const Y="1.25.0",w=6e4;class J{constructor(e){this.config=e}config;request(e,t){return new G(this.send(e,t))}page(e,t,r){const o=a=>this.send({...t,query:a},r).then(({data:h,response:n})=>({data:new H(e,h,a,m=>new S(o(m))),response:n}));return new S(o(t.query))}async send(e,t={}){const{config:r}=this,o=t.maxRetries??r.maxRetries,a=t.idempotencyKey??(e.idempotent?crypto.randomUUID():void 0),h=e.method!=="POST"||a!==void 0,n=r.hosts[e.host];if(!n)throw new Error(e.host==="auth"?"pontive: pontive.me is served on the instance's auth domain: pass issuer or set PONTIVE_ISSUER":"pontive: no region: pass region or managementUrl");const m=n+e.path+X(e.query),l=e.body===void 0?void 0:JSON.stringify(e.body),T=r.sleep??(d=>new Promise(u=>setTimeout(u,d)));let q=!1;for(let d=0;;d++){const u=new Headers;for(const[g,E]of Object.entries(e.headers??{}))E!==void 0&&E!==""&&u.set(g,E);for(const[g,E]of Object.entries(t.headers??{}))u.set(g,E);u.set("authorization",`Bearer ${await r.token()}`),u.set("accept",e.binary?"*/*":"application/json"),u.set("user-agent",`pontive-typescript/${Y}`),l!==void 0&&u.set("content-type","application/json"),a&&u.set("x-idempotency-key",a),r.instanceId&&u.set("x-pontive-instance-id",r.instanceId);const f=AbortSignal.timeout(t.timeout??r.timeout),V=t.signal?AbortSignal.any([t.signal,f]):f;let p;try{p=await r.fetch(m,{method:e.method,headers:u,body:l,signal:V})}catch(g){if(t.signal?.aborted||!h||d>=o)throw new O(`pontive: ${e.method} ${e.path}: ${g.message}`,{cause:g});await T(A(d));continue}if(p.ok)return{data:await Q(p,e.binary),response:p};if(p.status===401&&!q&&r.invalidate()){q=!0,d--;continue}const K=await Z(p);if(d<o&&ee(p.status,h)){await T(A(d,p.headers));continue}throw c.from(p.status,p.headers,K)}}}function X(i){if(!i)return"";const e=new URLSearchParams;for(const[r,o]of Object.entries(i))if(o!=null)if(Array.isArray(o))for(const a of o)e.append(r,String(a));else e.append(r,String(o));const t=e.toString();return t?`?${t}`:""}async function Q(i,e){if(e)return new Uint8Array(await i.arrayBuffer());const t=await i.text();if(!(i.status===204||t.trim()===""))try{return JSON.parse(t)}catch{throw new O(`pontive: the ${i.status} response is not JSON`)}}async function Z(i){const e=await i.text().catch(()=>"");try{return JSON.parse(e)}catch{return e}}function ee(i,e){return i===429?!0:e&&[408,500,502,503,504].includes(i)}function A(i,e){const t=e?.get("retry-after")?.trim();if(t){const o=Number(t);if(Number.isFinite(o)&&o>=0)return Math.min(o*1e3,w);const a=Date.parse(t);if(!Number.isNaN(a))return Math.min(Math.max(a-Date.now(),0),w)}return Math.min(500*2**i,8e3)*(.75+Math.random()*.5)}class G{constructor(e){this.result=e,e.catch(()=>{})}result;withResponse(){return this.result}then(e,t){return this.result.then(r=>r.data).then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return this.then().finally(e)}}class H{constructor(e,t,r,o){this.kind=e,this.body=t,this.query=r,this.load=o;const a=t?.data;this.data=Array.isArray(a)?a:[]}kind;body;query;load;data;hasNextPage(){if(this.data.length===0)return!1;if(this.kind==="cursor"){const t=this.body.next_cursor;return!!t&&t!==this.query?.after}const e=this.body.pagination;return!!e&&(e.page??0)<(e.total_pages??0)}nextPage(){if(this.kind==="cursor")return this.load({...this.query,after:this.body.next_cursor});const e=this.body.pagination;return this.load({...this.query,page:(e?.page??1)+1})}async*[Symbol.asyncIterator](){let e=this;for(;;){if(yield*e.data,!e.hasNextPage())return;e=await e.nextPage()}}}class S extends G{async*[Symbol.asyncIterator](){yield*await this}}function te(i){const{token:e}=i;if(typeof e=="string")return{token:async()=>e,invalidate:()=>!1};if(typeof e=="function")return{token:async()=>e(),invalidate:()=>!1};let t,r;return{token:async()=>t&&Date.now()<t.until?t.value:(r??=P.clientCredentialsToken({issuer:i.issuer,clientId:i.clientId,clientSecret:i.clientSecret},i.fetch,{resource:i.audience}).then(o=>(t={value:o.access_token,until:Date.now()+((o.expires_in??300)-60)*1e3},o.access_token)).finally(()=>{r=void 0}),r),invalidate:()=>(t=void 0,!0)}}const s=encodeURIComponent;class re{constructor(e){this.core=e,this.accessKeys=new se(e),this.agents=new ie(e),this.apis=new oe(e),this.apps=new ae(e),this.authn=new he(e),this.authz=new ve(e),this.billing=new be(e),this.branding=new Ze(e),this.capabilities=new rt(e),this.countries=new ot(e),this.delegations=new at(e),this.groups=new ht(e),this.logs=new nt(e),this.me=new ct(e),this.organizations=new pt(e),this.personalAccessTokens=new lt(e),this.resources=new dt(e),this.root=new mt(e),this.serviceAccounts=new gt(e),this.userImports=new vt(e),this.users=new Tt(e),this.webhooks=new qt(e)}core;accessKeys;agents;apis;apps;authn;authz;billing;branding;capabilities;countries;delegations;groups;logs;me;organizations;personalAccessTokens;resources;root;serviceAccounts;userImports;users;webhooks}class se{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/access-keys",body:e},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/access-keys/${s(e)}`},t)}getValue(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/access-keys/${s(e)}/key`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/access-keys",query:e},t)}revoke(e,t){return this.core.request({host:"api",method:"POST",path:`/v1/access-keys/${s(e)}/revoke`},t)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/access-keys/${s(e)}`,body:t},r)}}class ie{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/agents",body:e},t)}createClientSecret(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/agents/${s(e)}/client-secrets`,body:t},r)}createFederatedCredential(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/agents/${s(e)}/federated-credentials`,body:t},r)}createOrganizations(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/agents/${s(e)}/organizations`,body:t},r)}createPublicKey(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/agents/${s(e)}/public-keys`,body:t},r)}deactivate(e,t){return this.core.request({host:"api",method:"POST",path:`/v1/agents/${s(e)}/deactivate`},t)}delete(e,t){return this.core.request({host:"api",method:"DELETE",path:`/v1/agents/${s(e)}`},t)}deleteClientSecret(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/agents/${s(e)}/client-secrets/${s(t)}`},r)}deleteFederatedCredential(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/agents/${s(e)}/federated-credentials/${s(t)}`},r)}deleteOrganization(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/agents/${s(e)}/organizations/${s(t)}`},r)}deletePublicKey(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/agents/${s(e)}/public-keys/${s(t)}`},r)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/agents/${s(e)}`},t)}getFederatedCredential(e,t,r){return this.core.request({host:"api",method:"GET",path:`/v1/agents/${s(e)}/federated-credentials/${s(t)}`},r)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/agents",query:e},t)}listClientSecrets(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/agents/${s(e)}/client-secrets`,query:t},r)}listFederatedCredentials(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/agents/${s(e)}/federated-credentials`,query:t},r)}listInstallations(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/agents/${s(e)}/installations`,query:t},r)}listOrganizations(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/agents/${s(e)}/organizations`,query:t},r)}reactivate(e,t){return this.core.request({host:"api",method:"POST",path:`/v1/agents/${s(e)}/reactivate`},t)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/agents/${s(e)}`,body:t},r)}updateFederatedCredential(e,t,r,o){return this.core.request({host:"api",method:"PATCH",path:`/v1/agents/${s(e)}/federated-credentials/${s(t)}`,body:r},o)}}class oe{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/apis",body:e},t)}delete(e,t){return this.core.request({host:"api",method:"DELETE",path:`/v1/apis/${s(e)}`},t)}disable(e,t){return this.core.request({host:"api",method:"POST",path:`/v1/apis/${s(e)}/disable`},t)}enable(e,t){return this.core.request({host:"api",method:"POST",path:`/v1/apis/${s(e)}/enable`},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/apis/${s(e)}`},t)}getResourceMetadata(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/apis/${s(e)}/resource-metadata`},t)}importScopes(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/apis/${s(e)}/scopes/import`,body:t},r)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/apis",query:e},t)}listClients(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/apis/${s(e)}/clients`,query:t},r)}replaceClients(e,t,r){return this.core.request({host:"api",method:"PUT",path:`/v1/apis/${s(e)}/clients`,body:t},r)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/apis/${s(e)}`,body:t},r)}}class ae{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/apps",body:e},t)}createClientSecret(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/apps/${s(e)}/client-secrets`,body:t},r)}createOrganizations(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/apps/${s(e)}/organizations`,body:t},r)}createPublicKey(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/apps/${s(e)}/public-keys`,body:t},r)}deactivate(e,t){return this.core.request({host:"api",method:"POST",path:`/v1/apps/${s(e)}/deactivate`},t)}delete(e,t){return this.core.request({host:"api",method:"DELETE",path:`/v1/apps/${s(e)}`},t)}deleteClientSecret(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/apps/${s(e)}/client-secrets/${s(t)}`},r)}deleteOrganization(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/apps/${s(e)}/organizations/${s(t)}`},r)}deletePublicKey(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/apps/${s(e)}/public-keys/${s(t)}`},r)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/apps/${s(e)}`},t)}getSecurityLevel(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/apps/${s(e)}/security-level`},t)}getSettings(e){return this.core.request({host:"api",method:"GET",path:"/v1/apps/settings"},e)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/apps",query:e},t)}listClientSecrets(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/apps/${s(e)}/client-secrets`,query:t},r)}listOrganizations(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/apps/${s(e)}/organizations`,query:t},r)}listRefusedProxyBases(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/apps/${s(e)}/refused-proxy-bases`,query:t},r)}previewClaimsTemplate(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/apps/${s(e)}/claims-template/preview`,body:t},r)}reactivate(e,t){return this.core.request({host:"api",method:"POST",path:`/v1/apps/${s(e)}/reactivate`},t)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/apps/${s(e)}`,body:t},r)}updateSettings(e,t,r){const{if_match:o}=t??{};return this.core.request({host:"api",method:"PATCH",path:"/v1/apps/settings",headers:{"If-Match":o},body:e},r)}}class he{constructor(e){this.core=e,this.accountLinking=new ne(e),this.authflows=new ce(e),this.connections=new ue(e),this.identityPolicy=new pe(e),this.migrationSources=new le(e),this.passwordPolicy=new de(e),this.sharedCredentials=new me(e),this.trustedIssuers=new ge(e)}core;accountLinking;authflows;connections;identityPolicy;migrationSources;passwordPolicy;sharedCredentials;trustedIssuers}class ne{constructor(e){this.core=e}core;get(e){return this.core.request({host:"api",method:"GET",path:"/v1/authn/account-linking-config"},e)}update(e,t,r){const{if_match:o}=t??{};return this.core.request({host:"api",method:"PATCH",path:"/v1/authn/account-linking-config",headers:{"If-Match":o},body:e},r)}}class ce{constructor(e){this.core=e}core;delete(e,t,r){const{if_match:o}=t??{};return this.core.request({host:"api",method:"DELETE",path:`/v1/authn/authflows/${s(e)}`,headers:{"If-Match":o}},r)}getDocument(e,t){return this.core.request({host:"api",method:"GET",path:"/v1/authn/authflows/document",query:e},t)}importDocument(e,t,r){const{if_match:o}=t??{};return this.core.request({host:"api",method:"POST",path:"/v1/authn/authflows/document/import",headers:{"If-Match":o},body:e,idempotent:!0},r)}}class ue{constructor(e){this.core=e}core;delete(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/apps/${s(e)}/auth-connections/${s(t)}`},r)}get(e,t,r){return this.core.request({host:"api",method:"GET",path:`/v1/apps/${s(e)}/auth-connections/${s(t)}`},r)}list(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/apps/${s(e)}/auth-connections`,query:t},r)}listTypes(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/authn/connection-types",query:e},t)}replace(e,t,r,o){return this.core.request({host:"api",method:"PUT",path:`/v1/apps/${s(e)}/auth-connections/${s(t)}`,body:r},o)}}class pe{constructor(e){this.core=e}core;get(e){return this.core.request({host:"api",method:"GET",path:"/v1/authn/identity-policy"},e)}previewEmailPolicy(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/authn/identity-policy/email/preview",body:e},t)}update(e,t,r){const{if_match:o}=t??{};return this.core.request({host:"api",method:"PATCH",path:"/v1/authn/identity-policy",headers:{"If-Match":o},body:e},r)}}class le{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/authn/migration-sources",body:e},t)}delete(e,t){return this.core.request({host:"api",method:"DELETE",path:`/v1/authn/migration-sources/${s(e)}`},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/authn/migration-sources/${s(e)}`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/authn/migration-sources",query:e},t)}rotateSecret(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/authn/migration-sources/${s(e)}/rotate-secret`,body:t},r)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/authn/migration-sources/${s(e)}`,body:t},r)}validate(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/authn/migration-sources/${s(e)}/validate`,body:t},r)}}class de{constructor(e){this.core=e}core;delete(e,t){const{if_match:r}=e??{};return this.core.request({host:"api",method:"DELETE",path:"/v1/authn/password-policy",headers:{"If-Match":r}},t)}get(e){return this.core.request({host:"api",method:"GET",path:"/v1/authn/password-policy"},e)}update(e,t,r){const{if_match:o}=t??{};return this.core.request({host:"api",method:"PATCH",path:"/v1/authn/password-policy",headers:{"If-Match":o},body:e},r)}}class me{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/authn/connection-credentials",body:e},t)}delete(e,t){return this.core.request({host:"api",method:"DELETE",path:`/v1/authn/connection-credentials/${s(e)}`},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/authn/connection-credentials/${s(e)}`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/authn/connection-credentials",query:e},t)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/authn/connection-credentials/${s(e)}`,body:t},r)}}class ge{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/authn/trusted-issuers",body:e},t)}delete(e,t){return this.core.request({host:"api",method:"DELETE",path:`/v1/authn/trusted-issuers/${s(e)}`},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/authn/trusted-issuers/${s(e)}`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/authn/trusted-issuers",query:e},t)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/authn/trusted-issuers/${s(e)}`,body:t},r)}}class ve{constructor(e){this.core=e,this.model=new Te(e),this.permissions=new qe(e),this.resourceTypes=new Ee(e),this.roles=new $e(e)}core;model;permissions;resourceTypes;roles;evaluateAccess(e,t){return this.core.request({host:"authz",method:"POST",path:"/access/v1/evaluation",body:e},t)}evaluateAccessBatch(e,t){return this.core.request({host:"authz",method:"POST",path:"/access/v1/evaluations",body:e},t)}getConfiguration(e){return this.core.request({host:"authz",method:"GET",path:"/.well-known/authzen-configuration"},e)}searchActions(e,t){return this.core.request({host:"authz",method:"POST",path:"/access/v1/search/action",body:e},t)}searchResources(e,t){return this.core.request({host:"authz",method:"POST",path:"/access/v1/search/resource",body:e},t)}}class Te{constructor(e){this.core=e}core;getPreview(e){return this.core.request({host:"api",method:"GET",path:"/v1/authz/model/preview"},e)}regenerate(e){return this.core.request({host:"api",method:"POST",path:"/v1/authz/model/regenerate"},e)}}class qe{constructor(e){this.core=e}core;create(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/authz/resource-types/${s(e)}/permissions`,body:t},r)}delete(e,t,r,o){const{if_match:a,...h}=r??{};return this.core.request({host:"api",method:"DELETE",path:`/v1/authz/resource-types/${s(e)}/permissions/${s(t)}`,query:h,headers:{"If-Match":a}},o)}get(e,t,r){return this.core.request({host:"api",method:"GET",path:`/v1/authz/resource-types/${s(e)}/permissions/${s(t)}`},r)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/authz/permissions",query:e},t)}listResourceTypePermissions(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/authz/resource-types/${s(e)}/permissions`,query:t},r)}update(e,t,r,o,a){const{if_match:h}=o??{};return this.core.request({host:"api",method:"PATCH",path:`/v1/authz/resource-types/${s(e)}/permissions/${s(t)}`,headers:{"If-Match":h},body:r},a)}}class Ee{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/authz/resource-types",body:e},t)}delete(e,t,r){const{if_match:o}=t??{};return this.core.request({host:"api",method:"DELETE",path:`/v1/authz/resource-types/${s(e)}`,headers:{"If-Match":o}},r)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/authz/resource-types/${s(e)}`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/authz/resource-types",query:e},t)}update(e,t,r,o){const{if_match:a}=r??{};return this.core.request({host:"api",method:"PATCH",path:`/v1/authz/resource-types/${s(e)}`,headers:{"If-Match":a},body:t},o)}}class $e{constructor(e){this.core=e}core;create(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/authz/resource-types/${s(e)}/roles`,body:t},r)}delete(e,t,r,o){const{if_match:a,...h}=r??{};return this.core.request({host:"api",method:"DELETE",path:`/v1/authz/resource-types/${s(e)}/roles/${s(t)}`,query:h,headers:{"If-Match":a}},o)}get(e,t,r){return this.core.request({host:"api",method:"GET",path:`/v1/authz/resource-types/${s(e)}/roles/${s(t)}`},r)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/authz/roles",query:e},t)}listResourceTypeRoles(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/authz/resource-types/${s(e)}/roles`,query:t},r)}update(e,t,r,o,a){const{if_match:h}=o??{};return this.core.request({host:"api",method:"PATCH",path:`/v1/authz/resource-types/${s(e)}/roles/${s(t)}`,headers:{"If-Match":h},body:r},a)}}class be{constructor(e){this.core=e,this.catalog=new ye(e),this.catalogRules=new Pe(e),this.checkoutSessions=new Se(e),this.contracts=new Oe(e),this.creditNotes=new Ge(e),this.currencies=new fe(e),this.customers=new we(e),this.disputes=new Ae(e),this.dunning=new Ce(e),this.entitlements=new ke(e),this.eventTypes=new Ie(e),this.events=new ze(e),this.exchangeRates=new Le(e),this.features=new De(e),this.grants=new Me(e),this.invoices=new _e(e),this.ledger=new Re(e),this.meters=new Ne(e),this.packages=new xe(e),this.paymentConnections=new Ue(e),this.paymentMethods=new He(e),this.payments=new Be(e),this.pricingUnits=new Ve(e),this.products=new Ke(e),this.rateCards=new Fe(e),this.refunds=new je(e),this.settings=new We(e),this.subjectStates=new Ye(e),this.tax=new Je(e),this.timeMachines=new Xe(e),this.usage=new Qe(e)}core;catalog;catalogRules;checkoutSessions;contracts;creditNotes;currencies;customers;disputes;dunning;entitlements;eventTypes;events;exchangeRates;features;grants;invoices;ledger;meters;packages;paymentConnections;paymentMethods;payments;pricingUnits;products;rateCards;refunds;settings;subjectStates;tax;timeMachines;usage}class ye{constructor(e){this.core=e}core;get(e){return this.core.request({host:"api",method:"GET",path:"/v1/billing/catalog"},e)}import(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/catalog/import",body:e,idempotent:!0},t)}}class Pe{constructor(e){this.core=e}core;get(e){return this.core.request({host:"api",method:"GET",path:"/v1/billing/catalog-rules"},e)}update(e,t,r){const{if_match:o}=t??{};return this.core.request({host:"api",method:"PATCH",path:"/v1/billing/catalog-rules",headers:{"If-Match":o},body:e,idempotent:!0},r)}}class Se{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/checkout-sessions",body:e,idempotent:!0},t)}expire(e,t){return this.core.request({host:"api",method:"POST",path:`/v1/billing/checkout-sessions/${s(e)}/expire`,idempotent:!0},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/billing/checkout-sessions/${s(e)}`},t)}}class Oe{constructor(e){this.core=e}core;cancel(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/contracts/${s(e)}/cancel`,body:t,idempotent:!0},r)}changePackage(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/contracts/${s(e)}/change-package`,body:t,idempotent:!0},r)}create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/contracts",body:e,idempotent:!0},t)}createEdit(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/contracts/${s(e)}/edits`,body:t,idempotent:!0},r)}deleteEdit(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/billing/contracts/${s(e)}/edits/${s(t)}`},r)}get(e,t,r){return this.core.request({host:"api",method:"GET",path:`/v1/billing/contracts/${s(e)}`,query:t},r)}getHistory(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/billing/contracts/${s(e)}/history`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/billing/contracts",query:e},t)}listAllowanceSchedules(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/billing/contracts/${s(e)}/allowance-schedules`,query:t},r)}listEdits(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/billing/contracts/${s(e)}/edits`,query:t},r)}preview(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/contracts/preview",body:e,idempotent:!0},t)}previewEdit(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/contracts/${s(e)}/edits/preview`,body:t,idempotent:!0},r)}revokeCancellation(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/contracts/${s(e)}/revoke-cancellation`,body:t,idempotent:!0},r)}}class Ge{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/credit-notes",body:e,idempotent:!0},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/billing/credit-notes/${s(e)}`},t)}getPdf(e,t,r){return this.core.request({host:"api",method:"GET",path:`/v1/billing/credit-notes/${s(e)}/pdf`,query:t,binary:!0},r)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/billing/credit-notes",query:e},t)}preview(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/credit-notes/preview",body:e,idempotent:!0},t)}void(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/credit-notes/${s(e)}/void`,body:t,idempotent:!0},r)}}class fe{constructor(e){this.core=e}core;list(e,t){return this.core.request({host:"api",method:"GET",path:"/v1/billing/currencies",query:e},t)}}class we{constructor(e){this.core=e}core;anonymize(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/customers/${s(e)}/anonymize`,body:t,idempotent:!0},r)}archive(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/customers/${s(e)}/archive`,body:t,idempotent:!0},r)}changeSubject(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/customers/${s(e)}/change-subject`,body:t,idempotent:!0},r)}create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/customers",body:e,idempotent:!0},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/billing/customers/${s(e)}`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/billing/customers",query:e},t)}unarchive(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/customers/${s(e)}/unarchive`,body:t,idempotent:!0},r)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/billing/customers/${s(e)}`,body:t,idempotent:!0},r)}}class Ae{constructor(e){this.core=e}core;get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/billing/disputes/${s(e)}`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/billing/disputes",query:e},t)}}class Ce{constructor(e){this.core=e}core;getForCustomer(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/billing/customers/${s(e)}/dunning`},t)}getPolicy(e){return this.core.request({host:"api",method:"GET",path:"/v1/billing/dunning-policy"},e)}retryForCustomer(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/customers/${s(e)}/dunning/retry`,body:t,idempotent:!0},r)}updatePolicy(e,t,r){const{if_match:o}=t??{};return this.core.request({host:"api",method:"PATCH",path:"/v1/billing/dunning-policy",headers:{"If-Match":o},body:e,idempotent:!0},r)}}class ke{constructor(e){this.core=e}core;check(e,t){return this.core.request({host:"authz",method:"POST",path:"/v1/entitlements/check",body:e},t)}consume(e,t){return this.core.request({host:"authz",method:"POST",path:"/v1/entitlements/consume",body:e},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:"/v1/billing/entitlements",query:e},t)}}class Ie{constructor(e){this.core=e}core;archive(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/event-types/${s(e)}/archive`,body:t,idempotent:!0},r)}create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/event-types",body:e,idempotent:!0},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/billing/event-types/${s(e)}`},t)}infer(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/event-types/infer",body:e},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/billing/event-types",query:e},t)}unarchive(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/event-types/${s(e)}/unarchive`,body:t,idempotent:!0},r)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/billing/event-types/${s(e)}`,body:t,idempotent:!0},r)}}class ze{constructor(e){this.core=e}core;get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/billing/events/${s(e)}`},t)}list(e,t){return this.core.page("cursor",{host:"api",method:"GET",path:"/v1/billing/events",query:e},t)}}class Le{constructor(e){this.core=e}core;get(e,t){return this.core.request({host:"api",method:"GET",path:"/v1/billing/exchange-rates",query:e},t)}replace(e,t,r,o,a){return this.core.request({host:"api",method:"PUT",path:`/v1/billing/exchange-rates/${s(e)}/${s(t)}/${s(r)}`,body:o,idempotent:!0},a)}}class De{constructor(e){this.core=e}core;archive(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/features/${s(e)}/archive`,body:t,idempotent:!0},r)}create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/features",body:e,idempotent:!0},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/billing/features/${s(e)}`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/billing/features",query:e},t)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/billing/features/${s(e)}`,body:t,idempotent:!0},r)}}class Me{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/grants",body:e,idempotent:!0},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/billing/grants/${s(e)}`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/billing/grants",query:e},t)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/billing/grants/${s(e)}`,body:t,idempotent:!0},r)}void(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/grants/${s(e)}/void`,body:t,idempotent:!0},r)}}class _e{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/invoices",body:e,idempotent:!0},t)}finalize(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/invoices/${s(e)}/finalize`,body:t,idempotent:!0},r)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/billing/invoices/${s(e)}`},t)}getPdf(e,t,r){return this.core.request({host:"api",method:"GET",path:`/v1/billing/invoices/${s(e)}/pdf`,query:t,binary:!0},r)}getUpcoming(e,t){return this.core.request({host:"api",method:"GET",path:"/v1/billing/invoices/upcoming",query:e},t)}getUsageCsv(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/billing/invoices/${s(e)}/usage-detail`,binary:!0},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/billing/invoices",query:e},t)}listLines(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/billing/invoices/${s(e)}/lines`,query:t},r)}markUncollectible(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/invoices/${s(e)}/mark-uncollectible`,body:t,idempotent:!0},r)}pay(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/invoices/${s(e)}/pay`,body:t,idempotent:!0},r)}recompute(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/invoices/${s(e)}/recompute`,body:t,idempotent:!0},r)}send(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/invoices/${s(e)}/send`,body:t,idempotent:!0},r)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/billing/invoices/${s(e)}`,body:t,idempotent:!0},r)}void(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/invoices/${s(e)}/void`,body:t,idempotent:!0},r)}}class Re{constructor(e){this.core=e}core;createAdjustment(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/customers/${s(e)}/ledger-adjustments`,body:t,idempotent:!0},r)}createTopUp(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/customers/${s(e)}/top-ups`,body:t,idempotent:!0},r)}getWallet(e,t,r){return this.core.request({host:"api",method:"GET",path:`/v1/billing/customers/${s(e)}/wallets/${s(t)}`},r)}listBalances(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/billing/customers/${s(e)}/balances`,query:t},r)}listEntries(e,t){return this.core.page("cursor",{host:"api",method:"GET",path:"/v1/billing/ledger-entries",query:e},t)}refundAccountCredit(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/customers/${s(e)}/account-credit/refund`,body:t,idempotent:!0},r)}replaceWalletSettings(e,t,r,o){return this.core.request({host:"api",method:"PUT",path:`/v1/billing/customers/${s(e)}/wallets/${s(t)}`,body:r,idempotent:!0},o)}}class Ne{constructor(e){this.core=e}core;archive(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/meters/${s(e)}/archive`,body:t,idempotent:!0},r)}create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/meters",body:e,idempotent:!0},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/billing/meters/${s(e)}`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/billing/meters",query:e},t)}preview(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/meters/preview",body:e,idempotent:!0},t)}replaceDefinition(e,t,r){return this.core.request({host:"api",method:"PUT",path:`/v1/billing/meters/${s(e)}/definition`,body:t,idempotent:!0},r)}unarchive(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/meters/${s(e)}/unarchive`,body:t,idempotent:!0},r)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/billing/meters/${s(e)}`,body:t,idempotent:!0},r)}}class xe{constructor(e){this.core=e}core;archive(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/packages/${s(e)}/archive`,body:t,idempotent:!0},r)}create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/packages",body:e,idempotent:!0},t)}discardDraft(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/packages/${s(e)}/discard-draft`,body:t,idempotent:!0},r)}get(e,t,r){return this.core.request({host:"api",method:"GET",path:`/v1/billing/packages/${s(e)}`,query:t},r)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/billing/packages",query:e},t)}listVersions(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/billing/packages/${s(e)}/versions`,query:t},r)}publish(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/packages/${s(e)}/publish`,body:t,idempotent:!0},r)}unarchive(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/packages/${s(e)}/unarchive`,body:t,idempotent:!0},r)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/billing/packages/${s(e)}`,body:t,idempotent:!0},r)}}class Ue{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/payment-connections",body:e,idempotent:!0},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/billing/payment-connections/${s(e)}`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/billing/payment-connections",query:e},t)}refresh(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/payment-connections/${s(e)}/refresh`,body:t,idempotent:!0},r)}revoke(e,t){return this.core.request({host:"api",method:"POST",path:`/v1/billing/payment-connections/${s(e)}/revoke`,idempotent:!0},t)}}class He{constructor(e){this.core=e}core;createSession(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/customers/${s(e)}/payment-method-session`,body:t,idempotent:!0},r)}delete(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/billing/customers/${s(e)}/payment-methods/${s(t)}`,idempotent:!0},r)}list(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/billing/customers/${s(e)}/payment-methods`,query:t},r)}}class Be{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/payments",body:e,idempotent:!0},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/billing/payments/${s(e)}`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/billing/payments",query:e},t)}}class Ve{constructor(e){this.core=e}core;archive(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/pricing-units/${s(e)}/archive`,body:t,idempotent:!0},r)}create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/pricing-units",body:e,idempotent:!0},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/billing/pricing-units/${s(e)}`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/billing/pricing-units",query:e},t)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/billing/pricing-units/${s(e)}`,body:t,idempotent:!0},r)}}class Ke{constructor(e){this.core=e}core;archive(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/products/${s(e)}/archive`,body:t,idempotent:!0},r)}create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/products",body:e,idempotent:!0},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/billing/products/${s(e)}`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/billing/products",query:e},t)}unarchive(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/products/${s(e)}/unarchive`,body:t,idempotent:!0},r)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/billing/products/${s(e)}`,body:t,idempotent:!0},r)}}class Fe{constructor(e){this.core=e}core;archive(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/rate-cards/${s(e)}/archive`,body:t,idempotent:!0},r)}create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/rate-cards",body:e,idempotent:!0},t)}createRates(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/rate-cards/${s(e)}/rates`,body:t,idempotent:!0},r)}deleteRate(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/billing/rate-cards/${s(e)}/rates/${s(t)}`},r)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/billing/rate-cards/${s(e)}`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/billing/rate-cards",query:e},t)}replaceConversions(e,t,r){return this.core.request({host:"api",method:"PUT",path:`/v1/billing/rate-cards/${s(e)}/conversions`,body:t,idempotent:!0},r)}searchPrices(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/rate-cards/${s(e)}/price/search`,body:t},r)}searchRates(e,t,r,o){return this.core.request({host:"api",method:"POST",path:`/v1/billing/rate-cards/${s(e)}/rates/search`,query:r,body:t},o)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/billing/rate-cards/${s(e)}`,body:t,idempotent:!0},r)}updateRate(e,t,r,o){return this.core.request({host:"api",method:"PATCH",path:`/v1/billing/rate-cards/${s(e)}/rates/${s(t)}`,body:r,idempotent:!0},o)}}class je{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/refunds",body:e,idempotent:!0},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/billing/refunds/${s(e)}`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/billing/refunds",query:e},t)}}class We{constructor(e){this.core=e}core;get(e){return this.core.request({host:"api",method:"GET",path:"/v1/billing/settings"},e)}update(e,t,r){const{if_match:o}=t??{};return this.core.request({host:"api",method:"PATCH",path:"/v1/billing/settings",headers:{"If-Match":o},body:e,idempotent:!0},r)}updateLimits(e,t){return this.core.request({host:"api",method:"PATCH",path:"/v1/billing/settings/limits",body:e,idempotent:!0},t)}}class Ye{constructor(e){this.core=e}core;get(e,t){return this.core.request({host:"api",method:"GET",path:"/v1/billing/subject-state",query:e},t)}}class Je{constructor(e){this.core=e}core;preview(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/tax/preview",body:e},t)}}class Xe{constructor(e){this.core=e}core;advance(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/time-machines/${s(e)}/advance`,body:t,idempotent:!0},r)}create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/time-machines",body:e,idempotent:!0},t)}createCustomer(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/time-machines/${s(e)}/customers`,body:t,idempotent:!0},r)}end(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/billing/time-machines/${s(e)}/end`,body:t,idempotent:!0},r)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/billing/time-machines/${s(e)}`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/billing/time-machines",query:e},t)}}class Qe{constructor(e){this.core=e}core;createEvents(e,t){return this.core.request({host:"ingest",method:"POST",path:"/v1/usage/events",body:e,idempotent:!0},t)}getDiagnostics(e,t){return this.core.request({host:"api",method:"GET",path:"/v1/billing/usage/diagnostics",query:e},t)}getLate(e,t){return this.core.request({host:"api",method:"GET",path:"/v1/billing/usage/late",query:e},t)}listEvents(e,t){return this.core.page("cursor",{host:"api",method:"GET",path:"/v1/billing/usage/events",query:e},t)}search(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/billing/usage/search",body:e},t)}voidEvents(e,t){return this.core.request({host:"ingest",method:"POST",path:"/v1/usage/events/void",body:e,idempotent:!0},t)}}class Ze{constructor(e){this.core=e,this.blueprints=new et(e),this.localization=new tt(e)}core;blueprints;localization;getDocument(e){return this.core.request({host:"api",method:"GET",path:"/v1/branding/document"},e)}getPontkit(e){return this.core.request({host:"api",method:"GET",path:"/v1/branding/pontkit"},e)}importDocument(e,t,r){const{if_match:o}=t??{};return this.core.request({host:"api",method:"POST",path:"/v1/branding/document/import",headers:{"If-Match":o},body:e,idempotent:!0},r)}}class et{constructor(e){this.core=e}core;delete(e,t){return this.core.request({host:"api",method:"DELETE",path:`/v1/branding/blueprints/${s(e)}`},t)}}class tt{constructor(e){this.core=e}core;get(e){return this.core.request({host:"api",method:"GET",path:"/v1/branding/localization"},e)}update(e,t,r){const{if_match:o}=t??{};return this.core.request({host:"api",method:"PATCH",path:"/v1/branding/localization",headers:{"If-Match":o},body:e},r)}}class rt{constructor(e){this.core=e,this.billing=new st(e),this.fga=new it(e)}core;billing;fga}class st{constructor(e){this.core=e}core;disable(e){return this.core.request({host:"api",method:"POST",path:"/v1/capabilities/billing/disable",idempotent:!0},e)}enable(e){return this.core.request({host:"api",method:"POST",path:"/v1/capabilities/billing/enable",idempotent:!0},e)}}class it{constructor(e){this.core=e}core;disable(e){return this.core.request({host:"api",method:"POST",path:"/v1/capabilities/fga/disable"},e)}enable(e){return this.core.request({host:"api",method:"POST",path:"/v1/capabilities/fga/enable"},e)}}class ot{constructor(e){this.core=e}core;list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/countries",query:e},t)}}class at{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/delegations",body:e},t)}delete(e,t){return this.core.request({host:"api",method:"DELETE",path:`/v1/delegations/${s(e)}`},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/delegations/${s(e)}`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/delegations",query:e},t)}}class ht{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/groups",body:e},t)}createMembers(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/groups/${s(e)}/members`,body:t},r)}delete(e,t){return this.core.request({host:"api",method:"DELETE",path:`/v1/groups/${s(e)}`},t)}deleteMember(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/groups/${s(e)}/members/${s(t)}`},r)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/groups/${s(e)}`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/groups",query:e},t)}listGrants(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/groups/${s(e)}/roles`,query:t},r)}listMembers(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/groups/${s(e)}/members`,query:t},r)}replaceRoles(e,t,r){return this.core.request({host:"api",method:"PUT",path:`/v1/groups/${s(e)}/roles`,body:t},r)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/groups/${s(e)}`,body:t},r)}}class nt{constructor(e){this.core=e}core;getAuditLog(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/logs/audit/${s(e)}`},t)}getRequestLog(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/logs/requests/${s(e)}`},t)}listAuditLogs(e,t){return this.core.page("cursor",{host:"api",method:"GET",path:"/v1/logs/audit",query:e},t)}listRequestLogs(e,t){return this.core.page("cursor",{host:"api",method:"GET",path:"/v1/logs/requests",query:e},t)}}class ct{constructor(e){this.core=e,this.billing=new ut(e)}core;billing;delete(e){return this.core.request({host:"auth",method:"DELETE",path:"/v1/me"},e)}deleteDelegation(e,t){return this.core.request({host:"auth",method:"DELETE",path:`/v1/me/delegations/${s(e)}`},t)}get(e){return this.core.request({host:"auth",method:"GET",path:"/v1/me"},e)}leaveMembership(e,t){return this.core.request({host:"auth",method:"POST",path:`/v1/me/memberships/${s(e)}/leave`},t)}listDelegations(e,t){return this.core.page("page",{host:"auth",method:"GET",path:"/v1/me/delegations",query:e},t)}listMemberships(e,t){return this.core.page("page",{host:"auth",method:"GET",path:"/v1/me/memberships",query:e},t)}update(e,t){return this.core.request({host:"auth",method:"PATCH",path:"/v1/me",body:e},t)}}class ut{constructor(e){this.core=e}core;cancelContract(e,t,r,o){return this.core.request({host:"auth",method:"POST",path:`/v1/me/billing/contracts/${s(e)}/cancel`,query:r,body:t,idempotent:!0},o)}changeContractPackage(e,t,r,o){return this.core.request({host:"auth",method:"POST",path:`/v1/me/billing/contracts/${s(e)}/change-package`,query:r,body:t,idempotent:!0},o)}checkEntitlement(e,t,r){return this.core.request({host:"authz",method:"POST",path:"/v1/me/entitlements/check",query:t,body:e},r)}confirmCheckoutSession(e,t,r,o){return this.core.request({host:"auth",method:"POST",path:`/v1/me/billing/checkout-sessions/${s(e)}/confirm`,query:r,body:t,idempotent:!0},o)}createCheckoutSession(e,t,r){return this.core.request({host:"auth",method:"POST",path:"/v1/me/billing/checkout-sessions",query:t,body:e,idempotent:!0},r)}createPaymentMethodSession(e,t,r){return this.core.request({host:"auth",method:"POST",path:"/v1/me/billing/payment-method-session",query:t,body:e,idempotent:!0},r)}deleteContractEdit(e,t,r,o){return this.core.request({host:"auth",method:"DELETE",path:`/v1/me/billing/contracts/${s(e)}/edits/${s(t)}`,query:r,idempotent:!0},o)}deletePaymentMethod(e,t,r){return this.core.request({host:"auth",method:"DELETE",path:`/v1/me/billing/payment-methods/${s(e)}`,query:t,idempotent:!0},r)}getCheckoutSession(e,t,r){return this.core.request({host:"auth",method:"GET",path:`/v1/me/billing/checkout-sessions/${s(e)}`,query:t},r)}getCreditNotePdf(e,t,r){return this.core.request({host:"auth",method:"GET",path:`/v1/me/billing/credit-notes/${s(e)}/pdf`,query:t,binary:!0},r)}getEntitlements(e,t){return this.core.request({host:"auth",method:"GET",path:"/v1/me/billing/entitlements",query:e},t)}getInvoice(e,t,r){return this.core.request({host:"auth",method:"GET",path:`/v1/me/billing/invoices/${s(e)}`,query:t},r)}getInvoicePdf(e,t,r){return this.core.request({host:"auth",method:"GET",path:`/v1/me/billing/invoices/${s(e)}/pdf`,query:t,binary:!0},r)}getUpcomingInvoice(e,t){return this.core.request({host:"auth",method:"GET",path:"/v1/me/billing/invoices/upcoming",query:e},t)}getUsage(e,t){return this.core.request({host:"auth",method:"GET",path:"/v1/me/billing/usage",query:e},t)}listBalances(e,t){return this.core.page("page",{host:"auth",method:"GET",path:"/v1/me/billing/balances",query:e},t)}listContracts(e,t){return this.core.page("page",{host:"auth",method:"GET",path:"/v1/me/billing/contracts",query:e},t)}listCreditNotes(e,t){return this.core.page("page",{host:"auth",method:"GET",path:"/v1/me/billing/credit-notes",query:e},t)}listCustomers(e){return this.core.request({host:"auth",method:"GET",path:"/v1/me/billing/customers"},e)}listInvoices(e,t){return this.core.page("page",{host:"auth",method:"GET",path:"/v1/me/billing/invoices",query:e},t)}listLedgerEntries(e,t){return this.core.page("cursor",{host:"auth",method:"GET",path:"/v1/me/billing/ledger-entries",query:e},t)}listPaymentMethods(e,t){return this.core.page("page",{host:"auth",method:"GET",path:"/v1/me/billing/payment-methods",query:e},t)}listPayments(e,t){return this.core.page("page",{host:"auth",method:"GET",path:"/v1/me/billing/payments",query:e},t)}payInvoice(e,t,r,o){return this.core.request({host:"auth",method:"POST",path:`/v1/me/billing/invoices/${s(e)}/pay`,query:r,body:t,idempotent:!0},o)}previewCheckoutSession(e,t,r,o){return this.core.request({host:"auth",method:"POST",path:`/v1/me/billing/checkout-sessions/${s(e)}/preview`,query:r,body:t},o)}previewContractChange(e,t,r,o){return this.core.request({host:"auth",method:"POST",path:`/v1/me/billing/contracts/${s(e)}/change-package/preview`,query:r,body:t},o)}revokeContractCancellation(e,t,r,o){return this.core.request({host:"auth",method:"POST",path:`/v1/me/billing/contracts/${s(e)}/revoke-cancellation`,query:r,body:t,idempotent:!0},o)}updateCustomer(e,t,r){return this.core.request({host:"auth",method:"PATCH",path:"/v1/me/billing/customer",query:t,body:e,idempotent:!0},r)}}class pt{constructor(e){this.core=e}core;allowThirdPartyClient(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/organizations/${s(e)}/third-party-clients/${s(t)}/allow`},r)}approveAgentInstallation(e,t,r,o){return this.core.request({host:"api",method:"POST",path:`/v1/organizations/${s(e)}/agent-installations/${s(t)}/approve`,body:r},o)}blockThirdPartyClient(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/organizations/${s(e)}/third-party-clients/${s(t)}/block`},r)}create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/organizations",body:e},t)}createAgentInstallation(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/organizations/${s(e)}/agent-installations`,body:t},r)}createInvitations(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/organizations/${s(e)}/invitations`,body:t},r)}createMember(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/organizations/${s(e)}/members`,body:t},r)}declineAgentInstallation(e,t,r,o){return this.core.request({host:"api",method:"POST",path:`/v1/organizations/${s(e)}/agent-installations/${s(t)}/decline`,body:r},o)}delete(e,t){return this.core.request({host:"api",method:"DELETE",path:`/v1/organizations/${s(e)}`},t)}deleteAgentInstallation(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/organizations/${s(e)}/agent-installations/${s(t)}`},r)}deleteDelegation(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/organizations/${s(e)}/delegations/${s(t)}`},r)}deleteInvitation(e,t,r,o){return this.core.request({host:"api",method:"DELETE",path:`/v1/organizations/${s(e)}/invitations/${s(t)}`,query:r},o)}deleteMember(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/organizations/${s(e)}/members/${s(t)}`},r)}deleteMemberLimit(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/organizations/${s(e)}/member-limits/${s(t)}`},r)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/organizations/${s(e)}`},t)}getAgentInstallation(e,t,r){return this.core.request({host:"api",method:"GET",path:`/v1/organizations/${s(e)}/agent-installations/${s(t)}`},r)}getByExternalId(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/organizations/external_id/${s(e)}`},t)}getClientPolicy(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/organizations/${s(e)}/client-policy`},t)}getInvitation(e,t,r){return this.core.request({host:"api",method:"GET",path:`/v1/organizations/${s(e)}/invitations/${s(t)}`},r)}getMember(e,t,r){return this.core.request({host:"api",method:"GET",path:`/v1/organizations/${s(e)}/members/${s(t)}`},r)}getSettings(e){return this.core.request({host:"api",method:"GET",path:"/v1/organizations/settings"},e)}import(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/organizations/import",body:e},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/organizations",query:e},t)}listAgentActivity(e,t,r){return this.core.page("cursor",{host:"api",method:"GET",path:`/v1/organizations/${s(e)}/agent-activity`,query:t},r)}listAgentInstallations(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/organizations/${s(e)}/agent-installations`,query:t},r)}listAgents(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/organizations/${s(e)}/agents`,query:t},r)}listAssignableRoles(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/organizations/${s(e)}/assignable-roles`,query:t},r)}listAuditLogs(e,t,r){return this.core.page("cursor",{host:"api",method:"GET",path:`/v1/organizations/${s(e)}/audit-logs`,query:t},r)}listDelegations(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/organizations/${s(e)}/delegations`,query:t},r)}listGroupRoles(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/organizations/${s(e)}/group-roles`,query:t},r)}listInvitations(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/organizations/${s(e)}/invitations`,query:t},r)}listMembers(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/organizations/${s(e)}/members`,query:t},r)}listThirdPartyClients(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/organizations/${s(e)}/third-party-clients`,query:t},r)}replaceMemberLimit(e,t,r,o){return this.core.request({host:"api",method:"PUT",path:`/v1/organizations/${s(e)}/member-limits/${s(t)}`,body:r},o)}resendInvitation(e,t,r,o){return this.core.request({host:"api",method:"POST",path:`/v1/organizations/${s(e)}/invitations/${s(t)}/resend`,body:r},o)}resume(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/organizations/${s(e)}/resume`,body:t},r)}resumeAgentInstallation(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/organizations/${s(e)}/agent-installations/${s(t)}/resume`},r)}suspend(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/organizations/${s(e)}/suspend`,body:t},r)}suspendAgentInstallation(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/organizations/${s(e)}/agent-installations/${s(t)}/suspend`},r)}transferOwnership(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/organizations/${s(e)}/transfer-ownership`,body:t},r)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/organizations/${s(e)}`,body:t},r)}updateAgentInstallation(e,t,r,o){return this.core.request({host:"api",method:"PATCH",path:`/v1/organizations/${s(e)}/agent-installations/${s(t)}`,body:r},o)}updateClientPolicy(e,t,r,o){const{if_match:a}=r??{};return this.core.request({host:"api",method:"PATCH",path:`/v1/organizations/${s(e)}/client-policy`,headers:{"If-Match":a},body:t},o)}updateMember(e,t,r,o){return this.core.request({host:"api",method:"PATCH",path:`/v1/organizations/${s(e)}/members/${s(t)}`,body:r},o)}updateSettings(e,t,r){const{if_match:o}=t??{};return this.core.request({host:"api",method:"PATCH",path:"/v1/organizations/settings",headers:{"If-Match":o},body:e},r)}}class lt{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/personal-access-tokens",body:e},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/personal-access-tokens/${s(e)}`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/personal-access-tokens",query:e},t)}revoke(e,t){return this.core.request({host:"api",method:"POST",path:`/v1/personal-access-tokens/${s(e)}/revoke`},t)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/personal-access-tokens/${s(e)}`,body:t},r)}}class dt{constructor(e){this.core=e}core;approveAgentInstallation(e,t,r,o){return this.core.request({host:"api",method:"POST",path:`/v1/resources/${s(e)}/agent-installations/${s(t)}/approve`,body:r},o)}create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/resources",body:e},t)}createAgentInstallation(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/resources/${s(e)}/agent-installations`,body:t},r)}createMember(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/resources/${s(e)}/members`,body:t},r)}declineAgentInstallation(e,t,r,o){return this.core.request({host:"api",method:"POST",path:`/v1/resources/${s(e)}/agent-installations/${s(t)}/decline`,body:r},o)}delete(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/resources/${s(e)}`,query:t},r)}deleteAgentInstallation(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/resources/${s(e)}/agent-installations/${s(t)}`},r)}deleteMember(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/resources/${s(e)}/members/${s(t)}`},r)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/resources/${s(e)}`},t)}getAgentInstallation(e,t,r){return this.core.request({host:"api",method:"GET",path:`/v1/resources/${s(e)}/agent-installations/${s(t)}`},r)}getMember(e,t,r){return this.core.request({host:"api",method:"GET",path:`/v1/resources/${s(e)}/members/${s(t)}`},r)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/resources",query:e},t)}listAgentInstallations(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/resources/${s(e)}/agent-installations`,query:t},r)}listGroupRoles(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/resources/${s(e)}/group-roles`,query:t},r)}listMembers(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/resources/${s(e)}/members`,query:t},r)}replaceParent(e,t,r){return this.core.request({host:"api",method:"PUT",path:`/v1/resources/${s(e)}/parent`,body:t},r)}resumeAgentInstallation(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/resources/${s(e)}/agent-installations/${s(t)}/resume`},r)}suspendAgentInstallation(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/resources/${s(e)}/agent-installations/${s(t)}/suspend`},r)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/resources/${s(e)}`,body:t},r)}updateAgentInstallation(e,t,r,o){return this.core.request({host:"api",method:"PATCH",path:`/v1/resources/${s(e)}/agent-installations/${s(t)}`,body:r},o)}updateMember(e,t,r,o){return this.core.request({host:"api",method:"PATCH",path:`/v1/resources/${s(e)}/members/${s(t)}`,body:r},o)}}class mt{constructor(e){this.core=e}core;approveAgentInstallation(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/root/agent-installations/${s(e)}/approve`,body:t},r)}createAgentInstallation(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/root/agent-installations",body:e},t)}createInvitations(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/root/invitations",body:e},t)}createMember(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/root/members",body:e},t)}declineAgentInstallation(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/root/agent-installations/${s(e)}/decline`,body:t},r)}deleteAgentInstallation(e,t){return this.core.request({host:"api",method:"DELETE",path:`/v1/root/agent-installations/${s(e)}`},t)}deleteInvitation(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/root/invitations/${s(e)}`,query:t},r)}deleteMember(e,t){return this.core.request({host:"api",method:"DELETE",path:`/v1/root/members/${s(e)}`},t)}getAgentInstallation(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/root/agent-installations/${s(e)}`},t)}getInvitation(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/root/invitations/${s(e)}`},t)}getMember(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/root/members/${s(e)}`},t)}listAgentInstallations(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/root/agent-installations",query:e},t)}listGroupRoles(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/root/group-roles",query:e},t)}listInvitations(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/root/invitations",query:e},t)}listMembers(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/root/members",query:e},t)}resendInvitation(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/root/invitations/${s(e)}/resend`,body:t},r)}resumeAgentInstallation(e,t){return this.core.request({host:"api",method:"POST",path:`/v1/root/agent-installations/${s(e)}/resume`},t)}suspendAgentInstallation(e,t){return this.core.request({host:"api",method:"POST",path:`/v1/root/agent-installations/${s(e)}/suspend`},t)}updateAgentInstallation(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/root/agent-installations/${s(e)}`,body:t},r)}updateMember(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/root/members/${s(e)}`,body:t},r)}}class gt{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/service-accounts",body:e},t)}createClientSecret(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/service-accounts/${s(e)}/client-secrets`,body:t},r)}createFederatedCredential(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/service-accounts/${s(e)}/federated-credentials`,body:t},r)}createPublicKey(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/service-accounts/${s(e)}/public-keys`,body:t},r)}deactivate(e,t){return this.core.request({host:"api",method:"POST",path:`/v1/service-accounts/${s(e)}/deactivate`},t)}delete(e,t){return this.core.request({host:"api",method:"DELETE",path:`/v1/service-accounts/${s(e)}`},t)}deleteClientSecret(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/service-accounts/${s(e)}/client-secrets/${s(t)}`},r)}deleteFederatedCredential(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/service-accounts/${s(e)}/federated-credentials/${s(t)}`},r)}deletePublicKey(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/service-accounts/${s(e)}/public-keys/${s(t)}`},r)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/service-accounts/${s(e)}`},t)}getFederatedCredential(e,t,r){return this.core.request({host:"api",method:"GET",path:`/v1/service-accounts/${s(e)}/federated-credentials/${s(t)}`},r)}getTokenConfig(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/service-accounts/${s(e)}/token-config`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/service-accounts",query:e},t)}listClientScopes(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/service-accounts/${s(e)}/client-scopes`,query:t},r)}listClientSecrets(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/service-accounts/${s(e)}/client-secrets`,query:t},r)}listFederatedCredentials(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/service-accounts/${s(e)}/federated-credentials`,query:t},r)}reactivate(e,t){return this.core.request({host:"api",method:"POST",path:`/v1/service-accounts/${s(e)}/reactivate`},t)}replaceClientScopes(e,t,r){return this.core.request({host:"api",method:"PUT",path:`/v1/service-accounts/${s(e)}/client-scopes`,body:t},r)}replaceRoles(e,t,r){return this.core.request({host:"api",method:"PUT",path:`/v1/service-accounts/${s(e)}/roles`,body:t},r)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/service-accounts/${s(e)}`,body:t},r)}updateFederatedCredential(e,t,r,o){return this.core.request({host:"api",method:"PATCH",path:`/v1/service-accounts/${s(e)}/federated-credentials/${s(t)}`,body:r},o)}updateTokenConfig(e,t,r,o){const{if_match:a}=r??{};return this.core.request({host:"api",method:"PATCH",path:`/v1/service-accounts/${s(e)}/token-config`,headers:{"If-Match":a},body:t},o)}}class vt{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/user-imports",body:e},t)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/user-imports/${s(e)}`},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/user-imports",query:e},t)}listRecords(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/user-imports/${s(e)}/records`,query:t},r)}revert(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/user-imports/${s(e)}/revert`,body:t},r)}}class Tt{constructor(e){this.core=e}core;create(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/users",body:e},t)}deactivate(e,t){return this.core.request({host:"api",method:"POST",path:`/v1/users/${s(e)}/deactivate`},t)}delete(e,t){return this.core.request({host:"api",method:"DELETE",path:`/v1/users/${s(e)}`},t)}deleteAuthorizedApp(e,t,r){return this.core.request({host:"api",method:"DELETE",path:`/v1/users/${s(e)}/authorized-apps/${s(t)}`},r)}get(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/users/${s(e)}`},t)}getByExternalId(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/users/external_id/${s(e)}`},t)}import(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/users/import",body:e},t)}list(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/users",query:e},t)}listAuthorizedApps(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/users/${s(e)}/authorized-apps`,query:t},r)}listGroups(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/users/${s(e)}/groups`,query:t},r)}listMemberships(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/users/${s(e)}/memberships`,query:t},r)}listSessions(e,t,r){return this.core.page("page",{host:"api",method:"GET",path:`/v1/users/${s(e)}/sessions`,query:t},r)}reactivate(e,t){return this.core.request({host:"api",method:"POST",path:`/v1/users/${s(e)}/reactivate`},t)}revokeSession(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/users/${s(e)}/sessions/${s(t)}/revoke`},r)}unlock(e,t){return this.core.request({host:"api",method:"POST",path:`/v1/users/${s(e)}/unlock`},t)}update(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/users/${s(e)}`,body:t},r)}}class qt{constructor(e){this.core=e}core;createSubscription(e,t){return this.core.request({host:"api",method:"POST",path:"/v1/webhooks/subscriptions",body:e},t)}deleteSubscription(e,t){return this.core.request({host:"api",method:"DELETE",path:`/v1/webhooks/subscriptions/${s(e)}`},t)}getActivity(e,t,r){return this.core.request({host:"api",method:"GET",path:`/v1/webhooks/subscriptions/${s(e)}/activity`,query:t},r)}getDelivery(e,t,r){return this.core.request({host:"api",method:"GET",path:`/v1/webhooks/subscriptions/${s(e)}/deliveries/${s(t)}`},r)}getEvent(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/webhooks/events/${s(e)}`},t)}getEventType(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/webhooks/event-types/${s(e)}`},t)}getSubscription(e,t){return this.core.request({host:"api",method:"GET",path:`/v1/webhooks/subscriptions/${s(e)}`},t)}getUsage(e,t){return this.core.request({host:"api",method:"GET",path:"/v1/webhooks/usage",query:e},t)}listDeliveries(e,t,r){return this.core.page("cursor",{host:"api",method:"GET",path:`/v1/webhooks/subscriptions/${s(e)}/deliveries`,query:t},r)}listEventTypes(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/webhooks/event-types",query:e},t)}listEvents(e,t){return this.core.page("cursor",{host:"api",method:"GET",path:"/v1/webhooks/events",query:e},t)}listSubscriptions(e,t){return this.core.page("page",{host:"api",method:"GET",path:"/v1/webhooks/subscriptions",query:e},t)}pauseSubscription(e,t){return this.core.request({host:"api",method:"POST",path:`/v1/webhooks/subscriptions/${s(e)}/pause`},t)}resumeSubscription(e,t){return this.core.request({host:"api",method:"POST",path:`/v1/webhooks/subscriptions/${s(e)}/resume`},t)}retryDelivery(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/webhooks/subscriptions/${s(e)}/deliveries/${s(t)}/retry`},r)}rotateSecret(e,t,r){return this.core.request({host:"api",method:"POST",path:`/v1/webhooks/subscriptions/${s(e)}/rotate-secret`,body:t},r)}updateSubscription(e,t,r){return this.core.request({host:"api",method:"PATCH",path:`/v1/webhooks/subscriptions/${s(e)}`,body:t},r)}}function B(i){return/^pontive_sk_(?:test|live)_([a-z0-9]+)_/.exec(i.trim())?.[1]}function Et(i){if(i)try{return/(?:^|\.)auth\.([a-z0-9]+)\./i.exec(new URL(i).hostname)?.[1]?.toLowerCase()}catch{return}}function C(i,e){try{const t=new URL(i);return t.hostname.toLowerCase().startsWith("api.")?(t.hostname=`${e}.${t.hostname.slice(4)}`,t.origin):i}catch{return i}}function $t(i){if(!i)return"";try{return new URL(i).origin}catch{return""}}const $=i=>i&&i.trim()?i.trim():void 0,k=i=>i.replace(/\/+$/,"");function bt(){const i=globalThis;return typeof i.window<"u"&&typeof i.document<"u"}class yt extends re{constructor(e={}){const t=e.env??b(),r=e.secretKey??$(t.PONTIVE_SECRET_KEY),o=e.issuer??$(t.PONTIVE_ISSUER),a=!!(e.clientId&&e.clientSecret);if(!e.token&&!r&&!a)throw new Error("pontive: no credential: pass secretKey, token, or clientId and clientSecret, or set PONTIVE_SECRET_KEY");if((r||e.clientSecret)&&bt())throw new Error("pontive: a secret key or client secret must never reach a browser; call the management API from your server");if(!e.token&&!r&&!o)throw new Error("pontive: client credentials need the issuer to exchange them at: pass issuer or set PONTIVE_ISSUER");let h=e.managementUrl??$(t.PONTIVE_MANAGEMENT_URL);if(!h){const q=e.region??(r&&!e.token?B(r):void 0)??$(t.PONTIVE_REGION)??Et(o);if(q)h=`https://api.${q}.pontive.com`;else if(!(e.token&&o))throw new Error("pontive: no region: pass region or managementUrl, or use a secret key, which names its region")}const n=h?P.managementBase(h):"",m={api:n,authz:e.authzUrl?k(e.authzUrl):n&&C(n,"authz"),ingest:e.ingestUrl?k(e.ingestUrl):n&&C(n,"ingest"),auth:$t(o)},l=e.fetch??globalThis.fetch.bind(globalThis),T=te({token:e.token??r,clientId:e.clientId,clientSecret:e.clientSecret,issuer:o,audience:P.managementAudience(n),fetch:l});super(new J({hosts:m,token:T.token,invalidate:T.invalidate,instanceId:e.instanceId??$(t.PONTIVE_INSTANCE_ID),maxRetries:Math.max(e.maxRetries??2,0),timeout:e.timeout??6e4,fetch:l}))}}exports.APIPromise=G;exports.AuthenticationError=L;exports.BadRequestError=z;exports.ConflictError=_;exports.InternalServerError=U;exports.NotFoundError=M;exports.PONTIVE_ENV=v;exports.Page=H;exports.PagePromise=S;exports.PermissionDeniedError=D;exports.Pontive=yt;exports.PontiveAPIError=c;exports.PontiveConnectionError=O;exports.PreconditionFailedError=R;exports.RateLimitError=x;exports.UnprocessableEntityError=N;exports.isDevelopment=I;exports.keylessApplies=j;exports.processEnv=b;exports.secretKeyRegion=B;exports.withEnvFallback=F;
|
|
2
|
-
//# sourceMappingURL=client-D80_tH4S.cjs.map
|