PageSourceSearch

https://tranchi.ai/assets/cBoFpEeOZ.js

js tranchi.ai collected 2026-10-05 13:07:55 UTC 198,791 bytes, 2 lines download raw bytes

1const Ge=(a,o,e)=>JSON.stringify(a,o,e);function lo(a,o){return JSON.parse(a,o)}class S extends Error{constructor({message:o,statusCode:e,body:n,rawResponse:i,cause:t}){super(Cn({message:o,statusCode:e,body:n})),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.statusCode=e,this.body=n,this.rawResponse=i,t!=null&&(this.cause=t)}}function Cn({message:a,statusCode:o,body:e}){const n=[];return a!=null&&n.push(a),o!=null&&n.push(`Status code: ${o.toString()}`),e!=null&&n.push(`Body: ${Ge(e,void 0,2)}`),n.join(`
2`)}class Pe extends Error{constructor(o,e){super(o),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,e?.cause!=null&&(this.cause=e.cause)}}class le extends S{constructor(o,e){super({message:"BadRequestError",statusCode:400,body:o,rawResponse:e}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}class bo extends S{constructor(o,e){super({message:"NotFoundError",statusCode:404,body:o,rawResponse:e}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}class K extends S{constructor(o,e){super({message:"TooManyRequestsError",statusCode:429,body:o,rawResponse:e}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}function Un(a){return typeof a=="object"&&a!==null&&"getAuthRequest"in a&&typeof a.getAuthRequest=="function"}class an{getAuthRequest(){return Promise.resolve({headers:{}})}}function An(a){const o=String.fromCodePoint(...a);return btoa(o)}function Ce(a){if(typeof Buffer<"u")return Buffer.from(a,"utf8").toString("base64");const o=new TextEncoder().encode(a);return An(o)}var zo=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};class Mn{constructor({tokenCallback:o,externalUserId:e}){if(!e)throw new Error("The external user ID cannot be blank");if(typeof o!="function")throw new Error("The token callback must be a function");this._externalUserId=e,this._tokenCallback=o}get externalUserId(){return this._externalUserId}getToken(){return zo(this,void 0,void 0,function*(){if(this._token&&this._tokenExpiresAt&&this._tokenExpiresAt>new Date)return this._token;if(this._tokenRequest)return this._tokenRequest;const o=this._tokenCallback,e=this._externalUserId;if(!o)throw new Error("No token callback provided");if(!e)throw new Error("No external user ID provided");return this._tokenRequest=zo(this,void 0,void 0,function*(){const{token:n,expiresAt:i}=yield o({externalUserId:e});return this._token=n,this._tokenExpiresAt=i,this._tokenRequest=void 0,n}),this._tokenRequest})}refresh(){this._token=void 0}}var $o=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};class zn{constructor({clientId:o,clientSecret:e,authClient:n}){this.BUFFER_IN_MINUTES=2,this._clientId=o,this._clientSecret=e,this._authClient=n,this._expiresAt=new Date}getToken(){return $o(this,void 0,void 0,function*(){return this._accessToken&&this._expiresAt>new Date?this._accessToken:this.refresh()})}refresh(){return $o(this,void 0,void 0,function*(){const o=yield this._authClient.create({clientId:yield b.get(this._clientId),clientSecret:yield b.get(this._clientSecret)});return this._accessToken=o.accessToken,this._expiresAt=this.getExpiresAt(o.expiresIn,this.BUFFER_IN_MINUTES),this._accessToken})}getExpiresAt(o,e){const n=new Date,i=o*1e3,t=e*60*1e3,d=t*2<i?t:Math.floor(i/2);return new Date(n.getTime()+i-d)}}var $n=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};const Be={get:(a,o)=>$n(void 0,void 0,void 0,function*(){return typeof a=="function"?a(o):a})},te={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},Ko={[te.Debug]:1,[te.Info]:2,[te.Warn]:3,[te.Error]:4};class sn{debug(o,...e){}info(o,...e){}warn(o,...e){}error(o,...e){}}class uo{constructor(o){this.level=Ko[o.level],this.logger=o.logger,this.silent=o.silent}shouldLog(o){return!this.silent&&this.level<=Ko[o]}isDebug(){return this.shouldLog(te.Debug)}debug(o,...e){this.isDebug()&&this.logger.debug(o,...e)}isInfo(){return this.shouldLog(te.Info)}info(o,...e){this.isInfo()&&this.logger.info(o,...e)}isWarn(){return this.shouldLog(te.Warn)}warn(o,...e){this.isWarn()&&this.logger.warn(o,...e)}isError(){return this.shouldLog(te.Error)}error(o,...e){this.isError()&&this.logger.error(o,...e)}}function ln(a){var o,e,n;return a==null?Kn:a instanceof uo?a:(a=a??{},(o=a.level)!==null&&o!==void 0||(a.level=te.Info),(e=a.logger)!==null&&e!==void 0||(a.logger=new sn),(n=a.silent)!==null&&n!==void 0||(a.silent=!0),new uo(a))}const Kn=new uo({level:te.Info,logger:new sn,silent:!0}),Vn={arrayFormat:"indices",encode:!0};function no(a,o){if(a===void 0||a===null)return"";const e=String(a);return o?encodeURIComponent(e):e}function co(a,o="",e){const n=[];for(const[i,t]of Object.entries(a)){const d=o?`${o}[${i}]`:i;if(t!==void 0)if(Array.isArray(t)){if(t.length===0)continue;const u=e.arrayFormat;if(u==="comma"){const c=e.encode?encodeURIComponent(d):d,s=t.filter(r=>r!=null).map(r=>no(r,e.encode));s.length>0&&n.push(`${c}=${s.join(",")}`)}else for(let c=0;c<t.length;c++){const s=t[c];if(s!==void 0)if(typeof s=="object"&&!Array.isArray(s)&&s!==null){const r=u==="indices"?`${d}[${c}]`:d;n.push(...co(s,r,e))}else{const r=u==="indices"?`${d}[${c}]`:d,l=e.encode?encodeURIComponent(r):r;n.push(`${l}=${no(s,e.encode)}`)}}}else if(typeof t=="object"&&t!==null){if(Object.keys(t).length===0)continue;n.push(...co(t,d,e))}else{const u=e.encode?encodeURIComponent(d):d;n.push(`${u}=${no(t,e.encode)}`)}}return n}function He(a,o){return a==null||typeof a!="object"?"":co(a,"",Object.assign(Object.assign({},Vn),o)).join("&")}function xe(a,o){const e=He(o,{arrayFormat:"repeat"});return e?`${a}?${e}`:a}function Nn(a){const o={get bodyUsed(){return a.bodyUsed},stream:()=>a.body,arrayBuffer:a.arrayBuffer.bind(a),blob:a.blob.bind(a)};return"bytes"in a&&typeof a.bytes=="function"&&(o.bytes=a.bytes.bind(a)),o}var Ln=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};function un(a,o){return Ln(this,void 0,void 0,function*(){switch(o){case"binary-response":return Nn(a);case"blob":return yield a.blob();case"arrayBuffer":return yield a.arrayBuffer();case"sse":return a.body==null?{ok:!1,error:{reason:"body-is-null",statusCode:a.status}}:a.body;case"streaming":return a.body==null?{ok:!1,error:{reason:"body-is-null",statusCode:a.status}}:a.body;case"text":return yield a.text()}const e=yield a.text();if(e.length>0)try{return lo(e)}catch{return{ok:!1,error:{reason:"non-json",statusCode:a.status,rawBody:e}}}})}var Dn=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};function Fn(a){return Dn(this,void 0,void 0,function*(){var o,e,n;let i=(o=a.headers.get("Content-Type"))===null||o===void 0?void 0:o.toLowerCase();if(i==null||i.length===0)return un(a);switch(i.indexOf(";")!==-1&&(i=(n=(e=i.split(";")[0])===null||e===void 0?void 0:e.trim())!==null&&n!==void 0?n:""),i){case"application/hal+json":case"application/json":case"application/ld+json":case"application/problem+json":case"application/vnd.api+json":case"text/json":{const t=yield a.text();return t.length>0?lo(t):void 0}default:if(i.startsWith("application/vnd.")&&i.endsWith("+json")){const t=yield a.text();return t.length>0?lo(t):void 0}return yield a.text()}})}var Wn=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};function Gn(){return Wn(this,void 0,void 0,function*(){return fetch})}var Bn=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};function Hn(a){return Bn(this,arguments,void 0,function*({body:o,type:e}){return e==="form"?He(o,{arrayFormat:"repeat",encode:!0}):e.includes("json")?Ge(o):o})}let ke;typeof globalThis.Headers<"u"?ke=globalThis.Headers:ke=class cn{constructor(o){if(this.headers=new Map,o)if(o instanceof cn)o.forEac
2h((e,n)=>this.append(n,e));else if(Array.isArray(o))for(const[e,n]of o)if(typeof e=="string"&&typeof n=="string")this.append(e,n);else throw new TypeError("Each header entry must be a [string, string] tuple");else for(const[e,n]of Object.entries(o))if(typeof n=="string")this.append(e,n);else throw new TypeError("Header values must be strings")}append(o,e){const n=o.toLowerCase(),i=this.headers.get(n)||[];this.headers.set(n,[...i,e])}delete(o){const e=o.toLowerCase();this.headers.delete(e)}get(o){const e=o.toLowerCase(),n=this.headers.get(e);return n?n.join(", "):null}has(o){const e=o.toLowerCase();return this.headers.has(e)}set(o,e){const n=o.toLowerCase();this.headers.set(n,[e])}forEach(o,e){const n=e?o.bind(e):o;this.headers.forEach((i,t)=>n(i.join(", "),t,this))}getSetCookie(){return this.headers.get("set-cookie")||[]}*entries(){for(const[o,e]of this.headers.entries())yield[o,e.join(", ")]}*keys(){yield*this.headers.keys()}*values(){for(const o of this.headers.values())yield o.join(", ")}[Symbol.iterator](){return this.entries()}};const Jn="timeout";function Qn(a){const o=new AbortController,e=setTimeout(()=>o.abort(Jn),a);return{signal:o.signal,abortId:e}}function Xn(...a){const o=a.length===1&&Array.isArray(a[0])?a[0]:a,e=new AbortController;for(const n of o){if(n.aborted){e.abort(n?.reason);break}n.addEventListener("abort",()=>e.abort(n?.reason),{signal:e.signal})}return e.signal}var Yn=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};let Ue;function Zn(){if(Ue!=null)return Ue;try{new Request("http://localhost",{cache:"no-store"}),Ue=!0}catch{Ue=!1}return Ue}const On=(a,o,e,n,i,t,d,u,c,s)=>Yn(void 0,void 0,void 0,function*(){const r=[];let l;if(t!=null){const{signal:g,abortId:f}=Qn(t);l=f,r.push(g)}d!=null&&r.push(d);const _=Xn(r),h=yield a(o,Object.assign({method:e,headers:n,body:i,signal:_,credentials:u?"include":void 0,duplex:c},s&&Zn()?{cache:"no-store"}:{}));return l!=null&&clearTimeout(l),h}),Vo={headers:new ke,redirected:!1,status:499,statusText:"Client Closed Request",type:"error",url:""},No={headers:new ke,redirected:!1,status:0,statusText:"Unknown Error",type:"error",url:""};function Lo(a){return{headers:a.headers,redirected:a.redirected,status:a.status,statusText:a.statusText,type:a.type,url:a.url}}var qn=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};const et=1e3,Ve=6e4,ot=2,vn=.2;function nt(a){return[408,429].includes(a)||a>=500}function tt(a){const o=1+Math.random()*vn;return a*o}function it(a){const o=1+(Math.random()-.5)*vn;return a*o}function rt(a,o){const e=a.headers.get("Retry-After");if(e){const i=parseInt(e,10);if(!Number.isNaN(i)&&i>0)return Math.min(i*1e3,Ve);const t=new Date(e);if(!Number.isNaN(t.getTime())){const d=t.getTime()-Date.now();if(d>0)return Math.min(Math.max(d,0),Ve)}}const n=a.headers.get("X-RateLimit-Reset");if(n){const i=parseInt(n,10);if(!Number.isNaN(i)){const t=i*1e3-Date.now();if(t>0)return tt(Math.min(t,Ve))}}return it(Math.min(et*Math.pow(2,o),Ve))}function dt(a){return qn(this,arguments,void 0,function*(o,e=ot){let n=yield o();for(let i=0;i<e&&nt(n.status);++i){const t=rt(n,i);yield new Promise(d=>setTimeout(d,t)),n=yield o()}return n})}var vo=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};const at=new Set(["authorization","www-authenticate","x-api-key","api-key","apikey","x-api-token","x-auth-token","auth-token","cookie","set-cookie","proxy-authorization","proxy-authenticate","x-csrf-token","x-xsrf-token","x-session-token","x-access-token"]);function to(a){const o={};for(const[e,n]of a instanceof ke?a.entries():Object.entries(a))at.has(e.toLowerCase())?o[e]="[REDACTED]":o[e]=n;return o}const ho=new Set(["api_key","api-key","apikey","token","access_token","access-token","auth_token","auth-token","password","passwd","secret","api_secret","api-secret","apisecret","key","session","session_id","session-id"]);function st(a){if(a==null)return;const o={};for(const[e,n]of Object.entries(a))o[e]=ho.has(e.toLowerCase())?"[REDACTED]":n;return o}function _e(a){const o=a.indexOf("://");if(o===-1)return a;const e=o+3,n=a.indexOf("/",e);let i=a.indexOf("?",e),t=a.indexOf("#",e);const d=Math.min(n===-1?a.length:n,i===-1?a.length:i,t===-1?a.length:t);let u=-1;for(let g=e;g<d;g++)a[g]==="@"&&(u=g);if(u!==-1&&(a=`${a.slice(0,e)}[REDACTED]@${a.slice(u+1)}`),i=a.indexOf("?"),i===-1)return a;t=a.indexOf("#",i);const c=t!==-1?t:a.length,s=a.slice(i+1,c);if(s.length===0)return a;const r=s.toLowerCase();if(!(r.includes("token")||r.includes("key")||r.includes("password")||r.includes("passwd")||r.includes("secret")||r.includes("session")||r.includes("auth")))return a;const _=[],h=s.split("&");for(const g of h){const f=g.indexOf("=");if(f===-1){_.push(g);continue}const v=g.slice(0,f);let P=ho.has(v.toLowerCase());if(!P&&v.includes("%"))try{const R=decodeURIComponent(v);P=ho.has(R.toLowerCase())}catch{}_.push(P?`${v}=[REDACTED]`:g)}return a.slice(0,i+1)+_.join("&")+a.slice(c)}function lt(a){return vo(this,void 0,void 0,function*(){var o;const e=new ke;if(e.set("Accept",a.responseType==="json"?"application/json":a.responseType==="text"?"text/plain":a.responseType==="sse"?"text/event-stream":"*/*"),a.body!==void 0&&a.contentType!=null&&e.set("Content-Type",a.contentType),a.headers==null)return e;for(const[n,i]of Object.entries(a.headers)){const t=yield Be.get(i,{endpointMetadata:(o=a.endpointMetadata)!==null&&o!==void 0?o:{}});if(typeof t=="string"){e.set(n,t);continue}t!=null&&e.set(n,`${t}`)}return e})}function ut(a){return vo(this,void 0,void 0,function*(){var o,e,n;let i=a.url;a.queryString!=null&&a.queryString.length>0?i=`${i}?${a.queryString}`:i=xe(a.url,a.queryParameters);const t=yield Hn({body:a.body,type:(o=a.requestType)!==null&&o!==void 0?o:"other"}),d=(e=a.fetchFn)!==null&&e!==void 0?e:yield Gn(),u=yield lt(a),c=ln(a.logging);if(c.isDebug()){const s={method:a.method,url:_e(i),headers:to(u),queryParameters:st(a.queryParameters),hasBody:t!=null};c.debug("Making HTTP request",s)}try{const s=yield dt(()=>vo(this,void 0,void 0,function*(){return On(d,i,a.method,u,t,a.timeoutMs,a.abortSignal,a.withCredentials,a.duplex,a.responseType==="streaming"||a.responseType==="sse")}),a.maxRetries);if(s.status>=200&&s.status<400){if(c.isDebug()){const l={method:a.method,url:_e(i),statusCode:s.status,responseHeaders:to(s.headers)};c.debug("HTTP request succeeded",l)}return{ok:!0,body:yield un(s,a.responseType),headers:s.headers,rawResponse:Lo(s)}}else{if(c.isError()){const r={method:a.method,url:_e(i),statusCode:s.status,responseHeaders:to(Object.fromEntries(s.headers.entries()))};c.error("HTTP request failed with error status",r)}return{ok:!1,error:{reason:"status-code",statusCode:s.status,body:yield Fn(s)},rawResponse:Lo(s)}}}catch(s){if(!((n=a.abortSignal)===null||n===void 0)&&n.aborted){if(c.isError()){const r={method:a.method,url:_e(i)};c.error("HTTP request was aborted",r)}return{ok:!1,error:{reason:"unknown",errorMessage:"The user aborted a request",cause:s},rawResponse:Vo}}else if(s instanceof Error&&s.name==="AbortError"){if(c.isError()){const r={method:a.method,url:_e(i),timeoutMs:a.timeoutMs};c.error("HTTP request timed out",r)}return{ok:!1,error:{reason:"timeout",cause:s},rawResponse:Vo}}else if(s instanceof Error){if(c.isError()){const r={method:a.method,url:_e(i),errorMessage:s.message};c.error("HTTP request failed with error",r)}return{ok:!1,error:{reason:"unknown",errorMessage:s.message,cause:s},rawResponse:No}}if(c.isError()){const r={method:a.method,url:_e(i),error:Ge(s)};c.error("HTTP request failed with unknown error",r)}return{ok:!1,error:{reason:"unknown",errorMessage:Ge(s),cause:s},rawResponse:No}}})}const A=ut;var ct=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};class I extends Promise{constructor(o){super(e=>{e(void 0)}),this.innerPromise=o}static fromFunction(o,...e){return new I(o(...e))}static interceptFunction(o){return(...e)=>I.fromPromise(o(...e))}static fromPromise(o){return new I(o)}static fromExecutor(o){const e=new Promise(o);return new I(e)}static fromResult(o){const e=Promise.resolve(o);return new I(e)}unwrap(){return this.unwrappedPromise||(this.unwrappedPromise=this.innerPromise.then(({data:o})=>o)),this.unwrappedPromise}then(o,e){return this.unwrap().then(o,e)}catch(o){return this.unwrap().catch(o)}finally(o){return this.unwrap().finally(o)}withRawResponse(){return ct(this,void 0,void 0,function*(){return yield this.innerPromise})}}function $(a,...o){if(!a)return"";if(o.length===0)return a;
2if(a.includes("://")){let e;try{e=new URL(a)}catch{return Do(a,...o)}const n=o[o.length-1],i=n?.endsWith("/");for(const t of o){const d=_n(t);d&&(e.pathname=hn(e.pathname,d))}return i&&!e.pathname.endsWith("/")&&(e.pathname+="/"),e.toString()}return Do(a,...o)}function Do(a,...o){if(o.length===0)return a;let e=a;const n=o[o.length-1],i=n?.endsWith("/");for(const t of o){const d=_n(t);d&&(e=hn(e,d))}return i&&!e.endsWith("/")&&(e+="/"),e}function hn(a,o){return a.endsWith("/")?a+o:`${a}/${o}`}function _n(a){if(!a)return a;let o=0,e=a.length;return a.startsWith("/")&&(o=1),a.endsWith("/")&&(e=a.length-1),o===0&&e===a.length?a:a.slice(o,e)}var vt=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};const b={get:a=>vt(void 0,void 0,void 0,function*(){return typeof a=="function"?a():a})};var ht=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})},se=function(a){return this instanceof se?(this.v=a,this):new se(a)},Fo=function(a,o,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(a,o||[]),i,t=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",d),i[Symbol.asyncIterator]=function(){return this},i;function d(h){return function(g){return Promise.resolve(g).then(h,l)}}function u(h,g){n[h]&&(i[h]=function(f){return new Promise(function(v,P){t.push([h,f,v,P])>1||c(h,f)})},g&&(i[h]=g(i[h])))}function c(h,g){try{s(n[h](g))}catch(f){_(t[0][3],f)}}function s(h){h.value instanceof se?Promise.resolve(h.value.v).then(r,l):_(t[0][2],h)}function r(h){c("next",h)}function l(h){c("throw",h)}function _(h,g){h(g),t.shift(),t.length&&c(t[0][0],t[0][1])}},_t=function(a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=a[Symbol.asyncIterator],e;return o?o.call(a):(a=typeof __values=="function"?__values(a):a[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(t){e[t]=a[t]&&function(d){return new Promise(function(u,c){d=a[t](d),i(u,c,d.done,d.value)})}}function i(t,d,u,c){Promise.resolve(c).then(function(s){t({value:s,done:u})},d)}};class ie{constructor({response:o,rawResponse:e,hasNextPage:n,getItems:i,loadPage:t}){this.response=o,this.rawResponse=e,this.data=i(o),this._hasNextPage=n,this.getItems=i,this.loadNextPage=t}getNextPage(){return ht(this,void 0,void 0,function*(){const{data:o,rawResponse:e}=yield this.loadNextPage(this.response).withRawResponse();return this.response=o,this.rawResponse=e,this.data=this.getItems(this.response),this})}hasNextPage(){return this._hasNextPage(this.response)}iterMessages(){return Fo(this,arguments,function*(){for(const e of this.data)yield yield se(e);for(;this.hasNextPage();){yield se(this.getNextPage());for(const e of this.data)yield yield se(e)}})}[Symbol.asyncIterator](){return Fo(this,arguments,function*(){var e,n,i,t;try{for(var d=!0,u=_t(this.iterMessages()),c;c=yield se(u.next()),e=c.done,!e;d=!0)t=c.value,d=!1,yield yield se(t)}catch(s){n={error:s}}finally{try{!d&&!e&&(i=u.return)&&(yield se(i.call(u)))}finally{if(n)throw n.error}}})}}const Je=pt();function pt(){var a,o,e,n,i;if(typeof window<"u"&&typeof window.document<"u")return{type:"browser",version:window.navigator.userAgent};if(typeof globalThis<"u"&&((a=globalThis?.navigator)===null||a===void 0?void 0:a.userAgent)==="Cloudflare-Workers")return{type:"workerd"};if(typeof EdgeRuntime=="string")return{type:"edge-runtime"};if(typeof self=="object"&&typeof self?.importScripts=="function"&&(((o=self.constructor)===null||o===void 0?void 0:o.name)==="DedicatedWorkerGlobalScope"||((e=self.constructor)===null||e===void 0?void 0:e.name)==="ServiceWorkerGlobalScope"||((n=self.constructor)===null||n===void 0?void 0:n.name)==="SharedWorkerGlobalScope"))return{type:"web-worker"};if(typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u")return{type:"deno",version:Deno.version.deno};if(typeof Bun<"u"&&typeof Bun.version<"u")return{type:"bun",version:Bun.version};if(typeof navigator<"u"&&navigator?.product==="ReactNative")return{type:"react-native"};const _=typeof process<"u"?process:void 0;return typeof _<"u"&&typeof((i=_.versions)===null||i===void 0?void 0:i.node)=="string"?{type:"node",version:_.versions.node,parsedVersion:Number(_.versions.node.split(".")[0])}:{type:"unknown"}}const J={DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",RECORD:"record",UNDISCRIMINATED_UNION:"undiscriminatedUnion",NULLABLE:"nullable",OPTIONAL:"optional",OPTIONAL_NULLABLE:"optionalNullable"};function O(a,o){return`Expected ${o}. Received ${ft(a)}.`}function ft(a){if(Array.isArray(a))return"list";if(a===null)return"null";if(a instanceof BigInt)return"BigInt";switch(typeof a){case"string":return`"${a}"`;case"bigint":case"number":case"boolean":case"undefined":return`${a}`}return typeof a}function Ee(a){return Object.assign(Object.assign({},a),{json:Wo(a.json),parse:Wo(a.parse)})}function Wo(a){return(o,e)=>{const n=a(o,e),{skipValidation:i=!1}
2=e??{};return!n.ok&&i?{ok:!0,value:o}:n}}function pn(a){return a.path.length===0?a.message:`${a.path.join(" -> ")}: ${a.message}`}class gt extends Error{constructor(o){super(o.map(pn).join("; ")),this.errors=o,Object.setPrototypeOf(this,new.target.prototype),this.name=this.constructor.name}}class mt extends Error{constructor(o){super(o.map(pn).join("; ")),this.errors=o,Object.setPrototypeOf(this,new.target.prototype),this.name=this.constructor.name}}function q(a){return{nullable:()=>yt(a),optional:()=>wt(a),optionalNullable:()=>bt(a),transform:o=>Rt(a,o),parseOrThrow:(o,e)=>{const n=a.parse(o,e);if(n.ok)return n.value;throw new mt(n.errors)},jsonOrThrow:(o,e)=>{const n=a.json(o,e);if(n.ok)return n.value;throw new gt(n.errors)}}}function yt(a){const o={parse:(e,n)=>e==null?{ok:!0,value:null}:a.parse(e,n),json:(e,n)=>e==null?{ok:!0,value:null}:a.json(e,n),getType:()=>J.NULLABLE};return Object.assign(Object.assign({},o),q(o))}function wt(a){const o={parse:(e,n)=>e==null?{ok:!0,value:void 0}:a.parse(e,n),json:(e,n)=>n?.omitUndefined&&e===void 0?{ok:!0,value:void 0}:e==null?{ok:!0,value:null}:a.json(e,n),getType:()=>J.OPTIONAL};return Object.assign(Object.assign({},o),q(o))}function bt(a){const o={parse:(e,n)=>e===void 0?{ok:!0,value:void 0}:e===null?{ok:!0,value:null}:a.parse(e,n),json:(e,n)=>e===void 0?{ok:!0,value:void 0}:e===null?{ok:!0,value:null}:a.json(e,n),getType:()=>J.OPTIONAL_NULLABLE};return Object.assign(Object.assign({},o),q(o))}function Rt(a,o){const e={parse:(n,i)=>{const t=a.parse(n,i);return t.ok?{ok:!0,value:o.transform(t.value)}:t},json:(n,i)=>{const t=o.untransform(n);return a.json(t,i)},getType:()=>a.getType()};return Object.assign(Object.assign({},e),q(e))}const jt=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;function oe(){const a={parse:(o,{breadcrumbsPrefix:e=[]}={})=>typeof o!="string"?{ok:!1,errors:[{path:e,message:O(o,"string")}]}:jt.test(o)?{ok:!0,value:new Date(o)}:{ok:!1,errors:[{path:e,message:O(o,"ISO 8601 date string")}]},json:(o,{breadcrumbsPrefix:e=[]}={})=>o instanceof Date?{ok:!0,value:o.toISOString()}:{ok:!1,errors:[{path:e,message:O(o,"Date object")}]},getType:()=>J.DATE};return Object.assign(Object.assign({},Ee(a)),q(a))}function Te(a,o){return()=>{const e={parse:o,json:o,getType:()=>a};return Object.assign(Object.assign({},Ee(e)),q(e))}}function Z(a){const o=new Set(a);return Te(J.ENUM,(n,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:t=[]}={})=>typeof n!="string"?{ok:!1,errors:[{path:t,message:O(n,"string")}]}:!o.has(n)&&!i?{ok:!1,errors:[{path:t,message:O(n,"enum")}]}:{ok:!0,value:n})()}function Go(a){return Object.entries(a)}function _o(a,o){const e=new Set(o);return Object.entries(a).reduce((n,[i,t])=>(e.has(i)&&(n[i]=t),n),{})}function oo(a){if(typeof a!="object"||a===null)return!1;const o=Object.getPrototypeOf(a);return o===null?!0:Object.getPrototypeOf(o)===null}function fn(a){return Object.keys(a)}function Pt(a,o){const e=[],n=[];for(const i of a)o(i)?e.push(i):n.push(i);return[e,n]}const xt=Object.prototype.hasOwnProperty;function Qe(a){return{withParsedProperties:o=>kt(a,o)}}function kt(a,o){const e={parse:(n,i)=>{const t=a.parse(n,i);if(!t.ok)return t;const d={};for(const u in o)if(xt.call(o,u)){const c=o[u];d[u]=typeof c=="function"?c(t.value):c}return{ok:!0,value:Object.assign(Object.assign({},t.value),d)}},json:(n,i)=>{var t;if(!oo(n))return{ok:!1,errors:[{path:(t=i?.breadcrumbsPrefix)!==null&&t!==void 0?t:[],message:O(n,"object")}]};const d=new Set(Object.keys(o)),u=_o(n,Object.keys(n).filter(c=>!d.has(c)));return a.json(u,i)},getType:()=>a.getType()};return Object.assign(Object.assign(Object.assign({},e),q(e)),Qe(e))}function w(a,o){return{rawKey:a,valueSchema:o,isProperty:!0}}function me(a){return a.isProperty}const St=Object.prototype.hasOwnProperty;function x(a){let o;function e(){if(o==null){o={};for(const[_,h]of Go(a)){const g=me(h)?h.rawKey:_,f=me(h)?h.valueSchema:h;o[g]={rawKey:g,parsedKey:_,valueSchema:f}}}return o}let n,i,t,d;function u(){if(n==null){n=[],i=[];
2for(const[_,h]of Go(a)){const g=me(h)?h.rawKey:_,f=me(h)?h.valueSchema:h;Et(f)&&(n.push(g),i.push(_))}t=new Set(n),d=new Set(i)}return n}function c(){return i==null&&u(),i}function s(){return t==null&&u(),t}function r(){return d==null&&u(),d}const l={_getRawProperties:()=>Object.entries(a).map(([_,h])=>me(h)?h.rawKey:_),_getParsedProperties:()=>fn(a),parse:(_,h)=>{var g;const f=(g=h?.breadcrumbsPrefix)!==null&&g!==void 0?g:[];return Bo({value:_,requiredKeys:u(),requiredKeysSet:s(),getProperty:v=>{const P=e()[v];if(P!=null)return{transformedKey:P.parsedKey,transform:R=>{const j=[...f,v];return P.valueSchema.parse(R,Object.assign(Object.assign({},h),{breadcrumbsPrefix:j}))}}},unrecognizedObjectKeys:h?.unrecognizedObjectKeys,skipValidation:h?.skipValidation,breadcrumbsPrefix:f,omitUndefined:h?.omitUndefined})},json:(_,h)=>{var g;const f=(g=h?.breadcrumbsPrefix)!==null&&g!==void 0?g:[];return Bo({value:_,requiredKeys:c(),requiredKeysSet:r(),getProperty:v=>{const P=a[v];if(P!=null)return me(P)?{transformedKey:P.rawKey,transform:R=>{const j=[...f,v];return P.valueSchema.json(R,Object.assign(Object.assign({},h),{breadcrumbsPrefix:j}))}}:{transformedKey:v,transform:R=>{const j=[...f,v];return P.json(R,Object.assign(Object.assign({},h),{breadcrumbsPrefix:j}))}}},unrecognizedObjectKeys:h?.unrecognizedObjectKeys,skipValidation:h?.skipValidation,breadcrumbsPrefix:f,om
2itUndefined:h?.omitUndefined})},getType:()=>J.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},Ee(l)),q(l)),Qe(l)),po(l))}function Bo({value:a,requiredKeys:o,requiredKeysSet:e,getProperty:n,unrecognizedObjectKeys:i="fail",skipValidation:t=!1,breadcrumbsPrefix:d=[]}){if(!oo(a))return{ok:!1,errors:[{path:d,message:O(a,"object")}]};let u=o.length;const c=[],s={};for(const r in a){if(!St.call(a,r))continue;const l=a[r],_=n(r);if(_!=null){u>0&&e.has(r)&&u--;const h=_.transform(l);h.ok?s[_.transformedKey]=h.value:(s[r]=l,c.push(...h.errors))}else switch(i){case"fail":c.push({path:[...d,r],message:`Unexpected key "${r}"`});break;case"strip":break;case"passthrough":s[r]=l;break}}if(u>0)for(const r of o)r in a||c.push({path:d,message:`Missing required key "${r}"`});return c.length===0||t?{ok:!0,value:s}:{ok:!1,errors:c}}function po(a){return{extend:o=>{const e={_getParsedProperties:()=>[...a._getParsedProperties(),...o._getParsedProperties()],_getRawProperties:()=>[...a._getRawProperties(),...o._getRawProperties()],parse:(n,i)=>Ho({extensionKeys:o._getRawProperties(),value:n,transformBase:t=>a.parse(t,i),transformExtension:t=>o.parse(t,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>Ho({extensionKeys:o._getParsedProperties(),value:n,transformBase:t=>a.json(t,i),transformExtension:t=>o.json(t,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>J.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},e),q(e)),Qe(e)),po(e))},passthrough:()=>{const o=new Set(a._getRawProperties()),e=new Set(a._getParsedProperties()),n={_getParsedProperties:()=>a._getParsedProperties(),_getRawProperties:()=>a._getRawProperties(),parse:(i,t)=>{const d=a.parse(i,Object.assign(Object.assign({},t),{unrecognizedObjectKeys:"passthrough"}));if(!d.ok)return d;const u={};if(typeof i=="object"&&i!=null)for(const[c,s]of Object.entries(i))o.has(c)||(u[c]=s);return{ok:!0,value:Object.assign(Object.assign({},u),d.value)}},json:(i,t)=>{const d=a.json(i,Object.assign(Object.assign({},t),{unrecognizedObjectKeys:"passthrough"}));if(!d.ok)return d;const u={};if(typeof i=="object"&&i!=null)for(const[c,s]of Object.entries(i))e.has(c)||(u[c]=s);return{ok:!0,value:Object.assign(Object.assign({},u),d.value)}},getType:()=>J.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},n),q(n)),Qe(n)),po(n))}}}function Ho({extensionKeys:a,value:o,transformBase:e,transformExtension:n,breadcrumbsPrefix:i=[]}){if(!oo(o))return{ok:!1,errors:[{path:i,message:O(o,"object")}]};const t=new Set(a),[d,u]=Pt(fn(o),r=>t.has(r)),c=e(_o(o,u)),s=n(_o(o,d));return c.ok&&s.ok?{ok:!0,value:Object.assign(Object.assign({},c.value),s.value)}:{ok:!1,errors:[...c.ok?[]:c.errors,...s.ok?[]:s.errors]}}function Et(a){return!Tt(a)}function Tt(a){switch(a.getType()){case J.ANY:case J.UNKNOWN:case J.OPTIONAL:case J.OPTIONAL_NULLABLE:return!0;default:return!1}}function L(a){const o={parse:(e,n)=>Jo(e,(i,t)=>{var d;return a.parse(i,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(d=n?.breadcrumbsPrefix)!==null&&d!==void 0?d:[],`[${t}]`]}))}),json:(e,n)=>Jo(e,(i,t)=>{var d;return a.json(i,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(d=n?.breadcrumbsPrefix)!==null&&d!==void 0?d:[],`[${t}]`]}))}),getType:()=>J.LIST};return Object.assign(Object.assign({},Ee(o)),q(o))}function Jo(a,o){if(!Array.isArray(a))return{ok:!1,errors:[{message:O(a,"list"),path:[]}]};const e=[],n=[];for(let i=0;i<a.length;i++){const t=o(a[i],i);t.ok?e.push(t.value):n.push(...t.errors)}return n.length===0?{ok:!0,value:e}:{ok:!1,errors:n}}function H(a){return Te(J.STRING_LITERAL,(e,{breadcrumbsPrefix:n=[]}={})=>e===a?{ok:!0,value:a}:{ok:!1,errors:[{path:n,message:O(e,`"${a}"`)}]})()}const m=Te(J.BOOLEAN,(a,{breadcrumbsPrefix:o=[]}={})=>typeof a=="boolean"?{ok:!0,value:a}:{ok:!1,errors:[{path:o,message:O(a,"boolean")}]}),F=Te(J.NUMBER,(a,{breadcrumbsPrefix:o=[]}={})=>typeof a=="number"?{ok:!0,value:a}:{ok:!1,errors:[{path:o,message:O(a,"number")}]}),p=Te(J.STRING,(a,{breadcrumbsPrefix:o=[]}={})=>typeof a=="string"?{ok:!0,value:a}:{ok:!1,errors:[{path:o,message:O(a,"string")}]}),Y=Te(J.UNKNOWN,a=>({ok:!0,value:a})),It=Object.prototype.hasOwnProperty;function ne(a,o){const e={parse:(n,i)=>Qo({value:n,isKeyNumeric:a.getType()===J.NUMBER,transformKey:t=>{var d;return a.parse(t,Object.assign(Object.assign({},i),{breadcrumbsPrefix:[...(d=i?.breadcrumbsPrefix)!==null&&d!==void 0?d:[],`${t} (key)`]}))},transformValue:(t,d)=>{var u;return o.parse(t,Object.assign(Object.assign({},i),{breadcrumbsPrefix:[...(u=i?.breadcrumbsPrefix)!==null&&u!==void 0?u:[],`${d}`]}))},breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>Qo({value:n,isKeyNumeric:a.getType()===J.NUMBER,transformKey:t=>{var d;return a.json(t,Object.assign(Object.assign({},i),{breadcrumbsPrefix:[...(d=i?.breadcrumbsPrefix)!==null&&d!==void 0?d:[],`${t} (key)`]}))},transformValue:(t,d)=>{var u;return o.json(t,Object.assign(Object.assign({},i),{breadcrumbsPrefix:[...(u=i?.breadcrumbsPrefix)!==null&&u!==void 0?u:[],`${d}`]}))},breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>J.RECORD};return Object.assign(Object.assign({},Ee(e)),q(e))}function Qo({value:a,isKeyNumeric:o,transformKey:e,transformValue:n,breadcrumbsPrefix:i=[]}){if(!oo(a))return{ok:!1,errors:[{path:i,message:O(a,"object")}]};const t={},d=[];for(const u in a){if(!It.call(a,u))continue;const c=a[u];if(c===void 0)continue;let s=u;if(o){const _=u.length>0?Number(u):NaN;Number.isNaN(_)||(s=_)}const r=e(s),l=n(c,s);r.ok&&l.ok?t[r.value]=l.value:(r.ok||d.push(...r.errors),l.ok||d.push(...l.errors))}return d.length===0?{ok:!0,value:t}:{ok:!1,errors:d}}function X(a){const o={parse:(e,n)=>Xo((i,t)=>i.parse(e,t),a,n),json:(e,n)=>Xo((i,t)=>i.json(e,t),a,n),getType:()=>J.UNDISCRIMINATED_UNION};return Object.assign(Object.assign({},Ee(o)),q(o))}function Xo(a,o,e){const n=[];for(const[i,t]of o.entries()){const d=a(t,Object.assign(Object.assign({},e),{skipValidation:!1}));if(d.ok)return d;for(const u of d.errors)n.push({path:u.path,message:`[Variant ${i}] ${u.message}`})}return{ok:!1,errors:n}}function T(a){if(a===null)return"null";switch(typeof a){case"undefined":return"undefined";case"string":case"number":case"boolean":break;default:a=String(a);break}return encodeURIComponent(a)}function V(){return new Ct}class Ct{constructor(){this.parts=new Map}add(o,e,n){if(e==null)return this;const i=He({[o]:e},{arrayFormat:n?.style==="comma"?"comma":"repeat"});return i.length>0&&this.parts.set(o,i),this}addMany(o){if(o!=null)for(const[e,n]of Object.entries(o))this.add(e,n);return this}mergeAdditional(o){if(o!=null)for(const[e,n]of Object.entries(o)){if(n==null)continue;const i=He({[e]:n},{arrayFormat:"repeat"});i.length>0&&this.parts.set(e,i)}return this}build(){return[...this.parts.values()].join("&")}}function re(a,o,e){if(a==null)return a;const n=o.split(".");if(n.length===0)return a;let i=a;for(let d=0;d<n.length-1;d++){const u=n[d];u!=null&&((!i[u]||typeof i[u]!="object")&&(i[u]={}),i=i[u])}const t=n[n.length-1];return t==null||(i[t]=e),a}function C(...a){const o={};for(const[e,n]of a.filter(i=>i!=null).flatMap(i=>Object.entries(i))){const i=e.toLowerCase();n!=null?o[i]=n:i in o&&delete o[i]}return o}function M(...a){const o={};for(const[e,n]of a.filter(i=>i!=null).flatMap(i=>Object.entries(i))){const i=e.toLowerCase();n!=null&&(o[i]=n)}return o}var io=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};class Ut{constructor(o){var e;this._options=o,this.workflowDomain=(e=o.workflowDomain)!==null&&e!==void 0?e:this._defaultWorkflowDomain}get _defaultWorkflowDomain(){return"m.pipedream.net"}get _urlProtocol(){return"https"}invoke(o,e=ge.None,n){return I.fromPromise(this.__invoke(o,e,n))}__invoke(o){return io(this,arguments,void 0,function*(e,n=ge.None,i){var t;const{urlOrEndpoint:d,body:u,method:c="POST",headers:s={}}=e,r=this._buildWorkflowUrl(d);let l;switch(n){case ge.StaticBearer:l=s.Authorization;break;case ge.OAuth:l=yield this._getAuthorizationHeader();break}const _=yield A({url:r,method:c.toUpperCase(),headers:C((t=this._options)===null||t===void 0?void 0:t.headers,M({Authorization:l,"x-pd-environment":i?.projectEnvironment}),s,i?.headers),contentType:u!=null?"application/json":void 0,queryParameters:i?.queryParams,requestType:u!=null?"json":void 0,body:u,timeoutMs:i?.timeoutInSeconds!=null?i.timeoutInSeconds*1e3:6e4,maxRetries:i?.maxRetries,abortSignal:i?.abortSignal});if(!_.ok)throw new S({message:_.error.reason,statusCode:_.rawResponse.status,rawResponse:_.rawResponse});return{data:_.rawResponse,rawResponse:_.rawResponse}})}invokeForExternalUser(o,e){return I.fromPromise(this.__invokeForExternalUser(o,e))}__invokeForExternalUser(o,e){return io(this,void 0,void 0,function*(){const{urlOrEndpoint:n,externalUserId:i,body:t,method:d,headers:u={}}=o;if(!i?.trim())throw new Error("External user ID is required");if(!n.trim())throw new Error("Workflow URL or endpoint ID is required");if(!(yield this._getAuthorizationHeader()))throw new Error("OAuth or token is required for invoking workflows for external users. Please pass credentials for a valid OAuth client");return this.__invoke({urlOrEndpoint:n,body:t,method:d,headers:Object.assign(Object.assign({},u),{"X-PD-External-User-ID":i})},ge.OAuth,e)})}_buildWorkflowUrl(o){const e=o.trim().replace(/[^\w-./:]/g,"").toLowerCase();if(!e)throw new Error("URL or endpoint ID is required");let n;if(e.includes(".")||e.startsWith("http")){let t;try{const d=e.startsWith("http")?e:`https://${e}`;t=new URL(d)}catch{throw new Error(`The provided URL is malformed: "${e}". Please provide a valid URL.`)}if(!t.hostname.endsWith(this.workflowDomain))throw new Error(`Invalid workflow domain. URL must end with ${this.workflowDomain}`);n=t.href}else{if(!/^e(n|o)[a-z0-9-]+$/i.test(e))throw new Error('Invalid endpoint ID format. Must contain only letters, numbers, and hyphens, and start with either "en" or "eo".');n=`${this._urlProtocol}://${e}.${this.workflowDomain}`}return n}_getAuthorizationHeader(){return io(this,void 0,void 0,function*(){const o=yield b.get(this._options.token);if(o!=null)return`Bearer ${o}`})}}var ge;(function(a){a.None="none",a.StaticBearer="static_bearer_token",a.OAuth="oauth"})(ge||(ge={}));const Ae={Development:"development",Production:"production"},z={Prod:"https://api.pipedream.com"},Yo="3.1.4";function N(a,o,e,n){switch(a.reason){case"non-json":throw new S({statusCode:a.statusCode,body:a.rawBody,rawResponse:o});case"body-is-null":throw new S({statusCode:a.statusCode,rawResponse:o});case"timeout":throw new Pe(`Timeout exceeded when calling ${e} ${n}.`,{cause:a.cause});case"unknown":throw new S({message:a.errorMessage,rawResponse:o,cause:a.cause});default:throw new S({message:"Unknown error",rawResponse:o})}}const At=x({appSlug:w("app_slug",p()),cfmapJson:w("cfmap_json",p()),connectToken:w("connect_token",p()),name:p().optional(),accountId:w("account_id",p().optional())}),Mt=x({oauthClientId:w("oauth_client_id",p().optional()),oauthAccessToken:w("oauth_access_token",p().optional()),oauthRefreshToken:w("oauth_refresh_token",p().optional()),oauthUid:w("oauth_uid",p().optional()),oauthSignerUri:w("oauth_signer_uri",p().optional())}).passthrough(),gn=p(),mn=Z(["keys","oauth","none"]),zt=Z(["read_only","read_write","admin"]),yn=x({name:zt,scopes:L(p())}),Ke=x({id:p().optional(),nameSlug:w("name_slug",p()),name:p(),authType:w("auth_type",mn.optional()),description:p().optional(),imgSrc:w("img_src",p()),customFieldsJson:w("custom_fields_json",p().optional()),categories:L(p()),featuredWeight:w("featured_weight",F()),scopeProfiles:w("scope_profiles",L(yn))}),Xe=x({id:gn,name:p().optional(),externalId:w("external_id",p().optional()),healthy:m().optional(),dead:m().optional(),app:Ke.optional(),createdAt:w("created_at",oe().optional()),updatedAt:w("updated_at",oe().optional()),authorizedScopes:w("authorized_scopes",L(p()).optional()),credentials:Mt.optional(),expiresAt:w("expires_at",oe().optional()),error:p().optional(),lastRefreshedAt:w("last_refreshed_at",oe().optional()),nextRefreshAt:w("next_refresh_at",oe().optional())}),$t=L(Xe),wn=Y(),Kt=x({authProvisionId:gn}),bn=m(),Ro=F(),Rn=ne(p(),Y()),jn=x({value:p(),query:p(),params:L(p()),usePreparedStatements:m()}
2),jo=p(),Vt=L(p()),Nt=X([Kt,bn,Ro,jn,jo,Vt,Rn,wn]),Ie=ne(p(),Nt),Pn=p().optional(),Lt=X([Pn.optional(),H("NEW"),m()]),Dt=x({id:p(),version:p().optional(),externalUserId:w("external_user_id",p()),configuredProps:w("configured_props",Ie.optional()),dynamicPropsId:w("dynamic_props_id",p().optional()),stashId:w("stash_id",Lt.optional())}),Ft=Z(["public","private","all"]),Wt=x({app:p(),name:p(),oauthAppId:w("oauth_app_id",p().optional()),cfmap:ne(p(),Y()).optional()}),Gt=x({name:p().optional(),oauthAppId:w("oauth_app_id",p().optional()),cfmap:ne(p(),Y()).optional()}),Bt=Z(["asc","desc"]),Ht=Z(["name","name_slug","featured_weight"]),Jt=Z(["public","private","all"]),Qt=x({active:m().optional(),configuredProps:w("configured_props",Ie.optional()),name:p().optional(),emitOnDeploy:w("emit_on_deploy",m().optional())}),Xt=x({webhookUrls:w("webhook_urls",L(p()))}),Yt=x({workflowIds:w("workflow_ids",L(p()))}),Zt=x({app:p(),clientId:w("client_id",p()),clientSecret:w("client_secret",p()),name:p().optional(),description:p().optional(),scopes:L(p()).optional(),additionalScopes:w("additional_scopes",L(p()).optional())}),Ot=x({name:p().optional(),description:p().optional(),clientId:w("client_id",p().optional()),clientSecret:w("client_secret",p().optional()),scopes:L(p()).optional(),additionalScopes:w("additional_scopes",L(p()).optional())}),qt=x({clientId:w("client_id",p()),clientSecret:w("client_secret",p()),scope:p().optional()}),ei=x({url:p()}),oi=x({name:p(),appName:w("app_name",p().optional()),supportEmail:w("support_email",p().optional()),connectRequireKeyAuthTest:w("connect_require_key_auth_test",m().optional())}),ni=x({logo:p()}),ti=x({name:p().optional(),appName:w("app_name",p().optional()),supportEmail:w("support_email",p().optional()),connectRequireKeyAuthTest:w("connect_require_key_auth_test",m().optional())}),ii=ne(p(),Y()),ri=ne(p(),Y()),di=ne(p(),Y()),ai=x({allowedOrigins:w("allowed_origins",L(p()).optional()),errorRedirectUri:w("error_redirect_uri",p().optional()),expiresIn:w("expires_in",F().optional()),externalUserId:w("external_user_id",p()),scope:p().optional(),successRedirectUri:w("success_redirect_uri",p().optional()),webhookUri:w("webhook_uri",p().optional()),allowProgressiveScopes:w("allow_progressive_scopes",m().optional())}),si=x({id:p(),version:p().optional(),externalUserId:w("external_user_id",p()),configuredProps:w("configured_props",Ie.optional()),dynamicPropsId:w("dynamic_props_id",p().optional()),workflowId:w("workflow_id",p().optional()),webhookUrl:w("webhook_url",p().optional()),emitOnDeploy:w("emit_on_deploy",m().optional())}),li=Z(["public","private","all"]),xn=x({id:p().optional(),name:p().optional(),description:p().optional()}),De=x({id:p(),name:p(),app:Ke,oauthAppId:w("oauth_app_id",p().optional()),cfmap:ne(p(),Y()),ownerId:w("owner_id",p()),createdAt:w("created_at",oe().optional()),updatedAt:w("updated_at",oe().optional())}),ui=Z(["optional","required"]),ci=x({type:H("$.airtable.baseId"),appProp:p(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),vi=x({type:H("$.airtable.fieldId"),tableIdProp:p(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),hi=x({type:H("$.airtable.tableId"),baseIdProp:p(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),_i=x({type:H("$.airtable.viewId"),tableIdProp:p(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),pi=Z(["info","neutral","warning","error"]),fi=x({type:H("alert"),alertType:pi.optional(),content:p(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),ue=X([p(),F(),m()]),de=x({label:p(),value:ue.optional()}),ce=x({lv:w("__lv",de)}),gi=X([de,ce,ue.optional()]),mi=x({type:H("any"),default:wn.optional(),options:L(gi).optional(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),yi=x({type:H("app"),app:p(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),wi=x({type:H("$.interface.apphook"),appProp:p(),eventNames:L(p()).optional(),remote:m().optional(),static:L(Y()).optional(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),bi=X([de,ce,ue.optional()]),Ri=x({type:H("boolean"),default:bn.optional(),options:L(bi).optional(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),ji=x({type:H("data_store"),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),Pi=x({type:H("$.service.db"),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),xi=Z(["read","write","read-write"]),ki=x({type:H("dir"),accessMode:xi.optional(),sync:m().optional(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),Si=x({type:H("$.discord.channel"),appProp:p(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),Ei=x({type:H("$.discord.channel[]"),appProp:p().optional(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),Ti=x({type:H("$.interface.http"),customResponse:m().optional(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),Ii=Z(["basic","bearer","none"]),Ci=x({type:Ii.optional(),username:p().optional(),password:p().optional(),token:p().optional()}
2),Ui=Z(["fields","raw"]),Ai=Z(["fields","raw"]),fo=x({name:p(),value:p()}),Mi=x({type:Ai.optional(),contentType:p().optional(),fields:L(fo).optional(),mode:Ui.optional(),raw:p().optional()}),zi=x({auth:Ci.optional(),body:Mi.optional(),headers:L(fo).optional(),params:L(fo).optional(),tab:p().optional(),method:p().optional(),url:p().optional()}),$i=x({type:H("http_request"),default:zi.optional(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),Ki=X([de,ce,ue.optional()]),Vi=x({type:H("integer"),min:F().optional(),max:F().optional(),default:Ro.optional(),options:L(Ki).optional(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),Ni=X([de,ce,ue.optional()]),Li=x({type:H("integer[]"),min:F().optional(),max:F().optional(),default:L(Ro).optional(),options:L(Ni).optional(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),Di=X([de,ce,ue.optional()]),Fi=x({type:H("object"),default:Rn.optional(),options:L(Di).optional(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),Wi=x({app:p().optional()}),Gi=X([de,ce,ue.optional()]),Bi=x({type:H("sql"),auth:Wi.optional(),default:jn.optional(),options:L(Gi).optional(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),kn=Z(["file-ref"]),Hi=X([de,ce,ue.optional()]),Ji=x({type:H("string"),secret:m().optional(),format:kn.optional(),default:jo.optional(),options:L(Hi).optional(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),Qi=X([de,ce,ue.optional()]),Xi=x({type:H("string[]"),secret:m().optional(),format:kn.optional(),default:L(jo).optional(),options:L(Qi).optional(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),Po=x({cron:p()}),xo=x({intervalSeconds:F()}),Yi=X([xo,Po]),Zi=X([xo,Po]),Oi=X([xo,Po]),qi=x({type:H("$.interface.timer"),static:Oi.optional(),default:Yi.optional(),options:L(Zi.optional()).optional(),name:p(),label:p().optional(),description:p().optional(),optional:m().optional(),disabled:m().optional(),readOnly:m().optional(),hidden:m().optional(),remoteOptions:m().optional(),useQuery:m().optional(),reloadProps:m().optional(),withLabel:m().optional()}),ko=X([fi,yi,Ri,ji,ki,qi,wi,Li,Ti,$i,Pi,Bi,ci,hi,_i,vi,Si,Ei,Vi,Ji,Xi,Fi,mi]),er=x({destructiveHint:m().optional(),idempotentHint:m().optional(),openWorldHint:m().optional(),readOnlyHint:m().optional(),title:p().optional()}),Sn=x({key:p(),name:p(),version:p(),configurableProps:w("configurable_props",L(ko)),description:p().optional(),componentType:w("component_type",p().optional()),stash:ui.optional(),annotations:er.optional()}),or=Z(["trigger","action"]),nr=X([de,ce]),tr=L(nr).optional(),So=x({id:p(),version:p().optional(),externalUserId:w("external_user_id",p()),propName:w("prop_name",p()),blocking:m().optional(),configuredProps:w("configured_props",Ie.optional()),dynamicPropsId:w("dynamic_props_id",p().optional()),page:F().optional(),prevContext:w("prev_context",ne(p(),Y()).optional()),query:p().optional()}),ir=x({name:p().optional(),message:p().optional(),stack:p().optional()}),Eo=x({err:ir.optional(),k:p(),msg:p().optional(),ts:F()}),To=x({options:tr.optional(),stringOptions:L(p()).optional(),observations:L(Eo).optional(),context:ne(p(),Y()).optional(),errors:L(p()).optional()}),En=p(),rr=x({creditsUsed:w("credits_used",F()),actionRunCreditsUsed:w("action_run_credits_used",F().optional()),proxyCreditsUsed:w("proxy_credits_used",F().optional()),sourceEmitCreditsUsed:w("source_emit_credits_used",F().optional()),usageStartTs:w("usage_start_ts",F()),usageEndTs:w("usage_end_ts",F())}),dr=x({data:L(rr)}),ar=x({accessToken:w("access_token",p()),tokenType:w("token_type",p()),expiresIn:w("expires_in",F())}),sr=x({connectLinkUrl:w("connect_link_url",p()),expiresAt:w("expires_at",oe()),token:En}),lr=x({id:p(),ownerId:w("owner_id",p()),componentId:w("component_id",p()),componentKey:w("component_key",p().optional()),configurableProps:w("configurable_props",L(ko)),configuredProps:w("configured_props",Ie),active:m(),createdAt:w("created_at",F()),updatedAt:w("updated_at",F()),name:p(),nameSlug:w("name_slug",p()),callbackObservations:w("callback_observations",Y().optional()),emitOnDeploy:w("emit_on_deploy",m().optional()),type:H("DeployedComponent"),webhookSigningKey:w("webhook_signing_key",p().optional())}),ur=x({id:p(),key:p(),endpointUrl:w("endpoint_url",p()),customResponse:w("custom_response",m()),createdAt:w("created_at",F()),updatedAt:w("updated_at",F()),type:H("HttpInterface")}),cr=x({id:p(),intervalSeconds:w("interval_seconds",F().optional()),cron:p().optional(),timezone:p(),scheduleChangedAt:w("schedule_changed_at",F()),createdAt:w("created_at",F()),updatedAt:w("updated_at",F()),type:H("TimerInterface")}),Io=X([lr,ur,cr]),vr=x({data:Io}),hr=x({id:p().optional(),configurableProps:L(ko).optional()}),_r=x({e:ne(p(),Y()),k:p(),ts:F(),id:p(),sum:p().optional()}),pr=Z(["email","http","source","timer"]),fr=x({id:p(),externalId:w("external_id",p()),createdAt:w("created_at",oe().optional()),updatedAt:w("updated_at",oe().optional())}),he=x({count:F().optional(),totalCount:w("total_count",F().optional()),startCursor:w("start_cursor",p().optional()),endCursor:w("end_cursor",p().optional())}),gr=xn,mr=x({data:Ke}),Co=x({data:Sn}),Uo=x({data:L(Sn),pageInfo:w("page_info",he)}),yr=x({data:L(_r)}),Zo=x({data:Io}),wr=x({data:L(Io),pageInfo:w("page_info",he)}),br=x({id:p(),url:p(),signingKey:w("signing_key",p().optional()),signingKeySet:w("signing_key_set",m())}),Oo=x({webhookUrls:w("webhook_urls",L(p())),webhooks:L(br).optional()}),qo=x({workflowIds:w("workflow_ids",L(p()))}),Rr=x({data:L(fr),pageInfo:w("page_info",he)}),jr=x({id:p(),url:p(),signingKeySet:w("signing_key_set",m()),createdAt:w("created_at",F()),updatedAt:w("updated_at",F())}),Pr=x({data:jr.optional()}),xr=x({id:p(),url:p(),signingKey:w("signing_key",p()),signingKeySet:w("signing_key_set",m()),createdAt:w("created_at",F()),updatedAt:w("updated_at",F())}),go=x({data:xr}),kr=x({data:L(Xe),pageInfo:w("page_info",he)}),Sr=L(xn),Er=x({data:L(De),pageInfo:w("page_info",he)}),Tr=x({data:L(Ke),pageInfo:w("page_info",he)}),Fe=x({id:p().optional(),clientId:w("client_id",p()),scopes:L(p()).optional(),additionalScopes:w("additional_scopes",L(p()).optional()),redirectUri:w("redirect_uri",p().optional()),ownerId:w("owner_id",p()),createdAt:w("created_at",oe().optional()),updatedAt:w("updated_at",oe().optional()),nameSlug:w("name_slug",p()),name:p(),authType:w("auth_type",mn.optional()),description:p().optional(),imgSrc:w("img_src",p()),customFieldsJson:w("custom_fields_json",p().optional()),categories:L(p()),featuredWeight:w("featured_weight",F()),scopeProfiles:w("scope_profiles",L(yn))}),Ir=x({data:L(Fe),pageInfo:w("page_info",he)}),We=x({id:p(),name:p(),appName:w("app_name",p().optional()),supportEmail:w("support_email",p().optional()),connectRequireKeyAuthTest:w("connect_require_key_auth_test",m().optional())}),Cr=x({data:L(We),pageInfo:w("page_info",he)}),Ur=x({id:p().optional(),nameSlug:w("name_slug",p().optional())}),Ar=x({apps:L(Ur)}),Me=Y(),Ao=x({id:p(),version:p().optional(),externalUserId:w("external_user_id",p()),blocking:m().optional(),configuredProps:w("configured_props",Ie.optional()),dynamicPropsId:w("dynamic_props_id",p().optional())}),Mo=x({observations:L(Eo).optional(),errors:L(p()).optional(),dynamicProps:hr.optional()}),Mr=x({exports:ne(p(),Y()).optional(),os:L(Eo).optional(),ret:Y().optional(),stashId:w("stash_id",Pn.optional())}),zr=x({id:p(),url:p(),signingKey:w("signing_key",p().optional()),signingKeySet:w("signing_key_set",m()),createdAt:w("created_at",F()),updatedAt:w("updated_at",F())}),$r=x({data:zr}),Kr=x({app:Ke.optional(),error:p().optional(),errorRedirectUri:w("error_redirect_uri",p().optional()),oauthAppId:w("oauth_app_id",p().optional()),oauthAppWorkdayOfficial:w("oauth_app_workday_official",m().optional()),projectAppName:w("project_app_name",p().optional()),projectEnvironment:w("project_environment",p().optional()),projectId:w("project_id",p().optional()),projectSupportEmail:w("project_support_email",p().optional()),success:m(),successRedirectUri:w("success_redirect_uri",p().optional())});var Vr=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};class mo{constructor(o){this._options=Q(o)}create(o,e){return I.fromPromise(this.__create(o,e))}__create(o,e){return Vr(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=C((n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),f=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,"v1/oauth/token"),method:"POST",headers:g,contentType:"application/json",queryString:V().mergeAdditional(e?.queryParams).build(),requestType:"json",body:Object.assign(Object.assign({},qt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:!0})),{grant_type:"client_credentials"}),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(f.ok)return{data:ar.parseOrThrow(f.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:f.rawResponse};if(f.error.reason==="status-code")switch(f.error.statusCode){case 429:throw new K(f.error.body,f.rawResponse);default:throw new S({statusCode:f.error.statusCode,body:f.error.body,rawResponse:f.rawResponse})}return N(f.error,f.rawResponse,"POST","/v1/oauth/token")})}}var Ne={},fe=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};const Ye="clientId",Ze="clientSecret",Oe="token",qe="PIPEDREAM_CLIENT_ID",eo="PIPED
2REAM_CLIENT_SECRET",Nr=`${Ye} is required; either pass it as an argument or set the ${qe} environment variable`,Lr=`${Ze} is required; either pass it as an argument or set the ${eo} environment variable`,Dr=`${Oe} is required. Please provide it in options.`,Fr=2;class yo{constructor(o){this.options=o,this.authClient=new mo(o),this.expiresAt=new Date}static canCreate(o){var e,n;return(o?.[Ye]!=null||((e=Ne)===null||e===void 0?void 0:e[qe])!=null)&&(o?.[Ze]!=null||((n=Ne)===null||n===void 0?void 0:n[eo])!=null)}clientIdSupplier(){return fe(this,arguments,void 0,function*({endpointMetadata:o}={}){var e;const n=this.options[Ye];if(n!=null)return Be.get(n,{endpointMetadata:o});const i=(e=Ne)===null||e===void 0?void 0:e[qe];if(i!=null)return i;throw new S({message:Nr})})}clientSecretSupplier(){return fe(this,arguments,void 0,function*({endpointMetadata:o}={}){var e;const n=this.options[Ze];if(n!=null)return Be.get(n,{endpointMetadata:o});const i=(e=Ne)===null||e===void 0?void 0:e[eo];if(i!=null)return i;throw new S({message:Lr})})}getAuthRequest(){return fe(this,arguments,void 0,function*({endpointMetadata:o}={}){return{headers:{Authorization:`Bearer ${yield this.getToken({endpointMetadata:o})}`}}})}getToken(){return fe(this,arguments,void 0,function*({endpointMetadata:o}={}){return this.accessToken&&this.expiresAt>new Date?this.accessToken:this.refreshPromise!=null?this.refreshPromise:this.refresh({endpointMetadata:o})})}refresh(){return fe(this,arguments,void 0,function*({endpointMetadata:o}={}){return this.refreshPromise=fe(this,void 0,void 0,function*(){try{const e=yield this.clientIdSupplier({endpointMetadata:o}),n=yield this.clientSecretSupplier({endpointMetadata:o}),i=yield this.authClient.create({clientId:e,clientSecret:n});return this.accessToken=i.accessToken,this.expiresAt=this.getExpiresAt(i.expiresIn,Fr),this.accessToken}finally{this.refreshPromise=void 0}}),this.refreshPromise})}getExpiresAt(o,e){const n=new Date;return new Date(n.getTime()+o*1e3-e*60*1e3)}}class en{constructor(o){this.options=o}static canCreate(o){return o?.[Oe]!=null}getAuthRequest(){return fe(this,arguments,void 0,function*({endpointMetadata:o}={}){const e=this.options[Oe];if(e==null)throw new S({message:Dr});return{headers:{Authorization:`Bearer ${yield Be.get(e,{endpointMetadata:o})}`}}})}}(function(a){a.AUTH_SCHEME="OAuth",a.AUTH_CONFIG_ERROR_MESSAGE=`Insufficient options to create OAuthAuthProvider. Please provide either '${Ye}' or '${qe}' env var and '${Ze}' or '${eo}' env var, or ${Oe}.`;function o(e){if(en.canCreate(e))return new en(e);if(a.canCreate(e))return new a(e);throw new S({message:a.AUTH_CONFIG_ERROR_MESSAGE})}a.createInstance=o})(yo||(yo={}));function Wr(a){const o=C({"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"@pipedream/sdk","X-Fern-SDK-Version":"3.1.4","User-Agent":"@pipedream/sdk/3.1.4","X-Fern-Runtime":Je.type,"X-Fern-Runtime-Version":Je.version,"x-pd-environment":a?.projectEnvironment},a?.headers);return Object.assign(Object.assign({},a),{logging:ln(a?.logging),headers:o})}function Q(a){var o;const e=Wr(a);if(a.auth===!1)return e.authProvider=new an,e;if(a.auth!=null){if(typeof a.auth=="function")return e.authProvider={getAuthRequest:a.auth},e;if(Un(a.auth))return e.authProvider=a.auth,e;Object.assign(e,a.auth)}const n=Gr(e);return(o=e.authProvider)!==null&&o!==void 0||(e.authProvider=yo.createInstance(n)),e}function Gr(a){return Object.assign(Object.assign({},a),{authProvider:new an})}var pe=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})},Br=function(a,o){var e={};for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&o.indexOf(n)<0&&(e[n]=a[n]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(a);i<n.length;i++)o.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(a,n[i])&&(e[n[i]]=a[n[i]]);return e};class Hr{constructor(o){this._options=Q(o)}list(){return pe(this,arguments,void 0,function*(o={},e){const n=I.interceptFunction(t=>pe(this,void 0,void 0,function*(){var d,u,c,s,r,l,_,h,g,f,v;const{externalUserId:P,oauthAppId:R,after:j,before:y,limit:D,app:W,includeCredentials:G}
2=t,U={external_user_id:P,oauth_app_id:R,after:j,before:y,limit:D,app:W,include_credentials:G},E=yield this._options.authProvider.getAuthRequest(),k=C(E.headers,(d=this._options)===null||d===void 0?void 0:d.headers,M({"x-pd-environment":(u=e?.projectEnvironment)!==null&&u!==void 0?u:(c=this._options)===null||c===void 0?void 0:c.projectEnvironment}),e?.headers),B=yield A({url:$((r=(s=yield b.get(this._options.baseUrl))!==null&&s!==void 0?s:yield b.get(this._options.environment))!==null&&r!==void 0?r:z.Prod,`v1/connect/${T(this._options.projectId)}/accounts`),method:"GET",headers:k,queryString:V().addMany(U).mergeAdditional(e?.queryParams).build(),timeoutMs:((h=(l=e?.timeoutInSeconds)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.timeoutInSeconds)!==null&&h!==void 0?h:60)*1e3,maxRetries:(g=e?.maxRetries)!==null&&g!==void 0?g:(f=this._options)===null||f===void 0?void 0:f.maxRetries,abortSignal:e?.abortSignal,fetchFn:(v=this._options)===null||v===void 0?void 0:v.fetch,logging:this._options.logging});if(B.ok)return{data:kr.parseOrThrow(B.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:B.rawResponse};if(B.error.reason==="status-code")switch(B.error.statusCode){case 429:throw new K(B.error.body,B.rawResponse);default:throw new S({statusCode:B.error.statusCode,body:B.error.body,rawResponse:B.rawResponse})}return N(B.error,B.rawResponse,"GET","/v1/connect/{project_id}/accounts")})),i=yield n(o).withRawResponse();return new ie({response:i.data,rawResponse:i.rawResponse,hasNextPage:t=>t?.pageInfo.endCursor!=null&&!(typeof t?.pageInfo.endCursor=="string"&&t?.pageInfo.endCursor===""),getItems:t=>{var d;return(d=t?.data)!==null&&d!==void 0?d:[]},loadPage:t=>n(re(o,"after",t?.pageInfo.endCursor))})})}create(o,e){return I.fromPromise(this.__create(o,e))}__create(o,e){return pe(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const{externalUserId:g,oauthAppId:f}=o,v=Br(o,["externalUserId","oauthAppId"]),P={external_user_id:g,oauth_app_id:f},R=yield this._options.authProvider.getAuthRequest(),j=C(R.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),y=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/accounts`),method:"POST",headers:j,contentType:"application/json",queryString:V().addMany(P).mergeAdditional(e?.queryParams).build(),requestType:"json",body:At.jsonOrThrow(v,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(y.ok)return{data:Xe.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 429:throw new K(y.error.body,y.rawResponse);default:throw new S({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return N(y.error,y.rawResponse,"POST","/v1/connect/{project_id}/accounts")})}retrieve(o,e={},n){return I.fromPromise(this.__retrieve(o,e,n))}__retrieve(o){return pe(this,arguments,void 0,function*(e,n={},i){var t,d,u,c,s,r,l,_,h,g,f;const{includeCredentials:v}=n,P={include_credentials:v},R=yield this._options.authProvider.getAuthRequest(),j=C(R.headers,(t=this._options)===null||t===void 0?void 0:t.headers,M({"x-pd-environment":(d=i?.projectEnvironment)!==null&&d!==void 0?d:(u=this._options)===null||u===void 0?void 0:u.projectEnvironment}),i?.headers),y=yield A({url:$((s=(c=yield b.get(this._options.baseUrl))!==null&&c!==void 0?c:yield b.get(this._options.environment))!==null&&s!==void 0?s:z.Prod,`v1/connect/${T(this._options.projectId)}/accounts/${T(e)}`),method:"GET",headers:j,queryString:V().addMany(P).mergeAdditional(i?.queryParams).build(),timeoutMs:((_=(r=i?.timeoutInSeconds)!==null&&r!==void 0?r:(l=this._options)===null||l===void 0?void 0:l.timeoutInSeconds)!==null&&_!==void 0?_:60)*1e3,maxRetries:(h=i?.maxRetries)!==null&&h!==void 0?h:(g=this._options)===null||g===void 0?void 0:g.maxRetries,abortSignal:i?.abortSignal,fetchFn:(f=this._options)===null||f===void 0?void 0:f.fetch,logging:this._options.logging});if(y.ok)return{data:Xe.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 429:throw new K(y.error.body,y.rawResponse);default:throw new S({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return N(y.error,y.rawResponse,"GET","/v1/connect/{project_id}/accounts/{account_id}")})}delete(o,e){return I.fromPromise(this.__delete(o,e))}__delete(o,e){return pe(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/accounts/${T(o)}`),method:"DELETE",headers:f,queryString:V().mergeAdditional(e?.queryParams).build(),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:void 0,rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"DELETE","/v1/connect/{project_id}/accounts/{account_id}")})}deleteByApp(o,e){return I.fromPromise(this.__deleteByApp(o,e))}__deleteByApp(o,e){return pe(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/apps/${T(o)}/accounts`),method:"DELETE",headers:f,queryString:V().mergeAdditional(e?.queryParams).build(),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:void 0,rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"DELETE","/v1/connect/{project_id}/apps/{app_id}/accounts")})}listByExternalUser(o,e={},n){return I.fromPromise(this.__listByExternalUser(o,e,n))}__listByExternalUser(o){return pe(this,arguments,void 0,function*(e,n={},i){var t,d,u,c,s,r,l,_,h,g,f;const{includeCredentials:v,app:P}=n,R={include_credentials:v,app:P},j=yield this._options.authProvider.getAuthRequest(),y=C(j.headers,(t=this._options)===null||t===void 0?void 0:t.headers,M({"x-pd-environment":(d=i?.projectEnvironment)!==null&&d!==void 0?d:(u=this._options)===null||u===void 0?void 0:u.projectEnvironment}),i?.headers),D=yield A({url:$((s=(c=yield b.get(this._options.baseUrl))!==null&&c!==void 0?c:yield b.get(this._options.environment))!==null&&s!==void 0?s:z.Prod,`v1/connect/${T(this._options.projectId)}/users/${T(e)}/accounts`),method:"GET",headers:y,queryString:V().addMany(R).mergeAdditional(i?.queryParams).build(),timeoutMs:((_=(r=i?.timeoutInSeconds)!==null&&r!==void 0?r:(l=this._options)===null||l===void 0?void 0:l.timeoutInSeconds)!==null&&_!==void 0?_:60)*1e3,maxRetries:(h=i?.maxRetries)!==null&&h!==void 0?h:(g=this._options)===null||g===void 0?void 0:g.maxRetries,abortSignal:i?.abortSignal,fetchFn:(f=this._options)===null||f===void 0?void 0:f.fetch,logging:this._options.logging});if(D.ok)return{data:$t.parseOrThrow(D.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:D.rawResponse};if(D.error.reason==="status-code")switch(D.error.statusCode){case 429:throw new K(D.error.body,D.rawResponse);default:throw new S({statusCode:D.error.statusCode,body:D.error.body,rawResponse:D.rawResponse})}return N(D.error,D.rawResponse,"GET","/v1/connect/{project_id}/users/{external_user_id}/accounts")})}}var ye=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};class Jr{constructor(o){this._options=Q(o)}list(){return ye(this,arguments,void 0,function*(o={},e){const n=I.interceptFunction(t=>ye(this,void 0,void 0,function*(){var d,u,c,s,r,l,_,h,g,f,v;const{after:P,before:R,limit:j,q:y,app:D,registry:W}=t,G={after:P,before:R,limit:j,q:y,app:D,registry:W!=null?Ft.jsonOrThrow(W,{unrecognizedObjectKeys:"strip",omitUndefined:!0}):void 0},U=yield this._options.authProvider.getAuthRequest(),E=C(U.headers,(d=this._options)===null||d===void 0?void 0:d.headers,M({"x-pd-environment":(u=e?.projectEnvironment)!==null&&u!==void 0?u:(c=this._options)===null||c===void 0?void 0:c.projectEnvironment}),e?.headers),k=yield A({url:$((r=(s=yield b.get(this._options.baseUrl))!==null&&s!==void 0?s:yield b.get(this._options.environment))!==null&&r!==void 0?r:z.Prod,`v1/connect/${T(this._options.projectId)}/actions`),method:"GET",headers:E,queryString:V().addMany(G).mergeAdditional(e?.queryParams).build(),timeoutMs:((h=(l=e?.timeoutInSeconds)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.timeoutInSeconds)!==null&&h!==void 0?h:60)
2*1e3,maxRetries:(g=e?.maxRetries)!==null&&g!==void 0?g:(f=this._options)===null||f===void 0?void 0:f.maxRetries,abortSignal:e?.abortSignal,fetchFn:(v=this._options)===null||v===void 0?void 0:v.fetch,logging:this._options.logging});if(k.ok)return{data:Uo.parseOrThrow(k.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:k.rawResponse};if(k.error.reason==="status-code")switch(k.error.statusCode){case 400:throw new le(k.error.body,k.rawResponse);case 429:throw new K(k.error.body,k.rawResponse);default:throw new S({statusCode:k.error.statusCode,body:k.error.body,rawResponse:k.rawResponse})}return N(k.error,k.rawResponse,"GET","/v1/connect/{project_id}/actions")})),i=yield n(o).withRawResponse();return new ie({response:i.data,rawResponse:i.rawResponse,hasNextPage:t=>t?.pageInfo.endCursor!=null&&!(typeof t?.pageInfo.endCursor=="string"&&t?.pageInfo.endCursor===""),getItems:t=>{var d;return(d=t?.data)!==null&&d!==void 0?d:[]},loadPage:t=>n(re(o,"after",t?.pageInfo.endCursor))})})}retrieve(o,e={},n){return I.fromPromise(this.__retrieve(o,e,n))}__retrieve(o){return ye(this,arguments,void 0,function*(e,n={},i){var t,d,u,c,s,r,l,_,h,g,f;const{version:v}=n,P={version:v},R=yield this._options.authProvider.getAuthRequest(),j=C(R.headers,(t=this._options)===null||t===void 0?void 0:t.headers,M({"x-pd-environment":(d=i?.projectEnvironment)!==null&&d!==void 0?d:(u=this._options)===null||u===void 0?void 0:u.projectEnvironment}),i?.headers),y=yield A({url:$((s=(c=yield b.get(this._options.baseUrl))!==null&&c!==void 0?c:yield b.get(this._options.environment))!==null&&s!==void 0?s:z.Prod,`v1/connect/${T(this._options.projectId)}/actions/${T(e)}`),method:"GET",headers:j,queryString:V().addMany(P).mergeAdditional(i?.queryParams).build(),timeoutMs:((_=(r=i?.timeoutInSeconds)!==null&&r!==void 0?r:(l=this._options)===null||l===void 0?void 0:l.timeoutInSeconds)!==null&&_!==void 0?_:60)*1e3,maxRetries:(h=i?.maxRetries)!==null&&h!==void 0?h:(g=this._options)===null||g===void 0?void 0:g.maxRetries,abortSignal:i?.abortSignal,fetchFn:(f=this._options)===null||f===void 0?void 0:f.fetch,logging:this._options.logging});if(y.ok)return{data:Co.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 429:throw new K(y.error.body,y.rawResponse);default:throw new S({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return N(y.error,y.rawResponse,"GET","/v1/connect/{project_id}/actions/{component_id}")})}configureProp(o,e){return I.fromPromise(this.__configureProp(o,e))}__configureProp(o,e){return ye(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/actions/configure`),method:"POST",headers:f,contentType:"application/json",queryString:V().mergeAdditional(e?.queryParams).build(),requestType:"json",body:So.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:To.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"POST","/v1/connect/{project_id}/actions/configure")})}reloadProps(o,e){return I.fromPromise(this.__reloadProps(o,e))}__reloadProps(o,e){return ye(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/actions/props`),method:"POST",headers:f,contentType:"application/json",queryString:V().mergeAdditional(e?.queryParams).build(),requestType:"json",body:Ao.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:Mo.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"POST","/v1/connect/{project_id}/actions/props")})}run(o,e){return I.fromPromise(this.__run(o,e))}__run(o,e){return ye(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/actions/run`),method:"POST",headers:f,contentType:"application/json",queryString:V().mergeAdditional(e?.queryParams).build(),requestType:"json",body:Dt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:Mr.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"POST","/v1/connect/{project_id}/actions/run")})}}var on=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};class Qr{constructor(o){this._options=Q(o)}list(o){return I.fromPromise(this.__list(o))}__list(o){return on(this,void 0,void 0,function*(){var e,n,i,t,d,u,c,s,r,l,_;const h=yield this._options.authProvider.getAuthRequest(),g=C(h.headers,(e=this._options)===null||e===void 0?void 0:e.headers,M({"x-pd-environment":(n=o?.projectEnvironment)!==null&&n!==void 0?n:(i=this._options)===null||i===void 0?void 0:i.projectEnvironment}),o?.headers),f=yield A({url:$((d=(t=yield b.get(this._options.baseUrl))!==null&&t!==void 0?t:yield b.get(this._options.environment))!==null&&d!==void 0?d:z.Prod,"v1/connect/app_categories"),method:"GET",headers:g,queryString:V().mergeAdditional(o?.queryParams).build(),timeoutMs:((s=(u=o?.timeoutInSeconds)!==null&&u!==void 0?u:(c=this._options)===null||c===void 0?void 0:c.timeoutInSeconds)!==null&&s!==void 0?s:60)*1e3,maxRetries:(r=o?.maxRetries)!==null&&r!==void 0?r:(l=this._options)===null||l===void 0?void 0:l.maxRetries,abortSignal:o?.abortSignal,fetchFn:(_=this._options)===null||_===void 0?void 0:_.fetch,logging:this._options.logging});if(f.ok)return{data:Sr.parseOrThrow(f.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:f.rawResponse};if(f.error.reason==="status-code")throw new S({statusCode:f.error.statusCode,body:f.error.body,rawResponse:f.rawResponse});return N(f.error,f.rawResponse,"GET","/v1/connect/app_categories")})}retrieve(o,e){return I.fromPromise(this.__retrieve(o,e))}__retrieve(o,e){return on(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/app_categories/${T(o)}`),method:"GET",headers:f,queryString:V().mergeAdditional(e?.queryParams).build(),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:gr.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse});return N(v.error,v.rawResponse,"GET","/v1/connect/app_categories/{id}")})}}var we=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};class Xr{constructor(o){this._options=Q(o)}list(){return we(this,arguments,void 0,function*(o={},e){const n=I.interceptFunction(t=>we(this,void 0,void 0,function*(){var d,u,c,s,r,l,_,h,g,f,v;const{after:P,before:R,limit:j,app:y}=t,D={after:P,before:R,limit:j,app:y},W=yield this._options.authProvider.getAuthRequest(),G=C(W.headers,(d=this._options)===null||d===void 0?void 0:d.headers,M({"x-pd-environment":(u=e?.projectEnvironment)!==null&&u!==void 0?u:(c=this._options)===null||c===void 0?void 0:c.projectEnvironment}),e?.headers),U=yield A({url:$((r=(s=yield b.get(this._options.baseUrl))!==null&&s!==void 0?s:yield b.get(this._options.environment))!==null&&r!==void 0?r:z.Prod,`v1/connect/${T(this._options.projectId)}/app_overrides`),method:"GET",headers:G,queryString:V().addMany(D).mergeAdditional(e?.queryParams).build(),timeoutMs:((h=(l=e?.timeoutInSeconds)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.timeoutInSeconds)!==null&&h!==void 0?h:60)
2*1e3,maxRetries:(g=e?.maxRetries)!==null&&g!==void 0?g:(f=this._options)===null||f===void 0?void 0:f.maxRetries,abortSignal:e?.abortSignal,fetchFn:(v=this._options)===null||v===void 0?void 0:v.fetch,logging:this._options.logging});if(U.ok)return{data:Er.parseOrThrow(U.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:U.rawResponse};if(U.error.reason==="status-code")switch(U.error.statusCode){case 404:throw new bo(U.error.body,U.rawResponse);case 429:throw new K(U.error.body,U.rawResponse);default:throw new S({statusCode:U.error.statusCode,body:U.error.body,rawResponse:U.rawResponse})}return N(U.error,U.rawResponse,"GET","/v1/connect/{project_id}/app_overrides")})),i=yield n(o).withRawResponse();return new ie({response:i.data,rawResponse:i.rawResponse,hasNextPage:t=>t?.pageInfo.endCursor!=null&&!(typeof t?.pageInfo.endCursor=="string"&&t?.pageInfo.endCursor===""),getItems:t=>{var d;return(d=t?.data)!==null&&d!==void 0?d:[]},loadPage:t=>n(re(o,"after",t?.pageInfo.endCursor))})})}create(o,e){return I.fromPromise(this.__create(o,e))}__create(o,e){return we(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/app_overrides`),method:"POST",headers:f,contentType:"application/json",queryString:V().mergeAdditional(e?.queryParams).build(),requestType:"json",body:Wt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:De.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 400:throw new le(v.error.body,v.rawResponse);case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"POST","/v1/connect/{project_id}/app_overrides")})}retrieve(o,e){return I.fromPromise(this.__retrieve(o,e))}__retrieve(o,e){return we(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/app_overrides/${T(o)}`),method:"GET",headers:f,queryString:V().mergeAdditional(e?.queryParams).build(),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:De.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"GET","/v1/connect/{project_id}/app_overrides/{id}")})}update(o,e={},n){return I.fromPromise(this.__update(o,e,n))}__update(o){return we(this,arguments,void 0,function*(e,n={},i){var t,d,u,c,s,r,l,_,h,g,f;const v=yield this._options.authProvider.getAuthRequest(),P=C(v.headers,(t=this._options)===null||t===void 0?void 0:t.headers,M({"x-pd-environment":(d=i?.projectEnvironment)!==null&&d!==void 0?d:(u=this._options)===null||u===void 0?void 0:u.projectEnvironment}),i?.headers),R=yield A({url:$((s=(c=yield b.get(this._options.baseUrl))!==null&&c!==void 0?c:yield b.get(this._options.environment))!==null&&s!==void 0?s:z.Prod,`v1/connect/${T(this._options.projectId)}/app_overrides/${T(e)}`),method:"PUT",headers:P,contentType:"application/json",queryString:V().mergeAdditional(i?.queryParams).build(),requestType:"json",body:Gt.jsonOrThrow(n,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((_=(r=i?.timeoutInSeconds)!==null&&r!==void 0?r:(l=this._options)===null||l===void 0?void 0:l.timeoutInSeconds)!==null&&_!==void 0?_:60)*1e3,maxRetries:(h=i?.maxRetries)!==null&&h!==void 0?h:(g=this._options)===null||g===void 0?void 0:g.maxRetries,abortSignal:i?.abortSignal,fetchFn:(f=this._options)===null||f===void 0?void 0:f.fetch,logging:this._options.logging});if(R.ok)return{data:De.parseOrThrow(R.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:R.rawResponse};if(R.error.reason==="status-code")switch(R.error.statusCode){case 400:throw new le(R.error.body,R.rawResponse);case 429:throw new K(R.error.body,R.rawResponse);default:throw new S({statusCode:R.error.statusCode,body:R.error.body,rawResponse:R.rawResponse})}return N(R.error,R.rawResponse,"PUT","/v1/connect/{project_id}/app_overrides/{id}")})}delete(o,e){return I.fromPromise(this.__delete(o,e))}__delete(o,e){return we(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/app_overrides/${T(o)}`),method:"DELETE",headers:f,queryString:V().mergeAdditional(e?.queryParams).build(),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:void 0,rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"DELETE","/v1/connect/{project_id}/app_overrides/{id}")})}}var ro=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};class Yr{constructor(o){this._options=Q(o)}list(){return ro(this,arguments,void 0,function*(o={},e){const n=I.interceptFunction(t=>ro(this,void 0,void 0,function*(){var d,u,c,s,r,l,_,h,g,f,v;const{after:P,before:R,limit:j,q:y,sortKey:D,sortDirection:W,categoryIds:G,hasComponents:U,hasActions:E,hasTriggers:k}=t,B={after:P,before:R,limit:j,q:y,sort_key:D!=null?Ht.jsonOrThrow(D,{unrecognizedObjectKeys:"strip",omitUndefined:!0}):void 0,sort_direction:W!=null?Bt.jsonOrThrow(W,{unrecognizedObjectKeys:"strip",omitUndefined:!0}):void 0,category_ids:G,has_components:U,has_actions:E,has_triggers:k},Tn=yield this._options.authProvider.getAuthRequest(),In=C(Tn.headers,(d=this._options)===null||d===void 0?void 0:d.headers,M({"x-pd-environment":(u=e?.projectEnvironment)!==null&&u!==void 0?u:(c=this._options)===null||c===void 0?void 0:c.projectEnvironment}),e?.headers),ae=yield A({url:$((r=(s=yield b.get(this._options.baseUrl))!==null&&s!==void 0?s:yield b.get(this._options.environment))!==null&&r!==void 0?r:z.Prod,"v1/connect/apps"),method:"GET",headers:In,queryString:V().addMany(B).mergeAdditional(e?.queryParams).build(),timeoutMs:((h=(l=e?.timeoutInSeconds)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.timeoutInSeconds)!==null&&h!==void 0?h:60)
2*1e3,maxRetries:(g=e?.maxRetries)!==null&&g!==void 0?g:(f=this._options)===null||f===void 0?void 0:f.maxRetries,abortSignal:e?.abortSignal,fetchFn:(v=this._options)===null||v===void 0?void 0:v.fetch,logging:this._options.logging});if(ae.ok)return{data:Tr.parseOrThrow(ae.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:ae.rawResponse};if(ae.error.reason==="status-code")throw new S({statusCode:ae.error.statusCode,body:ae.error.body,rawResponse:ae.rawResponse});return N(ae.error,ae.rawResponse,"GET","/v1/connect/apps")})),i=yield n(o).withRawResponse();return new ie({response:i.data,rawResponse:i.rawResponse,hasNextPage:t=>t?.pageInfo.endCursor!=null&&!(typeof t?.pageInfo.endCursor=="string"&&t?.pageInfo.endCursor===""),getItems:t=>{var d;return(d=t?.data)!==null&&d!==void 0?d:[]},loadPage:t=>n(re(o,"after",t?.pageInfo.endCursor))})})}retrieve(o,e){return I.fromPromise(this.__retrieve(o,e))}__retrieve(o,e){return ro(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/apps/${T(o)}`),method:"GET",headers:f,queryString:V().mergeAdditional(e?.queryParams).build(),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:mr.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse});return N(v.error,v.rawResponse,"GET","/v1/connect/apps/{app_id}")})}}var ze=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};class Zr{constructor(o){this._options=Q(o)}list(){return ze(this,arguments,void 0,function*(o={},e){const n=I.interceptFunction(t=>ze(this,void 0,void 0,function*(){var d,u,c,s,r,l,_,h,g,f,v;const{after:P,before:R,limit:j,q:y,app:D,registry:W,componentType:G}=t,U={after:P,before:R,limit:j,q:y,app:D,registry:W!=null?Jt.jsonOrThrow(W,{unrecognizedObjectKeys:"strip",omitUndefined:!0}):void 0,component_type:G!=null?or.jsonOrThrow(G,{unrecognizedObjectKeys:"strip",omitUndefined:!0}):void 0},E=yield this._options.authProvider.getAuthRequest(),k=C(E.headers,(d=this._options)===null||d===void 0?void 0:d.headers,M({"x-pd-environment":(u=e?.projectEnvironment)!==null&&u!==void 0?u:(c=this._options)===null||c===void 0?void 0:c.projectEnvironment}),e?.headers),B=yield A({url:$((r=(s=yield b.get(this._options.baseUrl))!==null&&s!==void 0?s:yield b.get(this._options.environment))!==null&&r!==void 0?r:z.Prod,`v1/connect/${T(this._options.projectId)}/components`),method:"GET",headers:k,queryString:V().addMany(U).mergeAdditional(e?.queryParams).build(),timeoutMs:((h=(l=e?.timeoutInSeconds)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.timeoutInSeconds)!==null&&h!==void 0?h:60)*1e3,maxRetries:(g=e?.maxRetries)!==null&&g!==void 0?g:(f=this._options)===null||f===void 0?void 0:f.maxRetries,abortSignal:e?.abortSignal,fetchFn:(v=this._options)===null||v===void 0?void 0:v.fetch,logging:this._options.logging});if(B.ok)return{data:Uo.parseOrThrow(B.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:B.rawResponse};if(B.error.reason==="status-code")switch(B.error.statusCode){case 400:throw new le(B.error.body,B.rawResponse);case 429:throw new K(B.error.body,B.rawResponse);default:throw new S({statusCode:B.error.statusCode,body:B.error.body,rawResponse:B.rawResponse})}return N(B.error,B.rawResponse,"GET","/v1/connect/{project_id}/components")})),i=yield n(o).withRawResponse();return new ie({response:i.data,rawResponse:i.rawResponse,hasNextPage:t=>t?.pageInfo.endCursor!=null&&!(typeof t?.pageInfo.endCursor=="string"&&t?.pageInfo.endCursor===""),getItems:t=>{var d;return(d=t?.data)!==null&&d!==void 0?d:[]},loadPage:t=>n(re(o,"after",t?.pageInfo.endCursor))})})}retrieve(o,e={},n){return I.fromPromise(this.__retrieve(o,e,n))}__retrieve(o){return ze(this,arguments,void 0,function*(e,n={},i){var t,d,u,c,s,r,l,_,h,g,f;const{version:v}=n,P={version:v},R=yield this._options.authProvider.getAuthRequest(),j=C(R.headers,(t=this._options)===null||t===void 0?void 0:t.headers,M({"x-pd-environment":(d=i?.projectEnvironment)!==null&&d!==void 0?d:(u=this._options)===null||u===void 0?void 0:u.projectEnvironment}),i?.headers),y=yield A({url:$((s=(c=yield b.get(this._options.baseUrl))!==null&&c!==void 0?c:yield b.get(this._options.environment))!==null&&s!==void 0?s:z.Prod,`v1/connect/${T(this._options.projectId)}/components/${T(e)}`),method:"GET",headers:j,queryString:V().addMany(P).mergeAdditional(i?.queryParams).build(),timeoutMs:((_=(r=i?.timeoutInSeconds)!==null&&r!==void 0?r:(l=this._options)===null||l===void 0?void 0:l.timeoutInSeconds)!==null&&_!==void 0?_:60)*1e3,maxRetries:(h=i?.maxRetries)!==null&&h!==void 0?h:(g=this._options)===null||g===void 0?void 0:g.maxRetries,abortSignal:i?.abortSignal,fetchFn:(f=this._options)===null||f===void 0?void 0:f.fetch,logging:this._options.logging});if(y.ok)return{data:Co.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 429:throw new K(y.error.body,y.rawResponse);default:throw new S({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return N(y.error,y.rawResponse,"GET","/v1/connect/{project_id}/components/{component_id}")})}configureProp(o,e){return I.fromPromise(this.__configureProp(o,e))}__configureProp(o,e){return ze(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/components/configure`),method:"POST",headers:f,contentType:"application/json",queryString:V().mergeAdditional(e?.queryParams).build(),requestType:"json",body:So.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:To.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"POST","/v1/connect/{project_id}/components/configure")})}reloadProps(o,e){return I.fromPromise(this.__reloadProps(o,e))}__reloadProps(o,e){return ze(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/components/props`),method:"POST",headers:f,contentType:"application/json",queryString:V().mergeAdditional(e?.queryParams).build(),requestType:"json",body:Ao.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:Mo.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"POST","/v1/connect/{project_id}/components/props")})}}var ee=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})},ao=function(a,o){var e={};for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&o.indexOf(n)<0&&(e[n]=a[n]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(a);i<n.length;i++)o.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(a,n[i])&&(e[n[i]]=a[n[i]]);return e};class Or{constructor(o){this._options=Q(o)}list(o,e){return ee(this,void 0,void 0,function*(){const n=I.interceptFunction(t=>ee(this,void 0,void 0,function*(){var d,u,c,s,r,l,_,h,g,f,v;const{after:P,before:R,limit:j,externalUserId:y,emitterType:D}=t,W={after:P,before:R,limit:j,external_user_id:y,emitter_type:D!=null?pr.jsonOrThrow(D,{unrecognizedObjectKeys:"strip",omitUndefined:!0}):void 0},G=yield this._options.authProvider.getAuthRequest(),U=C(G.headers,(d=this._options)===null||d===void 0?void 0:d.headers,M({"x-pd-environment":(u=e?.projectEnvironment)!==null&&u!==void 0?u:(c=this._options)===null||c===void 0?void 0:c.projectEnvironment}),e?.headers),E=yield A({url:$((r=(s=yield b.get(this._options.baseUrl))!==null&&s!==void 0?s:yield b.get(this._options.environment))!==null&&r!==void 0?r:z.Prod,`v1/connect/${T(this._options.projectId)}/deployed-triggers`),method:"GET",headers:U,queryString:V().addMany(W).mergeAdditional(e?.queryParams).build(),timeoutMs:((h=(l=e?.timeoutInSeconds)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.timeoutInSeconds)!==null&&h!==void 0?h:60)
2*1e3,maxRetries:(g=e?.maxRetries)!==null&&g!==void 0?g:(f=this._options)===null||f===void 0?void 0:f.maxRetries,abortSignal:e?.abortSignal,fetchFn:(v=this._options)===null||v===void 0?void 0:v.fetch,logging:this._options.logging});if(E.ok)return{data:wr.parseOrThrow(E.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:E.rawResponse};if(E.error.reason==="status-code")switch(E.error.statusCode){case 429:throw new K(E.error.body,E.rawResponse);default:throw new S({statusCode:E.error.statusCode,body:E.error.body,rawResponse:E.rawResponse})}return N(E.error,E.rawResponse,"GET","/v1/connect/{project_id}/deployed-triggers")})),i=yield n(o).withRawResponse();return new ie({response:i.data,rawResponse:i.rawResponse,hasNextPage:t=>t?.pageInfo.endCursor!=null&&!(typeof t?.pageInfo.endCursor=="string"&&t?.pageInfo.endCursor===""),getItems:t=>{var d;return(d=t?.data)!==null&&d!==void 0?d:[]},loadPage:t=>n(re(o,"after",t?.pageInfo.endCursor))})})}retrieve(o,e,n){return I.fromPromise(this.__retrieve(o,e,n))}__retrieve(o,e,n){return ee(this,void 0,void 0,function*(){var i,t,d,u,c,s,r,l,_,h,g;const{externalUserId:f}=e,v={external_user_id:f},P=yield this._options.authProvider.getAuthRequest(),R=C(P.headers,(i=this._options)===null||i===void 0?void 0:i.headers,M({"x-pd-environment":(t=n?.projectEnvironment)!==null&&t!==void 0?t:(d=this._options)===null||d===void 0?void 0:d.projectEnvironment}),n?.headers),j=yield A({url:$((c=(u=yield b.get(this._options.baseUrl))!==null&&u!==void 0?u:yield b.get(this._options.environment))!==null&&c!==void 0?c:z.Prod,`v1/connect/${T(this._options.projectId)}/deployed-triggers/${T(o)}`),method:"GET",headers:R,queryString:V().addMany(v).mergeAdditional(n?.queryParams).build(),timeoutMs:((l=(s=n?.timeoutInSeconds)!==null&&s!==void 0?s:(r=this._options)===null||r===void 0?void 0:r.timeoutInSeconds)!==null&&l!==void 0?l:60)*1e3,maxRetries:(_=n?.maxRetries)!==null&&_!==void 0?_:(h=this._options)===null||h===void 0?void 0:h.maxRetries,abortSignal:n?.abortSignal,fetchFn:(g=this._options)===null||g===void 0?void 0:g.fetch,logging:this._options.logging});if(j.ok)return{data:Zo.parseOrThrow(j.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:j.rawResponse};if(j.error.reason==="status-code")switch(j.error.statusCode){case 429:throw new K(j.error.body,j.rawResponse);default:throw new S({statusCode:j.error.statusCode,body:j.error.body,rawResponse:j.rawResponse})}return N(j.error,j.rawResponse,"GET","/v1/connect/{project_id}/deployed-triggers/{trigger_id}")})}update(o,e,n){return I.fromPromise(this.__update(o,e,n))}__update(o,e,n){return ee(this,void 0,void 0,function*(){var i,t,d,u,c,s,r,l,_,h,g;const{externalUserId:f}=e,v=ao(e,["externalUserId"]),P={external_user_id:f},R=yield this._options.authProvider.getAuthRequest(),j=C(R.headers,(i=this._options)===null||i===void 0?void 0:i.headers,M({"x-pd-environment":(t=n?.projectEnvironment)!==null&&t!==void 0?t:(d=this._options)===null||d===void 0?void 0:d.projectEnvironment}),n?.headers),y=yield A({url:$((c=(u=yield b.get(this._options.baseUrl))!==null&&u!==void 0?u:yield b.get(this._options.environment))!==null&&c!==void 0?c:z.Prod,`v1/connect/${T(this._options.projectId)}/deployed-triggers/${T(o)}`),method:"PUT",headers:j,contentType:"application/json",queryString:V().addMany(P).mergeAdditional(n?.queryParams).build(),requestType:"json",body:Qt.jsonOrThrow(v,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((l=(s=n?.timeoutInSeconds)!==null&&s!==void 0?s:(r=this._options)===null||r===void 0?void 0:r.timeoutInSeconds)!==null&&l!==void 0?l:60)*1e3,maxRetries:(_=n?.maxRetries)!==null&&_!==void 0?_:(h=this._options)===null||h===void 0?void 0:h.maxRetries,abortSignal:n?.abortSignal,fetchFn:(g=this._options)===null||g===void 0?void 0:g.fetch,logging:this._options.logging});if(y.ok)return{data:Zo.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 429:throw new K(y.error.body,y.rawResponse);default:throw new S({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return N(y.error,y.rawResponse,"PUT","/v1/connect/{project_id}/deployed-triggers/{trigger_id}")})}delete(o,e,n){return I.fromPromise(this.__delete(o,e,n))}__delete(o,e,n){return ee(this,void 0,void 0,function*(){var i,t,d,u,c,s,r,l,_,h,g;const{externalUserId:f,ignoreHookErrors:v}=e,P={external_user_id:f,ignore_hook_errors:v},R=yield this._options.authProvider.getAuthRequest(),j=C(R.headers,(i=this._options)===null||i===void 0?void 0:i.headers,M({"x-pd-environment":(t=n?.projectEnvironment)!==null&&t!==void 0?t:(d=this._options)===null||d===void 0?void 0:d.projectEnvironment}),n?.headers),y=yield A({url:$((c=(u=yield b.get(this._options.baseUrl))!==null&&u!==void 0?u:yield b.get(this._options.environment))!==null&&c!==void 0?c:z.Prod,`v1/connect/${T(this._options.projectId)}/deployed-triggers/${T(o)}`),method:"DELETE",headers:j,queryString:V().addMany(P).mergeAdditional(n?.queryParams).build(),timeoutMs:((l=(s=n?.timeoutInSeconds)!==null&&s!==void 0?s:(r=this._options)===null||r===void 0?void 0:r.timeoutInSeconds)!==null&&l!==void 0?l:60)*1e3,maxRetries:(_=n?.maxRetries)!==null&&_!==void 0?_:(h=this._options)===null||h===void 0?void 0:h.maxRetries,abortSignal:n?.abortSignal,fetchFn:(g=this._options)===null||g===void 0?void 0:g.fetch,logging:this._options.logging});if(y.ok)return{data:void 0,rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 429:throw new K(y.error.body,y.rawResponse);default:throw new S({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return N(y.error,y.rawResponse,"DELETE","/v1/connect/{project_id}/deployed-triggers/{trigger_id}")})}listEvents(o,e,n){return I.fromPromise(this.__listEvents(o,e,n))}__listEvents(o,e,n){return ee(this,void 0,void 0,function*(){var i,t,d,u,c,s,r,l,_,h,g;const{externalUserId:f,n:v}=e,P={external_user_id:f,n:v},R=yield this._options.authProvider.getAuthRequest(),j=C(R.headers,(i=this._options)===null||i===void 0?void 0:i.headers,M({"x-pd-environment":(t=n?.projectEnvironment)!==null&&t!==void 0?t:(d=this._options)===null||d===void 0?void 0:d.projectEnvironment}),n?.headers),y=yield A({url:$((c=(u=yield b.get(this._options.baseUrl))!==null&&u!==void 0?u:yield b.get(this._options.environment))!==null&&c!==void 0?c:z.Prod,`v1/connect/${T(this._options.projectId)}/deployed-triggers/${T(o)}/events`),method:"GET",headers:j,queryString:V().addMany(P).mergeAdditional(n?.queryParams).build(),timeoutMs:((l=(s=n?.timeoutInSeconds)!==null&&s!==void 0?s:(r=this._options)===null||r===void 0?void 0:r.timeoutInSeconds)!==null&&l!==void 0?l:60)*1e3,maxRetries:(_=n?.maxRetries)!==null&&_!==void 0?_:(h=this._options)===null||h===void 0?void 0:h.maxRetries,abortSignal:n?.abortSignal,fetchFn:(g=this._options)===null||g===void 0?void 0:g.fetch,logging:this._options.logging});if(y.ok)return{data:yr.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 429:throw new K(y.error.body,y.rawResponse);default:throw new S({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return N(y.error,y.rawResponse,"GET","/v1/connect/{project_id}/deployed-triggers/{trigger_id}/events")})}listWorkflows(o,e,n){return I.fromPromise(this.__listWorkflows(o,e,n))}__listWorkflows(o,e,n){return ee(this,void 0,void 0,function*(){var i,t,d,u,c,s,r,l,_,h,g;const{externalUserId:f}=e,v={external_user_id:f},P=yield this._options.authProvider.getAuthRequest(),R=C(P.headers,(i=this._options)===null||i===void 0?void 0:i.headers,M({"x-pd-environment":(t=n?.projectEnvironment)!==null&&t!==void 0?t:(d=this._options)===null||d===void 0?void 0:d.projectEnvironment}),n?.headers),j=yield A({url:$((c=(u=yield b.get(this._options.baseUrl))!==null&&u!==void 0?u:yield b.get(this._options.environment))!==null&&c!==void 0?c:z.Prod,`v1/connect/${T(this._options.projectId)}/deployed-triggers/${T(o)}/pipelines`),method:"GET",headers:R,queryString:V().addMany(v).mergeAdditional(n?.queryParams).build(),timeoutMs:((l=(s=n?.timeoutInSeconds)!==null&&s!==void 0?s:(r=this._options)===null||r===void 0?void 0:r.timeoutInSeconds)!==null&&l!==void 0?l:60)*1e3,maxRetries:(_=n?.maxRetries)!==null&&_!==void 0?_:(h=this._options)===null||h===void 0?void 0:h.maxRetries,abortSignal:n?.abortSignal,fetchFn:(g=this._options)===null||g===void 0?void 0:g.fetch,logging:this._options.logging});if(j.ok)return{data:qo.parseOrThrow(j.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:j.rawResponse};if(j.error.reason==="status-code")switch(j.error.statusCode){case 429:throw new K(j.error.body,j.rawResponse);default:throw new S({statusCode:j.error.statusCode,body:j.error.body,rawResponse:j.rawResponse})}return N(j.error,j.rawResponse,"GET","/v1/connect/{project_id}/deployed-triggers/{trigger_id}/pipelines")})}updateWorkflows(o,e,n){return I.fromPromise(this.__updateWorkflows(o,e,n))}__updateWorkflows(o,e,n){return ee(this,void 0,void 0,function*(){var i,t,d,u,c,s,r,l,_,h,g;const{externalUserId:f}=e,v=ao(e,["externalUserId"]),P={external_user_id:f},R=yield this._options.authProvider.getAuthRequest(),j=C(R.headers,(i=this._options)===null||i===void 0?void 0:i.headers,M({"x-pd-environment":(t=n?.projectEnvironment)!==null&&t!==void 0?t:(d=this._options)===null||d===void 0?void 0:d.projectEnvironment}),n?.headers),y=yield A({url:$((c=(u=yield b.get(this._options.baseUrl))!==null&&u!==void 0?u:yield b.get(this._options.environment))!==null&&c!==void 0?c:z.Prod,`v1/connect/${T(this._options.projectId)}/deployed-triggers/${T(o)}/pipelines`),method:"PUT",headers:j,contentType:"application/json",queryString:V().addMany(P).mergeAdditional(n?.queryParams).build(),requestType:"json",body:Yt.jsonOrThrow(v,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((l=(s=n?.timeoutInSeconds)!==null&&s!==void 0?s:(r=this._options)===null||r===void 0?void 0:r.timeoutInSeconds)!==null&&l!==void 0?l:60)*1e3,maxRetries:(_=n?.maxRetries)!==null&&_!==void 0?_:(h=this._options)===null||h===void 0?void 0:h.maxRetries,abortSignal:n?.abortSignal,fetchFn:(g=this._options)===null||g===void 0?void 0:g.fetch,logging:this._options.logging});if(y.ok)return{data:qo.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 429:throw new K(y.error.body,y.rawResponse);default:throw new S({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return N(y.error,y.rawResponse,"PUT","/v1/connect/{project_id}/deployed-triggers/{trigger_id}/pipelines")})}listWebhooks(o,e,n){return I.fromPromise(this.__listWebhooks(o,e,n))}__listWebhooks(o,e,n){return ee(this,void 0,void 0,function*(){var i,t,d,u,c,s,r,l,_,h,g;const{externalUserId:f}=e,v={external_user_id:f},P=yield this._options.authProvider.getAuthRequest(),R=C(P.headers,(i=this._options)===null||i===void 0?void 0:i.headers,M({"x-pd-environment":(t=n?.projectEnvironment)!==null&&t!==void 0?t:(d=this._options)===null||d===void 0?void 0:d.projectEnvironment}),n?.headers),j=yield A({url:$((c=(u=yield b.get(this._options.baseUrl))!==null&&u!==void 0?u:yield b.get(this._options.environment))!==null&&c!==void 0?c:z.Prod,`v1/connect/${T(this._options.projectId)}/deployed-triggers/${T(o)}/webhooks`),method:"GET",headers:R,queryString:V().addMany(v).mergeAdditional(n?.queryParams).build(),timeoutMs:((l=(s=n?.timeoutInSeconds)!==null&&s!==void 0?s:(r=this._options)===null||r===void 0?void 0:r.timeoutInSeconds)!==null&&l!==void 0?l:60)*1e3,maxRetries:(_=n?.maxRetries)!==null&&_!==void 0?_:(h=this._options)===null||h===void 0?void 0:h.maxRetries,abortSignal:n?.abortSignal,fetchFn:(g=this._options)===null||g===void 0?void 0:g.fetch,logging:this._options.logging});if(j.ok)return{data:Oo.parseOrThrow(j.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:j.rawResponse};if(j.error.reason==="status-code")switch(j.error.statusCode){case 429:throw new K(j.error.body,j.rawResponse);default:throw new S({statusCode:j.error.statusCode,body:j.error.body,rawResponse:j.rawResponse})}return N(j.error,j.rawResponse,"GET","/v1/connect/{project_id}/deployed-triggers/{trigger_id}/webhooks")})}updateWebhooks(o,e,n){return I.fromPromise(this.__updateWebhooks(o,e,n))}__updateWebhooks(o,e,n){return ee(this,void 0,void 0,function*(){var i,t,d,u,c,s,r,l,_,h,g;const{externalUserId:f}=e,v=ao(e,["externalUserId"]),P={external_user_id:f},R=yield this._options.authProvider.getAuthRequest(),j=C(R.headers,(i=this._options)===null||i===void 0?void 0:i.headers,M({"x-pd-environment":(t=n?.projectEnvironment)!==null&&t!==void 0?t:(d=this._options)===null||d===void 0?void 0:d.projectEnvironment}),n?.headers),y=yield A({url:$((c=(u=yield b.get(this._options.baseUrl))!==null&&u!==void 0?u:yield b.get(this._options.environment))!==null&&c!==void 0?c:z.Prod,`v1/connect/${T(this._options.projectId)}/deployed-triggers/${T(o)}/webhooks`),method:"PUT",headers:j,contentType:"application/json",queryString:V().addMany(P).mergeAdditional(n?.queryParams).build(),requestType:"json",body:Xt.jsonOrThrow(v,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((l=(s=n?.timeoutInSeconds)!==null&&s!==void 0?s:(r=this._options)===null||r===void 0?void 0:r.timeoutInSeconds)!==null&&l!==void 0?l:60)*1e3,maxRetries:(_=n?.maxRetries)!==null&&_!==void 0?_:(h=this._options)===null||h===void 0?void 0:h.maxRetries,abortSignal:n?.abortSignal,fetchFn:(g=this._options)===null||g===void 0?void 0:g.fetch,logging:this._options.logging});if(y.ok)return{data:Oo.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 429:throw new K(y.error.body,y.rawResponse);default:throw new S({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return N(y.error,y.rawResponse,"PUT","/v1/connect/{project_id}/deployed-triggers/{trigger_id}/webhooks")})}retrieveWebhook(o,e,n,i){return I.fromPromise(this.__retrieveWebhook(o,e,n,i))}__retrieveWebhook(o,e,n,i){return ee(this,void 0,void 0,function*(){var t,d,u,c,s,r,l,_,h,g,f;const{externalUserId:v}=n,P={external_user_id:v},R=yield this._options.authProvider.getAuthRequest(),j=C(R.headers,(t=this._options)===null||t===void 0?void 0:t.headers,M({"x-pd-environment":(d=i?.projectEnvironment)!==null&&d!==void 0?d:(u=this._options)===null||u===void 0?void 0:u.projectEnvironment}),i?.headers),y=yield A({url:$((s=(c=yield b.get(this._options.baseUrl))!==null&&c!==void 0?c:yield b.get(this._options.environment))!==null&&s!==void 0?s:z.Prod,`v1/connect/${T(this._options.projectId)}/deployed-triggers/${T(o)}/webhooks/${T(e)}`),method:"GET",headers:j,queryString:V().addMany(P).mergeAdditional(i?.queryParams).build(),timeoutMs:((_=(r=i?.timeoutInSeconds)!==null&&r!==void 0?r:(l=this._options)===null||l===void 0?void 0:l.timeoutInSeconds)!==null&&_!==void 0?_:60)*1e3,maxRetries:(h=i?.maxRetries)!==null&&h!==void 0?h:(g=this._options)===null||g===void 0?void 0:g.maxRetries,abortSignal:i?.abortSignal,fetchFn:(f=this._options)===null||f===void 0?void 0:f.fetch,logging:this._options.logging});if(y.ok)return{data:go.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};i
2f(y.error.reason==="status-code")switch(y.error.statusCode){case 429:throw new K(y.error.body,y.rawResponse);default:throw new S({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return N(y.error,y.rawResponse,"GET","/v1/connect/{project_id}/deployed-triggers/{trigger_id}/webhooks/{webhook_id}")})}regenerateWebhookSigningKey(o,e,n,i){return I.fromPromise(this.__regenerateWebhookSigningKey(o,e,n,i))}__regenerateWebhookSigningKey(o,e,n,i){return ee(this,void 0,void 0,function*(){var t,d,u,c,s,r,l,_,h,g,f;const{externalUserId:v}=n,P={external_user_id:v},R=yield this._options.authProvider.getAuthRequest(),j=C(R.headers,(t=this._options)===null||t===void 0?void 0:t.headers,M({"x-pd-environment":(d=i?.projectEnvironment)!==null&&d!==void 0?d:(u=this._options)===null||u===void 0?void 0:u.projectEnvironment}),i?.headers),y=yield A({url:$((s=(c=yield b.get(this._options.baseUrl))!==null&&c!==void 0?c:yield b.get(this._options.environment))!==null&&s!==void 0?s:z.Prod,`v1/connect/${T(this._options.projectId)}/deployed-triggers/${T(o)}/webhooks/${T(e)}/regenerate_signing_key`),method:"POST",headers:j,queryString:V().addMany(P).mergeAdditional(i?.queryParams).build(),timeoutMs:((_=(r=i?.timeoutInSeconds)!==null&&r!==void 0?r:(l=this._options)===null||l===void 0?void 0:l.timeoutInSeconds)!==null&&_!==void 0?_:60)*1e3,maxRetries:(h=i?.maxRetries)!==null&&h!==void 0?h:(g=this._options)===null||g===void 0?void 0:g.maxRetries,abortSignal:i?.abortSignal,fetchFn:(f=this._options)===null||f===void 0?void 0:f.fetch,logging:this._options.logging});if(y.ok)return{data:go.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 429:throw new K(y.error.body,y.rawResponse);default:throw new S({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return N(y.error,y.rawResponse,"POST","/v1/connect/{project_id}/deployed-triggers/{trigger_id}/webhooks/{webhook_id}/regenerate_signing_key")})}}var qr=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};class ed{constructor(o){this._options=Q(o)}downloadFile(o,e){return I.fromPromise(this.__downloadFile(o,e))}__downloadFile(o,e){return qr(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const{s3Key:g}=o,f={s3_key:g},v=yield this._options.authProvider.getAuthRequest(),P=C(v.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),R=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/file_stash/download`),method:"GET",headers:P,queryString:V().addMany(f).mergeAdditional(e?.queryParams).build(),responseType:"binary-response",timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(R.ok)return{data:R.body,rawResponse:R.rawResponse};if(R.error.reason==="status-code")switch(R.error.statusCode){case 429:throw new K(R.error.body,R.rawResponse);default:throw new S({statusCode:R.error.statusCode,body:R.error.body,rawResponse:R.rawResponse})}return N(R.error,R.rawResponse,"GET","/v1/connect/{project_id}/file_stash/download")})}}var be=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};class od{constructor(o){this._options=Q(o)}list(){return be(this,arguments,void 0,function*(o={},e){const n=I.interceptFunction(t=>be(this,void 0,void 0,function*(){var d,u,c,s,r,l,_,h,g,f,v;const{after:P,before:R,limit:j,app:y,q:D}=t,W={after:P,before:R,limit:j,app:y,q:D},G=yield this._options.authProvider.getAuthRequest(),U=C(G.headers,(d=this._options)===null||d===void 0?void 0:d.headers,M({"x-pd-environment":(u=e?.projectEnvironment)!==null&&u!==void 0?u:(c=this._options)===null||c===void 0?void 0:c.projectEnvironment}),e?.headers),E=yield A({url:$((r=(s=yield b.get(this._options.baseUrl))!==null&&s!==void 0?s:yield b.get(this._options.environment))!==null&&r!==void 0?r:z.Prod,`v1/connect/${T(this._options.projectId)}/oauth_apps`),method:"GET",headers:U,queryString:V().addMany(W).mergeAdditional(e?.queryParams).build(),timeoutMs:((h=(l=e?.timeoutInSeconds)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.timeoutInSeconds)!==null&&h!==void 0?h:60)
2*1e3,maxRetries:(g=e?.maxRetries)!==null&&g!==void 0?g:(f=this._options)===null||f===void 0?void 0:f.maxRetries,abortSignal:e?.abortSignal,fetchFn:(v=this._options)===null||v===void 0?void 0:v.fetch,logging:this._options.logging});if(E.ok)return{data:Ir.parseOrThrow(E.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:E.rawResponse};if(E.error.reason==="status-code")switch(E.error.statusCode){case 404:throw new bo(E.error.body,E.rawResponse);case 429:throw new K(E.error.body,E.rawResponse);default:throw new S({statusCode:E.error.statusCode,body:E.error.body,rawResponse:E.rawResponse})}return N(E.error,E.rawResponse,"GET","/v1/connect/{project_id}/oauth_apps")})),i=yield n(o).withRawResponse();return new ie({response:i.data,rawResponse:i.rawResponse,hasNextPage:t=>t?.pageInfo.endCursor!=null&&!(typeof t?.pageInfo.endCursor=="string"&&t?.pageInfo.endCursor===""),getItems:t=>{var d;return(d=t?.data)!==null&&d!==void 0?d:[]},loadPage:t=>n(re(o,"after",t?.pageInfo.endCursor))})})}create(o,e){return I.fromPromise(this.__create(o,e))}__create(o,e){return be(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/oauth_apps`),method:"POST",headers:f,contentType:"application/json",queryString:V().mergeAdditional(e?.queryParams).build(),requestType:"json",body:Zt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:Fe.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 400:throw new le(v.error.body,v.rawResponse);case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"POST","/v1/connect/{project_id}/oauth_apps")})}retrieve(o,e){return I.fromPromise(this.__retrieve(o,e))}__retrieve(o,e){return be(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/oauth_apps/${T(o)}`),method:"GET",headers:f,queryString:V().mergeAdditional(e?.queryParams).build(),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:Fe.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"GET","/v1/connect/{project_id}/oauth_apps/{id}")})}update(o,e={},n){return I.fromPromise(this.__update(o,e,n))}__update(o){return be(this,arguments,void 0,function*(e,n={},i){var t,d,u,c,s,r,l,_,h,g,f;const v=yield this._options.authProvider.getAuthRequest(),P=C(v.headers,(t=this._options)===null||t===void 0?void 0:t.headers,M({"x-pd-environment":(d=i?.projectEnvironment)!==null&&d!==void 0?d:(u=this._options)===null||u===void 0?void 0:u.projectEnvironment}),i?.headers),R=yield A({url:$((s=(c=yield b.get(this._options.baseUrl))!==null&&c!==void 0?c:yield b.get(this._options.environment))!==null&&s!==void 0?s:z.Prod,`v1/connect/${T(this._options.projectId)}/oauth_apps/${T(e)}`),method:"PUT",headers:P,contentType:"application/json",queryString:V().mergeAdditional(i?.queryParams).build(),requestType:"json",body:Ot.jsonOrThrow(n,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((_=(r=i?.timeoutInSeconds)!==null&&r!==void 0?r:(l=this._options)===null||l===void 0?void 0:l.timeoutInSeconds)!==null&&_!==void 0?_:60)*1e3,maxRetries:(h=i?.maxRetries)!==null&&h!==void 0?h:(g=this._options)===null||g===void 0?void 0:g.maxRetries,abortSignal:i?.abortSignal,fetchFn:(f=this._options)===null||f===void 0?void 0:f.fetch,logging:this._options.logging});if(R.ok)return{data:Fe.parseOrThrow(R.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:R.rawResponse};if(R.error.reason==="status-code")switch(R.error.statusCode){case 429:throw new K(R.error.body,R.rawResponse);default:throw new S({statusCode:R.error.statusCode,body:R.error.body,rawResponse:R.rawResponse})}return N(R.error,R.rawResponse,"PUT","/v1/connect/{project_id}/oauth_apps/{id}")})}delete(o,e){return I.fromPromise(this.__delete(o,e))}__delete(o,e){return be(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/oauth_apps/${T(o)}`),method:"DELETE",headers:f,queryString:V().mergeAdditional(e?.queryParams).build(),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:void 0,rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 400:throw new le(v.error.body,v.rawResponse);case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"DELETE","/v1/connect/{project_id}/oauth_apps/{id}")})}}var Le=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};
2class nd{constructor(o){this._options=Q(o)}retrieveWebhook(o){return I.fromPromise(this.__retrieveWebhook(o))}__retrieveWebhook(o){return Le(this,void 0,void 0,function*(){var e,n,i,t,d,u,c,s,r,l,_;const h=yield this._options.authProvider.getAuthRequest(),g=C(h.headers,(e=this._options)===null||e===void 0?void 0:e.headers,M({"x-pd-environment":(n=o?.projectEnvironment)!==null&&n!==void 0?n:(i=this._options)===null||i===void 0?void 0:i.projectEnvironment}),o?.headers),f=yield A({url:$((d=(t=yield b.get(this._options.baseUrl))!==null&&t!==void 0?t:yield b.get(this._options.environment))!==null&&d!==void 0?d:z.Prod,`v1/connect/${T(this._options.projectId)}/webhook`),method:"GET",headers:g,queryString:V().mergeAdditional(o?.queryParams).build(),timeoutMs:((s=(u=o?.timeoutInSeconds)!==null&&u!==void 0?u:(c=this._options)===null||c===void 0?void 0:c.timeoutInSeconds)!==null&&s!==void 0?s:60)*1e3,maxRetries:(r=o?.maxRetries)!==null&&r!==void 0?r:(l=this._options)===null||l===void 0?void 0:l.maxRetries,abortSignal:o?.abortSignal,fetchFn:(_=this._options)===null||_===void 0?void 0:_.fetch,logging:this._options.logging});if(f.ok)return{data:Pr.parseOrThrow(f.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:f.rawResponse};if(f.error.reason==="status-code")switch(f.error.statusCode){case 429:throw new K(f.error.body,f.rawResponse);default:throw new S({statusCode:f.error.statusCode,body:f.error.body,rawResponse:f.rawResponse})}return N(f.error,f.rawResponse,"GET","/v1/connect/{project_id}/webhook")})}updateWebhook(o,e){return I.fromPromise(this.__updateWebhook(o,e))}__updateWebhook(o,e){return Le(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/webhook`),method:"PUT",headers:f,contentType:"application/json",queryString:V().mergeAdditional(e?.queryParams).build(),requestType:"json",body:ei.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:$r.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"PUT","/v1/connect/{project_id}/webhook")})}deleteWebhook(o){return I.fromPromise(this.__deleteWebhook(o))}__deleteWebhook(o){return Le(this,void 0,void 0,function*(){var e,n,i,t,d,u,c,s,r,l,_;const h=yield this._options.authProvider.getAuthRequest(),g=C(h.headers,(e=this._options)===null||e===void 0?void 0:e.headers,M({"x-pd-environment":(n=o?.projectEnvironment)!==null&&n!==void 0?n:(i=this._options)===null||i===void 0?void 0:i.projectEnvironment}),o?.headers),f=yield A({url:$((d=(t=yield b.get(this._options.baseUrl))!==null&&t!==void 0?t:yield b.get(this._options.environment))!==null&&d!==void 0?d:z.Prod,`v1/connect/${T(this._options.projectId)}/webhook`),method:"DELETE",headers:g,queryString:V().mergeAdditional(o?.queryParams).build(),timeoutMs:((s=(u=o?.timeoutInSeconds)!==null&&u!==void 0?u:(c=this._options)===null||c===void 0?void 0:c.timeoutInSeconds)!==null&&s!==void 0?s:60)*1e3,maxRetries:(r=o?.maxRetries)!==null&&r!==void 0?r:(l=this._options)===null||l===void 0?void 0:l.maxRetries,abortSignal:o?.abortSignal,fetchFn:(_=this._options)===null||_===void 0?void 0:_.fetch,logging:this._options.logging});if(f.ok)return{data:void 0,rawResponse:f.rawResponse};if(f.error.reason==="status-code")switch(f.error.statusCode){case 429:throw new K(f.error.body,f.rawResponse);default:throw new S({statusCode:f.error.statusCode,body:f.error.body,rawResponse:f.rawResponse})}return N(f.error,f.rawResponse,"DELETE","/v1/connect/{project_id}/webhook")})}regenerateWebhookSigningKey(o){return I.fromPromise(this.__regenerateWebhookSigningKey(o))}__regenerateWebhookSigningKey(o){return Le(this,void 0,void 0,function*(){var e,n,i,t,d,u,c,s,r,l,_;const h=yield this._options.authProvider.getAuthRequest(),g=C(h.headers,(e=this._options)===null||e===void 0?void 0:e.headers,M({"x-pd-environment":(n=o?.projectEnvironment)!==null&&n!==void 0?n:(i=this._options)===null||i===void 0?void 0:i.projectEnvironment}),o?.headers),f=yield A({url:$((d=(t=yield b.get(this._options.baseUrl))!==null&&t!==void 0?t:yield b.get(this._options.environment))!==null&&d!==void 0?d:z.Prod,`v1/connect/${T(this._options.projectId)}/webhook/regenerate_signing_key`),method:"POST",headers:g,queryString:V().mergeAdditional(o?.queryParams).build(),timeoutMs:((s=(u=o?.timeoutInSeconds)!==null&&u!==void 0?u:(c=this._options)===null||c===void 0?void 0:c.timeoutInSeconds)!==null&&s!==void 0?s:60)*1e3,maxRetries:(r=o?.maxRetries)!==null&&r!==void 0?r:(l=this._options)===null||l===void 0?void 0:l.maxRetries,abortSignal:o?.abortSignal,fetchFn:(_=this._options)===null||_===void 0?void 0:_.fetch,logging:this._options.logging});if(f.ok)return{data:go.parseOrThrow(f.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:f.rawResponse};if(f.error.reason==="status-code")switch(f.error.statusCode){case 429:throw new K(f.error.body,f.rawResponse);default:throw new S({statusCode:f.error.statusCode,body:f.error.body,rawResponse:f.rawResponse})}return N(f.error,f.rawResponse,"POST","/v1/connect/{project_id}/webhook/regenerate_signing_key")})}}var ve=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};class td{constructor(o){this._options=Q(o)}list(){return ve(this,arguments,void 0,function*(o={},e){const n=I.interceptFunction(t=>ve(this,void 0,void 0,function*(){var d,u,c,s,r,l,_,h,g,f,v;const{after:P,before:R,limit:j,q:y}=t,D={after:P,before:R,limit:j,q:y},W=yield this._options.authProvider.getAuthRequest(),G=C(W.headers,(d=this._options)===null||d===void 0?void 0:d.headers,M({"x-pd-environment":(u=e?.projectEnvironment)!==null&&u!==void 0?u:(c=this._options)===null||c===void 0?void 0:c.projectEnvironment}),e?.headers),U=yield A({url:$((r=(s=yield b.get(this._options.baseUrl))!==null&&s!==void 0?s:yield b.get(this._options.environment))!==null&&r!==void 0?r:z.Prod,"v1/connect/projects"),method:"GET",headers:G,queryString:V().addMany(D).mergeAdditional(e?.queryParams).build(),timeoutMs:((h=(l=e?.timeoutInSeconds)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.timeoutInSeconds)!==null&&h!==void 0?h:60)
2*1e3,maxRetries:(g=e?.maxRetries)!==null&&g!==void 0?g:(f=this._options)===null||f===void 0?void 0:f.maxRetries,abortSignal:e?.abortSignal,fetchFn:(v=this._options)===null||v===void 0?void 0:v.fetch,logging:this._options.logging});if(U.ok)return{data:Cr.parseOrThrow(U.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:U.rawResponse};if(U.error.reason==="status-code")switch(U.error.statusCode){case 404:throw new bo(U.error.body,U.rawResponse);case 429:throw new K(U.error.body,U.rawResponse);default:throw new S({statusCode:U.error.statusCode,body:U.error.body,rawResponse:U.rawResponse})}return N(U.error,U.rawResponse,"GET","/v1/connect/projects")})),i=yield n(o).withRawResponse();return new ie({response:i.data,rawResponse:i.rawResponse,hasNextPage:t=>t?.pageInfo.endCursor!=null&&!(typeof t?.pageInfo.endCursor=="string"&&t?.pageInfo.endCursor===""),getItems:t=>{var d;return(d=t?.data)!==null&&d!==void 0?d:[]},loadPage:t=>n(re(o,"after",t?.pageInfo.endCursor))})})}create(o,e){return I.fromPromise(this.__create(o,e))}__create(o,e){return ve(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,"v1/connect/projects"),method:"POST",headers:f,contentType:"application/json",queryString:V().mergeAdditional(e?.queryParams).build(),requestType:"json",body:oi.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:We.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"POST","/v1/connect/projects")})}retrieve(o,e){return I.fromPromise(this.__retrieve(o,e))}__retrieve(o,e){return ve(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/projects/${T(o)}`),method:"GET",headers:f,queryString:V().mergeAdditional(e?.queryParams).build(),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:We.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"GET","/v1/connect/projects/{project_id}")})}delete(o,e){return I.fromPromise(this.__delete(o,e))}__delete(o,e){return ve(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/projects/${T(o)}`),method:"DELETE",headers:f,queryString:V().mergeAdditional(e?.queryParams).build(),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:void 0,rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"DELETE","/v1/connect/projects/{project_id}")})}update(o,e={},n){return I.fromPromise(this.__update(o,e,n))}__update(o){return ve(this,arguments,void 0,function*(e,n={},i){var t,d,u,c,s,r,l,_,h,g,f;const v=yield this._options.authProvider.getAuthRequest(),P=C(v.headers,(t=this._options)===null||t===void 0?void 0:t.headers,M({"x-pd-environment":(d=i?.projectEnvironment)!==null&&d!==void 0?d:(u=this._options)===null||u===void 0?void 0:u.projectEnvironment}),i?.headers),R=yield A({url:$((s=(c=yield b.get(this._options.baseUrl))!==null&&c!==void 0?c:yield b.get(this._options.environment))!==null&&s!==void 0?s:z.Prod,`v1/connect/projects/${T(e)}`),method:"PATCH",headers:P,contentType:"application/json",queryString:V().mergeAdditional(i?.queryParams).build(),requestType:"json",body:ti.jsonOrThrow(n,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((_=(r=i?.timeoutInSeconds)!==null&&r!==void 0?r:(l=this._options)===null||l===void 0?void 0:l.timeoutInSeconds)!==null&&_!==void 0?_:60)*1e3,maxRetries:(h=i?.maxRetries)!==null&&h!==void 0?h:(g=this._options)===null||g===void 0?void 0:g.maxRetries,abortSignal:i?.abortSignal,fetchFn:(f=this._options)===null||f===void 0?void 0:f.fetch,logging:this._options.logging});if(R.ok)return{data:We.parseOrThrow(R.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:R.rawResponse};if(R.error.reason==="status-code")switch(R.error.statusCode){case 429:throw new K(R.error.body,R.rawResponse);default:throw new S({statusCode:R.error.statusCode,body:R.error.body,rawResponse:R.rawResponse})}return N(R.error,R.rawResponse,"PATCH","/v1/connect/projects/{project_id}")})}updateLogo(o,e,n){return I.fromPromise(this.__updateLogo(o,e,n))}__updateLogo(o,e,n){return ve(this,void 0,void 0,function*(){var i,t,d,u,c,s,r,l,_,h,g;const f=yield this._options.authProvider.getAuthRequest(),v=C(f.headers,(i=this._options)===null||i===void 0?void 0:i.headers,M({"x-pd-environment":(t=n?.projectEnvironment)!==null&&t!==void 0?t:(d=this._options)===null||d===void 0?void 0:d.projectEnvironment}),n?.headers),P=yield A({url:$((c=(u=yield b.get(this._options.baseUrl))!==null&&u!==void 0?u:yield b.get(this._options.environment))!==null&&c!==void 0?c:z.Prod,`v1/connect/projects/${T(o)}/logo`),method:"POST",headers:v,contentType:"application/json",queryString:V().mergeAdditional(n?.queryParams).build(),requestType:"json",body:ni.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((l=(s=n?.timeoutInSeconds)!==null&&s!==void 0?s:(r=this._options)===null||r===void 0?void 0:r.timeoutInSeconds)!==null&&l!==void 0?l:60)*1e3,maxRetries:(_=n?.maxRetries)!==null&&_!==void 0?_:(h=this._options)===null||h===void 0?void 0:h.maxRetries,abortSignal:n?.abortSignal,fetchFn:(g=this._options)===null||g===void 0?void 0:g.fetch,logging:this._options.logging});if(P.ok)return{data:void 0,rawResponse:P.rawResponse};if(P.error.reason==="status-code")switch(P.error.statusCode){case 400:throw new le(P.error.body,P.rawResponse);case 429:throw new K(P.error.body,P.rawResponse);default:throw new S({statusCode:P.error.statusCode,body:P.error.body,rawResponse:P.rawResponse})}return N(P.error,P.rawResponse,"POST","/v1/connect/projects/{project_id}/logo")})}retrieveInfo(o){return I.fromPromise(this.__retrieveInfo(o))}__retrieveInfo(o){return ve(this,void 0,void 0,function*(){var e,n,i,t,d,u,c,s,r,l,_;const h=yield this._options.authProvider.getAuthRequest(),g=C(h.headers,(e=this._options)===null||e===void 0?void 0:e.headers,M({"x-pd-environment":(n=o?.projectEnvironment)!==null&&n!==void 0?n:(i=this._options)===null||i===void 0?void 0:i.projectEnvironment}),o?.headers),f=yield A({url:$((d=(t=yield b.get(this._options.baseUrl))!==null&&t!==void 0?t:yield b.get(this._options.environment))!==null&&d!==void 0?d:z.Prod,`v1/connect/${T(this._options.projectId)}/projects/info`),method:"GET",headers:g,queryString:V().mergeAdditional(o?.queryParams).build(),timeoutMs:((s=(u=o?.timeoutInSeconds)!==null&&u!==void 0?u:(c=this._options)===null||c===void 0?void 0:c.timeoutInSeconds)!==null&&s!==void 0?s:60)*1e3,maxRetries:(r=o?.maxRetries)!==null&&r!==void 0?r:(l=this._options)===null||l===void 0?void 0:l.maxRetries,abortSignal:o?.abortSignal,fetchFn:(_=this._options)===null||_===void 0?void 0:_.fetch,logging:this._options.logging});if(f.ok)return{data:Ar.parseOrThrow(f.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:f.rawResponse};if(f.error.reason==="status-code")switch(f.error.statusCode){case 429:throw new K(f.error.body,f.rawResponse);default:throw new S({statusCode:f.error.statusCode,body:f.error.body,rawResponse:f.rawResponse})}return N(f.error,f.rawResponse,"GET","/v1/connect/{project_id}/projects/info")})}}var $e=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};class Se{constructor(o){this._options=Q(o)}transformProxyHeaders(o){if(!o)return;const e={};for(const[n,i]of Object.entries(o)){const t=`x-pd-proxy-${n.toLowerCase()}`;e[t]=i}return e}getResponseType(o){const e=o?.["x-pd-proxy-accept"];if(!e)return;const n=typeof e=="string"?e:String(e??"");return Se.JSON_ACCEPT_REGEX.test(n)?void 0:"binary-response"}isJsonResponse(o){const e=o.rawResponse.headers.get("content-type");return e?Se.JSON_CONTENT_TYPE_REGEX.test(e):!1}get(o,e){return I.fromPromise(this.__get(o,e))}__get(o,e){return $e(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_;const{url:h,externalUserId:g,accountId:f,params:v,headers:P}=o,R=xe(h,v),j=Ce(R),y=this.transformProxyHeaders(P),D={external_user_id:g,account_id:f},W=yield this._options.authProvider.getAuthRequest(),G=C(W.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),y,e?.headers),U=this.getResponseType(G),E=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${encodeURIComponent(this._options.projectId)}/proxy/${encodeURIComponent(j)}`),method:"GET",headers:G,queryParameters:Object.assign(Object.assign({},D),e?.queryParams),responseType:U,timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal});if(E.ok)return this.isJsonResponse(E)?{data:Me.parseOrThrow(E.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:E.rawResponse}:{data:E.body,rawResponse:E.rawResponse};if(E.error.reason==="status-code")switch(E.error.statusCode){case 429:throw new K(E.error.body,E.rawResponse);default:throw new S({statusCode:E.error.statusCode,body:E.error.body,rawResponse:E.rawResponse})}switch(E.error.reason){case"non-json":throw new S({statusCode:E.error.statusCode,body:E.error.rawBody,rawResponse:E.rawResponse});case"timeout":throw new Pe("Timeout exceeded when calling GET /v1/connect/{project_id}/proxy/{url_64}.");case"body-is-null":throw new S({statusCode:E.error.statusCode,rawResponse:E.rawResponse});case"unknown":throw new S({message:E.error.errorMessage,rawResponse:E.rawResponse})}})}post(o,e){return I.fromPromise(this.__post(o,e))}__post(o,e){return $e(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_;const{url:h,externalUserId:g,accountId:f,body:v,params:P,headers:R}=o,j=xe(h,P),y=Ce(j),D=this.transformProxyHeaders(R),W={external_user_id:g,account_id:f},G=yield this._options.authProvider.getAuthRequest(),U=C(G.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),D,e?.headers),E=this.getResponseType(U),k=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${encodeURIComponent(this._options.projectId)}/proxy/${encodeURIComponent(y)}`),method:"POST",headers:U,contentType:"application/json",queryParameters:Object.assign(Object.assign({},W),e?.queryParams),requestType:"json",body:ri.jsonOrThrow(v,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),responseType:E,timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal});if(k.ok)return this.isJsonResponse(k)?{data:Me.parseOrThrow(k.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:k.rawResponse}:{data:k.body,rawResponse:k.rawResponse};if(k.error.reason==="status-code")switch(k.error.statusCode){case 429:throw new K(k.error.body,k.rawResponse);default:throw new S({statusCode:k.error.statusCode,body:k.error.body,rawResponse:k.rawResponse})}switch(k.error.reason){case"non-json":throw new S({statusCode:k.error.statusCode,body:k.error.rawBody,rawResponse:k.rawResponse});case"timeout":throw new Pe("Timeout exceeded when calling POST /v1/connect/{project_id}/proxy/{url_64}.");case"body-is-null":throw new S({statusCode:k.error.statusCode,rawResponse:k.rawResponse});case"unknown":throw new S({message:k.error.errorMessage,rawResponse:k.rawResponse})}})}put(o,e){return I.fromPromise(this.__put(o,e))}__put(o,e){return $e(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_;const{url:h,externalUserId:g,accountId:f,body:v,params:P,headers:R}=o,j=xe(h,P),y=Ce(j),D=this.transformProxyHeaders(R),W={external_user_id:g,account_id:f},G=yield this._options.authProvider.getAuthRequest(),U=C(G.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),D,e?.headers),E=this.getResponseType(U),k=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==
2null&&u!==void 0?u:z.Prod,`v1/connect/${encodeURIComponent(this._options.projectId)}/proxy/${encodeURIComponent(y)}`),method:"PUT",headers:U,contentType:"application/json",queryParameters:Object.assign(Object.assign({},W),e?.queryParams),requestType:"json",body:di.jsonOrThrow(v,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),responseType:E,timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal});if(k.ok)return this.isJsonResponse(k)?{data:Me.parseOrThrow(k.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:k.rawResponse}:{data:k.body,rawResponse:k.rawResponse};if(k.error.reason==="status-code")switch(k.error.statusCode){case 429:throw new K(k.error.body,k.rawResponse);default:throw new S({statusCode:k.error.statusCode,body:k.error.body,rawResponse:k.rawResponse})}switch(k.error.reason){case"non-json":throw new S({statusCode:k.error.statusCode,body:k.error.rawBody,rawResponse:k.rawResponse});case"timeout":throw new Pe("Timeout exceeded when calling PUT /v1/connect/{project_id}/proxy/{url_64}.");case"body-is-null":throw new S({statusCode:k.error.statusCode,rawResponse:k.rawResponse});case"unknown":throw new S({message:k.error.errorMessage,rawResponse:k.rawResponse})}})}delete(o,e){return I.fromPromise(this.__delete(o,e))}__delete(o,e){return $e(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_;const{url:h,externalUserId:g,accountId:f,params:v,headers:P}=o,R=xe(h,v),j=Ce(R),y=this.transformProxyHeaders(P),D={external_user_id:g,account_id:f},W=yield this._options.authProvider.getAuthRequest(),G=C(W.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),y,e?.headers),U=this.getResponseType(G),E=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${encodeURIComponent(this._options.projectId)}/proxy/${encodeURIComponent(j)}`),method:"DELETE",headers:G,queryParameters:Object.assign(Object.assign({},D),e?.queryParams),responseType:U,timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal});if(E.ok)return this.isJsonResponse(E)?{data:Me.parseOrThrow(E.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:E.rawResponse}:{data:E.body,rawResponse:E.rawResponse};if(E.error.reason==="status-code")switch(E.error.statusCode){case 429:throw new K(E.error.body,E.rawResponse);default:throw new S({statusCode:E.error.statusCode,body:E.error.body,rawResponse:E.rawResponse})}switch(E.error.reason){case"non-json":throw new S({statusCode:E.error.statusCode,body:E.error.rawBody,rawResponse:E.rawResponse});case"timeout":throw new Pe("Timeout exceeded when calling DELETE /v1/connect/{project_id}/proxy/{url_64}.");case"body-is-null":throw new S({statusCode:E.error.statusCode,rawResponse:E.rawResponse});case"unknown":throw new S({message:E.error.errorMessage,rawResponse:E.rawResponse})}})}patch(o,e){return I.fromPromise(this.__patch(o,e))}__patch(o,e){return $e(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_;const{url:h,externalUserId:g,accountId:f,body:v,params:P,headers:R}=o,j=xe(h,P),y=Ce(j),D=this.transformProxyHeaders(R),W={external_user_id:g,account_id:f},G=yield this._options.authProvider.getAuthRequest(),U=C(G.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),D,e?.headers),E=this.getResponseType(U),k=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${encodeURIComponent(this._options.projectId)}/proxy/${encodeURIComponent(y)}`),method:"PATCH",headers:U,contentType:"application/json",queryParameters:Object.assign(Object.assign({},W),e?.queryParams),requestType:"json",body:ii.jsonOrThrow(v,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),responseType:E,timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal});if(k.ok)return this.isJsonResponse(k)?{data:Me.parseOrThrow(k.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:k.rawResponse}:{data:k.body,rawResponse:k.rawResponse};if(k.error.reason==="status-code")switch(k.error.statusCode){case 429:throw new K(k.error.body,k.rawResponse);default:throw new S({statusCode:k.error.statusCode,body:k.error.body,rawResponse:k.rawResponse})}switch(k.error.reason){case"non-json":throw new S({statusCode:k.error.statusCode,body:k.error.rawBody,rawResponse:k.rawResponse});case"timeout":throw new Pe("Timeout exceeded when calling PATCH /v1/connect/{project_id}/proxy/{url_64}.");case"body-is-null":throw new S({statusCode:k.error.statusCode,rawResponse:k.rawResponse});case"unknown":throw new S({message:k.error.errorMessage,rawResponse:k.rawResponse})}})}}Se.JSON_ACCEPT_REGEX=/(?:^|,|\s)application\/json(?:\s*;|\s*,|\s*$)/i;Se.JSON_CONTENT_TYPE_REGEX=/^application\/json(?:\s|;|$)/i;var nn=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};class id{constructor(o){this._options=Q(o)}create(o,e){return I.fromPromise(this.__create(o,e))}__create(o,e){return nn(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/tokens`),method:"POST",headers:f,contentType:"application/json",queryString:V().mergeAdditional(e?.queryParams).build(),requestType:"json",body:ai.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:sr.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"POST","/v1/connect/{project_id}/tokens")})}validate(o,e,n){return I.fromPromise(this.__validate(o,e,n))}__validate(o,e,n){return nn(this,void 0,void 0,function*(){var i,t,d,u,c,s,r,l,_,h,g;const{appId:f,accountId:v,oauthAppId:P}
2=e,R={app_id:f,account_id:v,oauth_app_id:P},j=yield this._options.authProvider.getAuthRequest(),y=C(j.headers,(i=this._options)===null||i===void 0?void 0:i.headers,M({"x-pd-environment":(t=n?.projectEnvironment)!==null&&t!==void 0?t:(d=this._options)===null||d===void 0?void 0:d.projectEnvironment}),n?.headers),D=yield A({url:$((c=(u=yield b.get(this._options.baseUrl))!==null&&u!==void 0?u:yield b.get(this._options.environment))!==null&&c!==void 0?c:z.Prod,`v1/connect/tokens/${T(En.jsonOrThrow(o,{omitUndefined:!0}))}/validate`),method:"GET",headers:y,queryString:V().addMany(R).mergeAdditional(n?.queryParams).build(),timeoutMs:((l=(s=n?.timeoutInSeconds)!==null&&s!==void 0?s:(r=this._options)===null||r===void 0?void 0:r.timeoutInSeconds)!==null&&l!==void 0?l:60)*1e3,maxRetries:(_=n?.maxRetries)!==null&&_!==void 0?_:(h=this._options)===null||h===void 0?void 0:h.maxRetries,abortSignal:n?.abortSignal,fetchFn:(g=this._options)===null||g===void 0?void 0:g.fetch,logging:this._options.logging});if(D.ok)return{data:Kr.parseOrThrow(D.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:D.rawResponse};if(D.error.reason==="status-code")switch(D.error.statusCode){case 429:throw new K(D.error.body,D.rawResponse);default:throw new S({statusCode:D.error.statusCode,body:D.error.body,rawResponse:D.rawResponse})}return N(D.error,D.rawResponse,"GET","/v1/connect/tokens/{ctok}/validate")})}}var Re=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};class rd{constructor(o){this._options=Q(o)}list(){return Re(this,arguments,void 0,function*(o={},e){const n=I.interceptFunction(t=>Re(this,void 0,void 0,function*(){var d,u,c,s,r,l,_,h,g,f,v;const{after:P,before:R,limit:j,q:y,app:D,registry:W}=t,G={after:P,before:R,limit:j,q:y,app:D,registry:W!=null?li.jsonOrThrow(W,{unrecognizedObjectKeys:"strip",omitUndefined:!0}):void 0},U=yield this._options.authProvider.getAuthRequest(),E=C(U.headers,(d=this._options)===null||d===void 0?void 0:d.headers,M({"x-pd-environment":(u=e?.projectEnvironment)!==null&&u!==void 0?u:(c=this._options)===null||c===void 0?void 0:c.projectEnvironment}),e?.headers),k=yield A({url:$((r=(s=yield b.get(this._options.baseUrl))!==null&&s!==void 0?s:yield b.get(this._options.environment))!==null&&r!==void 0?r:z.Prod,`v1/connect/${T(this._options.projectId)}/triggers`),method:"GET",headers:E,queryString:V().addMany(G).mergeAdditional(e?.queryParams).build(),timeoutMs:((h=(l=e?.timeoutInSeconds)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.timeoutInSeconds)!==null&&h!==void 0?h:60)*1e3,maxRetries:(g=e?.maxRetries)!==null&&g!==void 0?g:(f=this._options)===null||f===void 0?void 0:f.maxRetries,abortSignal:e?.abortSignal,fetchFn:(v=this._options)===null||v===void 0?void 0:v.fetch,logging:this._options.logging});if(k.ok)return{data:Uo.parseOrThrow(k.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:k.rawResponse};if(k.error.reason==="status-code")switch(k.error.statusCode){case 400:throw new le(k.error.body,k.rawResponse);case 429:throw new K(k.error.body,k.rawResponse);default:throw new S({statusCode:k.error.statusCode,body:k.error.body,rawResponse:k.rawResponse})}return N(k.error,k.rawResponse,"GET","/v1/connect/{project_id}/triggers")})),i=yield n(o).withRawResponse();return new ie({response:i.data,rawResponse:i.rawResponse,hasNextPage:t=>t?.pageInfo.endCursor!=null&&!(typeof t?.pageInfo.endCursor=="string"&&t?.pageInfo.endCursor===""),getItems:t=>{var d;return(d=t?.data)!==null&&d!==void 0?d:[]},loadPage:t=>n(re(o,"after",t?.pageInfo.endCursor))})})}retrieve(o,e={},n){return I.fromPromise(this.__retrieve(o,e,n))}__retrieve(o){return Re(this,arguments,void 0,function*(e,n={},i){var t,d,u,c,s,r,l,_,h,g,f;const{version:v}=n,P={version:v},R=yield this._options.authProvider.getAuthRequest(),j=C(R.headers,(t=this._options)===null||t===void 0?void 0:t.headers,M({"x-pd-environment":(d=i?.projectEnvironment)!==null&&d!==void 0?d:(u=this._options)===null||u===void 0?void 0:u.projectEnvironment}),i?.headers),y=yield A({url:$((s=(c=yield b.get(this._options.baseUrl))!==null&&c!==void 0?c:yield b.get(this._options.environment))!==null&&s!==void 0?s:z.Prod,`v1/connect/${T(this._options.projectId)}/triggers/${T(e)}`),method:"GET",headers:j,queryString:V().addMany(P).mergeAdditional(i?.queryParams).build(),timeoutMs:((_=(r=i?.timeoutInSeconds)!==null&&r!==void 0?r:(l=this._options)===null||l===void 0?void 0:l.timeoutInSeconds)!==null&&_!==void 0?_:60)*1e3,maxRetries:(h=i?.maxRetries)!==null&&h!==void 0?h:(g=this._options)===null||g===void 0?void 0:g.maxRetries,abortSignal:i?.abortSignal,fetchFn:(f=this._options)===null||f===void 0?void 0:f.fetch,logging:this._options.logging});if(y.ok)return{data:Co.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 429:throw new K(y.error.body,y.rawResponse);default:throw new S({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return N(y.error,y.rawResponse,"GET","/v1/connect/{project_id}/triggers/{component_id}")})}configureProp(o,e){return I.fromPromise(this.__configureProp(o,e))}__configureProp(o,e){return Re(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/triggers/configure`),method:"POST",headers:f,contentType:"application/json",queryString:V().mergeAdditional(e?.queryParams).build(),requestType:"json",body:So.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:To.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"POST","/v1/connect/{project_id}/triggers/configure")})}reloadProps(o,e){return I.fromPromise(this.__reloadProps(o,e))}__reloadProps(o,e){return Re(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/triggers/props`),method:"POST",headers:f,contentType:"application/json",queryString:V().mergeAdditional(e?.queryParams).build(),requestType:"json",body:Ao.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:Mo.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"POST","/v1/connect/{project_id}/triggers/props")})}deploy(o,e){return I.fromPromise(this.__deploy(o,e))}__deploy(o,e){return Re(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/triggers/deploy`),method:"POST",headers:f,contentType:"application/json",queryString:V().mergeAdditional(e?.queryParams).build(),requestType:"json",body:si.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:!0}),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:vr.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"POST","/v1/connect/{project_id}/triggers/deploy")})}}var dd=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};class ad{constructor(o){this._options=Q(o)}list(o,e){return I.fromPromise(this.__list(o,e))}__list(o,e){return dd(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const{startTs:g,endTs:f}=o,v={start_ts:g,end_ts:f},P=yield this._options.authProvider.getAuthRequest(),R=C(P.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),j=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,"v1/connect/usage"),method:"GET",headers:R,queryString:V().addMany(v).mergeAdditional(e?.queryParams).build(),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(j.ok)return{data:dr.parseOrThrow(j.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:j.rawResponse};if(j.error.reason==="status-code")switch(j.error.statusCode){case 400:throw new le(j.error.body,j.rawResponse);case 429:throw new K(j.error.body,j.rawResponse);default:throw new S({statusCode:j.error.statusCode,body:j.error.body,rawResponse:j.rawResponse})}return N(j.error,j.rawResponse,"GET","/v1/connect/usage")})}}var so=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};class sd{constructor(o){this._options=Q(o)}deleteExternalUser(o,e){return I.fromPromise(this.__deleteExternalUser(o,e))}__deleteExternalUser(o,e){return so(this,void 0,void 0,function*(){var n,i,t,d,u,c,s,r,l,_,h;const g=yield this._options.authProvider.getAuthRequest(),f=C(g.headers,(n=this._options)===null||n===void 0?void 0:n.headers,M({"x-pd-environment":(i=e?.projectEnvironment)!==null&&i!==void 0?i:(t=this._options)===null||t===void 0?void 0:t.projectEnvironment}),e?.headers),v=yield A({url:$((u=(d=yield b.get(this._options.baseUrl))!==null&&d!==void 0?d:yield b.get(this._options.environment))!==null&&u!==void 0?u:z.Prod,`v1/connect/${T(this._options.projectId)}/users/${T(o)}`),method:"DELETE",headers:f,queryString:V().mergeAdditional(e?.queryParams).build(),timeoutMs:((r=(c=e?.timeoutInSeconds)!==null&&c!==void 0?c:(s=this._options)===null||s===void 0?void 0:s.timeoutInSeconds)!==null&&r!==void 0?r:60)*1e3,maxRetries:(l=e?.maxRetries)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.maxRetries,abortSignal:e?.abortSignal,fetchFn:(h=this._options)===null||h===void 0?void 0:h.fetch,logging:this._options.logging});if(v.ok)return{data:void 0,rawResponse:v.rawResponse};if(v.error.reason==="status-code")switch(v.error.statusCode){case 429:throw new K(v.error.body,v.rawResponse);default:throw new S({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse})}return N(v.error,v.rawResponse,"DELETE","/v1/connect/{project_id}/users/{external_user_id}")})}list(){return so(this,arguments,void 0,function*(o={},e){const n=I.interceptFunction(t=>so(this,void 0,void 0,function*(){var d,u,c,s,r,l,_,h,g,f,v;const{after:P,before:R,limit:j,q:y}=t,D={after:P,before:R,limit:j,q:y},W=yield this._options.authProvider.getAuthRequest(),G=C(W.headers,(d=this._options)===null||d===void 0?void 0:d.headers,M({"x-pd-environment":(u=e?.projectEnvironment)!==null&&u!==void 0?u:(c=this._options)===null||c===void 0?void 0:c.projectEnvironment}),e?.headers),U=yield A({url:$((r=(s=yield b.get(this._options.baseUrl))!==null&&s!==void 0?s:yield b.get(this._options.environment))!==null&&r!==void 0?r:z.Prod,`v1/connect/${T(this._options.projectId)}/users`),method:"GET",headers:G,queryString:V().addMany(D).mergeAdditional(e?.queryParams).build(),timeoutMs:((h=(l=e?.timeoutInSeconds)!==null&&l!==void 0?l:(_=this._options)===null||_===void 0?void 0:_.timeoutInSeconds)!==null&&h!==void 0?h:60)
2*1e3,maxRetries:(g=e?.maxRetries)!==null&&g!==void 0?g:(f=this._options)===null||f===void 0?void 0:f.maxRetries,abortSignal:e?.abortSignal,fetchFn:(v=this._options)===null||v===void 0?void 0:v.fetch,logging:this._options.logging});if(U.ok)return{data:Rr.parseOrThrow(U.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:U.rawResponse};if(U.error.reason==="status-code")switch(U.error.statusCode){case 429:throw new K(U.error.body,U.rawResponse);default:throw new S({statusCode:U.error.statusCode,body:U.error.body,rawResponse:U.rawResponse})}return N(U.error,U.rawResponse,"GET","/v1/connect/{project_id}/users")})),i=yield n(o).withRawResponse();return new ie({response:i.data,rawResponse:i.rawResponse,hasNextPage:t=>t?.pageInfo.endCursor!=null&&!(typeof t?.pageInfo.endCursor=="string"&&t?.pageInfo.endCursor===""),getItems:t=>{var d;return(d=t?.data)!==null&&d!==void 0?d:[]},loadPage:t=>n(re(o,"after",t?.pageInfo.endCursor))})})}}var tn={},ld=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,[])).next())})};let ud=class wo{constructor(o){var e;this._tokenProvider=(e=o.tokenProvider)!==null&&e!==void 0?e:wo.newOAuthTokenProvider(o);const n={getAuthRequest:()=>ld(this,void 0,void 0,function*(){return{headers:{Authorization:`Bearer ${yield this._tokenProvider.getToken()}`}}})},i=C({"x-pd-environment":o?.projectEnvironment,"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"@pipedream/sdk","X-Fern-SDK-Version":Yo,"User-Agent":`@pipedream/sdk/${Yo}`,"X-Fern-Runtime":Je.type,"X-Fern-Runtime-Version":Je.version},o?.headers),t=wo.fetchWithNormalizedPath(o.fetch);this._options=Q(Object.assign(Object.assign({},o),{auth:n,headers:i,fetch:t}))}static fetchWithNormalizedPath(o){const e=o??globalThis.fetch,n=i=>{try{const t=new URL(i);return t.pathname=t.pathname.replace(/\/{2,}/g,"/"),t.href}catch{return i}};return(i,t)=>typeof i=="string"?e(n(i),t):i instanceof URL?e(new URL(n(i.href)),t):e(i,t)}static newOAuthTokenProvider(o){var e,n;const i=(e=o.clientId)!==null&&e!==void 0?e:tn.PIPEDREAM_CLIENT_ID;if(i==null)throw new Error("clientId is required; either pass it as an argument or set the PIPEDREAM_CLIENT_ID environment variable");const t=(n=o.clientSecret)!==null&&n!==void 0?n:tn.PIPEDREAM_CLIENT_SECRET;if(t==null)throw new Error("clientSecret is required; either pass it as an argument or set the PIPEDREAM_CLIENT_SECRET environment variable");return new zn({clientId:i,clientSecret:t,authClient:new mo(Object.assign(Object.assign({},o),{clientId:i,clientSecret:t,environment:o.environment}))})}get appCategories(){var o;return(o=this._appCategories)!==null&&o!==void 0?o:this._appCategories=new Qr(this._options)}get appOverrides(){var o;return(o=this._appOverrides)!==null&&o!==void 0?o:this._appOverrides=new Xr(this._options)}get apps(){var o;return(o=this._apps)!==null&&o!==void 0?o:this._apps=new Yr(this._options)}get accounts(){var o;return(o=this._accounts)!==null&&o!==void 0?o:this._accounts=new Hr(this._options)}get usage(){var o;return(o=this._usage)!==null&&o!==void 0?o:this._usage=new ad(this._options)}get users(){var o;return(o=this._users)!==null&&o!==void 0?o:this._users=new sd(this._options)}get components(){var o;return(o=this._components)!==null&&o!==void 0?o:this._components=new Zr(this._options)}get actions(){var o;return(o=this._actions)!==null&&o!==void 0?o:this._actions=new Jr(this._options)}get triggers(){var o;return(o=this._triggers)!==null&&o!==void 0?o:this._triggers=new rd(this._options)}get deployedTriggers(){var o;return(o=this._deployedTriggers)!==null&&o!==void 0?o:this._deployedTriggers=new Or(this._options)}get fileStash(){var o;return(o=this._fileStash)!==null&&o!==void 0?o:this._fileStash=new ed(this._options)}get projectEnvironment(){var o;return(o=this._projectEnvironment)!==null&&o!==void 0?o:this._projectEnvironment=new nd(this._options)}get projects(){var o;return(o=this._projects)!==null&&o!==void 0?o:this._projects=new td(this._options)}get proxy(){var o;return(o=this._proxy)!==null&&o!==void 0?o:this._proxy=new Se(this._options)}get tokens(){var o;return(o=this._tokens)!==null&&o!==void 0?o:this._tokens=new id(this._options)}get oauthApps(){var o;return(o=this._oauthApps)!==null&&o!==void 0?o:this._oauthApps=new od(this._options)}get oauthTokens(){var o;return(o=this._oauthTokens)!==null&&o!==void 0?o:this._oauthTokens=new mo(this._options)}};var je={},cd=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,[])).next())})};class vd extends ud{constructor(o={}){var e,n,i;const{baseUrl:t=(e=je.PIPEDREAM_BASE_URL)!==null&&e!==void 0?e:z.Prod,headers:d,projectEnvironment:u=je.PIPEDREAM_PROJECT_ENVIRONMENT,projectId:c=(n=je.PIPEDREAM_PROJECT_ID)!==null&&n!==void 0?n:"",workflowDomain:s=je.PIPEDREAM_WORKFLOW_DOMAIN}=o||{};if(u!=null&&u!==Ae.Production&&u!==Ae.Development)throw new Error(`Project environment must be either '${Ae.Production}' or '${Ae.Development}'`);const r={baseUrl:t,headers:d,projectEnvironment:u,projectId:c};if("tokenProvider"in o)r.tokenProvider=o.tokenProvider;else{const{clientId:l=je.PIPEDREAM_CLIENT_ID,clientSecret:_=je.PIPEDREAM_CLIENT_SECRET}=o||{};if(!l||!_)throw new Error("Client ID and secret are both required and cannot be blank");if(!c)throw new Error("Project ID cannot be blank");(i=r.projectEnvironment)!==null&&i!==void 0||(r.projectEnvironment=Ae.Production),r.clientId=l,r.clientSecret=_}super(r),this._workflowDomain=s}get rawAccessToken(){return this._tokenProvider.getToken()}get workflows(){var o;return(o=this._workflows)!==null&&o!==void 0?o:this._workflows=new Ut(Object.assign(Object.assign({},this._options),{token:()=>cd(this,void 0,void 0,function*(){return yield this._tokenProvider.getToken()}),workflowDomain:this._workflowDomain}))}}var rn=function(a,o,e,n){function i(t){return t instanceof e?t:new e(function(d){d(t)})}return new(e||(e=Promise))(function(t,d){function u(r){try{s(n.next(r))}catch(l){d(l)}}function c(r){try{s(n.throw(r))}catch(l){d(l)}}function s(r){r.done?t(r.value):i(r.value).then(u,c)}s((n=n.apply(a,o||[])).next())})};typeof process>"u"&&(globalThis.process||(globalThis.process={env:{}}));
2class dn extends Error{}class hd extends vd{constructor(o){const{baseUrl:e,externalUserId:n,headers:i,projectEnvironment:t,tokenCallback:d,workflowDomain:u}=o||{};if(!n)throw new Error("The external user ID cannot be blank");if(typeof d!="function")throw new Error("The token callback must be a function");const c=new Mn({externalUserId:n,tokenCallback:d});super({baseUrl:e,headers:i,projectEnvironment:t,projectId:"",tokenProvider:c,workflowDomain:u}),this.iframeId=0,this.frontendUrl=`https://${o.frontendHost||"pipedream.com"}`,this.iframeUrl=`${this.frontendUrl}/_static/connect.html`}get externalUserId(){return this._tokenProvider.externalUserId}connectAccount(o){return rn(this,void 0,void 0,function*(){var e;let n=!1,i=!1;const t=d=>{var u,c,s,r,l;switch((u=d.data)===null||u===void 0?void 0:u.type){case"success":n=!0,i=!0,(c=o.onSuccess)===null||c===void 0||c.call(o,{id:(s=d.data)===null||s===void 0?void 0:s.authProvisionId});break;case"error":i=!0,(r=o.onError)===null||r===void 0||r.call(o,new dn(d.data.error));break;case"close":this.cleanup(t),(l=o.onClose)===null||l===void 0||l.call(o,{successful:n,completed:i});break}};window.addEventListener("message",t);try{yield this.createIframe(o)}catch(d){(e=o.onError)===null||e===void 0||e.call(o,d)}this._tokenProvider.refresh()})}cleanup(o){var e;(e=this.iframe)===null||e===void 0||e.remove(),window.removeEventListener("message",o)}createIframe(o){return rn(this,void 0,void 0,function*(){const e=o.token||(yield this._tokenProvider.getToken()),n=new URLSearchParams({token:e});if(typeof o.app=="string")n.set("app",o.app);else throw new dn("Object app not yet supported");o.oauthAppId&&n.set("oauthAppId",o.oauthAppId),o.accountId&&n.set("accountId",o.accountId),o.hideClose&&n.set("hideClose","true"),o.oauthScopeProfile&&n.set("oauthScopeProfile",o.oauthScopeProfile),o.customOauthClient&&n.set("customOauthClient","true");const i=document.createElement("iframe");i.id=`pipedream-connect-iframe-${this.iframeId++}`,i.title="Pipedream Connect",i.src=`${this.iframeUrl}?${n.toString()}`,i.style.cssText="position:fixed;inset:0;z-index:2147483647;border:0;display:block;overflow:hidden auto",i.width="100%",i.height="100%",i.onload=()=>{this.iframe=i},document.body.appendChild(i)})}}export{le as BadRequestError,dn as ConnectError,ge as HTTPAuthType,bo as NotFoundError,hd as PipedreamClient,z as PipedreamEnvironment,S as PipedreamError,Pe as PipedreamTimeoutError,Ae as ProjectEnvironment,K as TooManyRequestsError};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.