@coalescesoftware/coa 7.30.7 → 7.30.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/coa.js CHANGED
@@ -1947,7 +1947,7 @@ Calls to async() callback can have unexpected results.`),d=!0,function(g,b){g?c(
1947
1947
  [cause]: `+(this.cause instanceof Error?this.cause.stack:this.cause?.toString())),this.toFormattedStringWithCode()+`
1948
1948
  `+this.stack+n}handleExpressResponse(n){n.status(this.statusCode()).json(this.toTRunError())}};function y1(r){return typeof r=="object"&&r instanceof et}function $8t(r){return typeof r=="object"&&r instanceof Error&&typeof r.code=="string"}var Pee=class extends et{},Ya=class extends et{statusCode(){return 404}},mo=class extends et{statusCode(){return 400}},m3=class extends et{statusCode(){return 403}},y3=class extends et{statusCode(){return 409}},Yp=class extends et{constructor(t="Not implemented",n,i){super(t,n,501,i)}};var rBe=class extends et{constructor(t="Unauthorized",n,i){super(t,n,401,i)}};var Aue=class extends Yp{constructor(n,i,o,s){super(`${i} was not implemented for ${n}`,o,s);this.kind=n;this.sourceName=i}},Nee=class extends Pee{diagnostics;constructor(t,n){super("Unable to determine Deploy Service URL. In CLI contexts, SCHEDULER_ADDRESS must be set. In backend service contexts, use GetDeployServiceURLOnBackend instead.",n),this.diagnostics=t}};function gm(r,t,n,...i){if(!r){let o=`ASSERTION FAILED: ${t}`,s=new et(o);throw n.emerg(o,{stack:s.stack,args:i}),s}}var _Pa,qLi=r=>{_Pa=r},Tc=()=>_Pa;var rqd=M.object({NODE_ENV:M.string().default("development"),LOG_LEVEL:M.string().default("info").optional(),CONSOLE_JSON_LOGS:M.string().default("true").optional(),REACT_APP_COALESCE_VERSION:M.string().default("").optional(),REACT_APP_COALESCE_GIT_HASH:M.string().default("").optional(),HOSTNAME:M.string().default("").optional(),RUNTIME_ENVIRONMENT:M.string().default("").optional()});var pu=function(r){return r.info="info",r.warn="warn",r.error="error",r.debug="debug",r.trace="trace",r.fatal="fatal",r}({}),sSe={[pu.trace]:10,[pu.debug]:20,[pu.info]:30,[pu.warn]:40,[pu.error]:50,[pu.fatal]:60},uhy={10:pu.trace,20:pu.debug,30:pu.info,40:pu.warn,50:pu.error,60:pu.fatal};var TP=function(r){return r.onBeforeDataOut="onBeforeDataOut",r.shouldSendToLogger="shouldSendToLogger",r.onMetadataCalled="onMetadataCalled",r.onBeforeMessageOut="onBeforeMessageOut",r.onContextCalled="onContextCalled",r}({});var vPa=class TPa{context={};hasContext=!1;setContext(t){if(!t){this.context={},this.hasContext=!1;return}this.context=t,this.hasContext=!0}appendContext(t){this.context={...this.context,...t},this.hasContext=!0}getContext(){return this.context}hasContextData(){return this.hasContext}onChildLoggerCreated({parentContextManager:t,childContextManager:n}){if(t.hasContextData()){let i=t.getContext();n.setContext({...i})}}clone(){let t=new TPa;return t.setContext({...this.context}),t.hasContext=this.hasContext,t}};var X8t=class{id;enabled;level;consoleDebug;constructor(r){this.id=Date.now().toString()+Math.random().toString(),this.enabled=r.enabled??!0,this.consoleDebug=r.consoleDebug??!1,this.level=r.level??"trace"}_sendToLogger(r){if(!this.enabled||sSe[r.logLevel]<sSe[this.level])return;let t=this.shipToLogger(r);if(this.consoleDebug)switch(r.logLevel){case pu.info:console.info(...t);break;case pu.warn:console.warn(...t);break;case pu.error:console.error(...t);break;case pu.trace:console.debug(...t);break;case pu.debug:console.debug(...t);break;case pu.fatal:console.debug(...t);break;default:console.log(...t)}}getLoggerInstance(){throw new Error("This transport does not have a logger instance")}};var IPa=class{err;metadata;structuredLogger;hasMetadata;pluginManager;constructor(r){this.err=null,this.metadata={},this.structuredLogger=r,this.hasMetadata=!1,this.pluginManager=r.pluginManager}withMetadata(r){let{pluginManager:t,structuredLogger:{_config:{consoleDebug:n}}}=this;if(!r)return n&&console.debug("[LogLayer] withMetadata was called with no metadata; dropping."),this;let i=r;return t.hasPlugins(TP.onMetadataCalled)&&(i=t.runOnMetadataCalled(r,this.structuredLogger),!i)?(n&&console.debug("[LogLayer] Metadata was dropped due to plugin returning falsy value."),this):(this.metadata={...this.metadata,...i},this.hasMetadata=!0,this)}withError(r){return this.err=r,this}info(...r){this.structuredLogger.isLevelEnabled(pu.info)&&(this.structuredLogger._formatMessage(r),this.formatLog(pu.info,r))}warn(...r){this.structuredLogger.isLevelEnabled(pu.warn)&&(this.structuredLogger._formatMessage(r),this.formatLog(pu.warn,r))}error(...r){this.structuredLogger.isLevelEnabled(pu.error)&&(this.structuredLogger._formatMessage(r),this.formatLog(pu.error,r))}debug(...r){this.structuredLogger.isLevelEnabled(pu.debug)&&(this.structuredLogger._formatMessage(r),this.formatLog(pu.debug,r))}trace(...r){this.structuredLogger.isLevelEnabled(pu.trace)&&(this.structuredLogger._formatMessage(r),this.formatLog(pu.trace,r))}fatal(...r){this.structuredLogger.isLevelEnabled(pu.fatal)&&(this.structuredLogger._formatMessage(r),this.formatLog(pu.fatal,r))}disableLogging(){return this.structuredLogger.disableLogging(),this}enableLogging(){return this.structuredLogger.enableLogging(),this}formatLog(r,t){let{muteMetadata:n}=this.structuredLogger._config,i=n?!1:this.hasMetadata;this.structuredLogger._formatLog({logLevel:r,params:t,metadata:i?this.metadata:null,err:this.err})}},nqd=[TP.onBeforeDataOut,TP.onMetadataCalled,TP.shouldSendToLogger,TP.onBeforeMessageOut,TP.onContextCalled],OPa=class{idToPlugin;onBeforeDataOut=[];shouldSendToLogger=[];onMetadataCalled=[];onBeforeMessageOut=[];onContextCalled=[];constructor(r){this.idToPlugin={},this.mapPlugins(r),this.indexPlugins()}mapPlugins(r){for(let t of r){if(t.id||(t.id=Date.now().toString()+Math.random().toString()),this.idToPlugin[t.id])throw new Error(`[LogLayer] Plugin with id ${t.id} already exists.`);t.registeredAt=Date.now(),this.idToPlugin[t.id]=t}}indexPlugins(){this.onBeforeDataOut=[],this.shouldSendToLogger=[],this.onMetadataCalled=[],this.onBeforeMessageOut=[],this.onContextCalled=[];let r=Object.values(this.idToPlugin).sort((t,n)=>t.registeredAt-n.registeredAt);for(let t of r){if(t.disabled)return;for(let n of nqd)t[n]&&t.id&&this[n].push(t.id)}}hasPlugins(r){return this[r].length>0}countPlugins(r){return r?this[r].length:Object.keys(this.idToPlugin).length}addPlugins(r){this.mapPlugins(r),this.indexPlugins()}enablePlugin(r){let t=this.idToPlugin[r];t&&(t.disabled=!1),this.indexPlugins()}disablePlugin(r){let t=this.idToPlugin[r];t&&(t.disabled=!0),this.indexPlugins()}removePlugin(r){delete this.idToPlugin[r],this.indexPlugins()}runOnBeforeDataOut(r,t){let n={...r};for(let i of this.onBeforeDataOut){let o=this.idToPlugin[i];if(o.onBeforeDataOut){let s=o.onBeforeDataOut({data:n.data,logLevel:n.logLevel,error:n.error,metadata:n.metadata,context:n.context},t);s&&(n.data||(n.data={}),Object.assign(n.data,s))}}return n.data}runShouldSendToLogger(r,t){return!this.shouldSendToLogger.some(n=>!this.idToPlugin[n].shouldSendToLogger?.(r,t))}runOnMetadataCalled(r,t){let n={...r};for(let i of this.onMetadataCalled){let o=this.idToPlugin[i].onMetadataCalled?.(n,t);if(o)n=o;else return null}return n}runOnBeforeMessageOut(r,t){let n=[...r.messages];for(let i of this.onBeforeMessageOut){let o=this.idToPlugin[i].onBeforeMessageOut?.({messages:n,logLevel:r.logLevel},t);o&&(n=o)}return n}runOnContextCalled(r,t){let n={...r};for(let i of this.onContextCalled){let o=this.idToPlugin[i].onContextCalled?.(n,t);if(o)n=o;else return null}return n}},Z8t=class RPa{pluginManager;idToTransport;hasMultipleTransports;singleTransport;contextManager;logLevelEnabledStatus={info:!0,warn:!0,error:!0,debug:!0,trace:!0,fatal:!0};_config;constructor(t){this._config={...t,enabled:t.enabled??!0},this._config.enabled||this.disableLogging(),this.contextManager=new vPa,this.pluginManager=new OPa(t.plugins||[]),this._config.errorFieldName||(this._config.errorFieldName="err"),this._config.copyMsgOnOnlyError||(this._config.copyMsgOnOnlyError=!1),this._initializeTransports(this._config.transport)}withContextManager(t){return this.contextManager&&typeof this.contextManager[Symbol.dispose]=="function"&&this.contextManager[Symbol.dispose](),this.contextManager=t,this}getContextManager(){return this.contextManager}_initializeTransports(t){if(this.idToTransport)for(let n in this.idToTransport)this.idToTransport[n]&&typeof this.idToTransport[n][Symbol.dispose]=="function"&&this.idToTransport[n][Symbol.dispose]();this.hasMultipleTransports=Array.isArray(t)&&t.length>1,this.singleTransport=this.hasMultipleTransports?null:Array.isArray(t)?t[0]:t,Array.isArray(t)?this.idToTransport=t.reduce((n,i)=>(n[i.id]=i,n),{}):this.idToTransport={[t.id]:t}}withPrefix(t){let n=this.child();return n._config.prefix=t,n}withContext(t){let n=t;return t?this.pluginManager.hasPlugins(TP.onContextCalled)&&(n=this.pluginManager.runOnContextCalled(t,this),!n)?(this._config.consoleDebug&&console.debug("[LogLayer] Context was dropped due to plugin returning falsy value."),this):(this.contextManager.appendContext(n),this):(this._config.consoleDebug&&console.debug("[LogLayer] withContext was called with no context; dropping."),this)}clearContext(){return this.contextManager.setContext(void 0),this}getContext(){return this.contextManager.getContext()}addPlugins(t){this.pluginManager.addPlugins(t)}enablePlugin(t){this.pluginManager.enablePlugin(t)}disablePlugin(t){this.pluginManager.disablePlugin(t)}removePlugin(t){this.pluginManager.removePlugin(t)}withMetadata(t){return new IPa(this).withMetadata(t)}withError(t){return new IPa(this).withError(t)}child(){let t=new RPa({...this._config,transport:Array.isArray(this._config.transport)?[...this._config.transport]:this._config.transport}).withPluginManager(this.pluginManager).withContextManager(this.contextManager.clone());return this.contextManager.onChildLoggerCreated({parentContextManager:this.contextManager,childContextManager:t.contextManager,parentLogger:this,childLogger:t}),t}withFreshTransports(t){return this._config.transport=t,this._initializeTransports(t),this}withFreshPlugins(t){return this._config.plugins=t,this.pluginManager=new OPa(t),this}withPluginManager(t){return this.pluginManager=t,this}errorOnly(t,n){let i=n?.logLevel||pu.error;if(!this.isLevelEnabled(i))return;let{copyMsgOnOnlyError:o}=this._config,s={logLevel:i,err:t};(o&&n?.copyMsg!==!1||n?.copyMsg===!0)&&t?.message&&(s.params=[t.message]),this._formatLog(s)}metadataOnly(t,n=pu.info){if(!this.isLevelEnabled(n))return;let{muteMetadata:i,consoleDebug:o}=this._config;if(i)return;if(!t){o&&console.debug("[LogLayer] metadataOnly was called with no metadata; dropping.");return}let s=t;if(this.pluginManager.hasPlugins(TP.onMetadataCalled)&&(s=this.pluginManager.runOnMetadataCalled(t,this),!s)){o&&console.debug("[LogLayer] Metadata was dropped due to plugin returning falsy value.");return}let a={logLevel:n,metadata:s};this._formatLog(a)}info(...t){this.isLevelEnabled(pu.info)&&(this._formatMessage(t),this._formatLog({logLevel:pu.info,params:t}))}warn(...t){this.isLevelEnabled(pu.warn)&&(this._formatMessage(t),this._formatLog({logLevel:pu.warn,params:t}))}error(...t){this.isLevelEnabled(pu.error)&&(this._formatMessage(t),this._formatLog({logLevel:pu.error,params:t}))}debug(...t){this.isLevelEnabled(pu.debug)&&(this._formatMessage(t),this._formatLog({logLevel:pu.debug,params:t}))}trace(...t){this.isLevelEnabled(pu.trace)&&(this._formatMessage(t),this._formatLog({logLevel:pu.trace,params:t}))}fatal(...t){this.isLevelEnabled(pu.fatal)&&(this._formatMessage(t),this._formatLog({logLevel:pu.fatal,params:t}))}raw(t){if(!this.isLevelEnabled(t.logLevel))return;let n={logLevel:t.logLevel,params:t.messages,metadata:t.metadata,err:t.error,context:t.context};this._formatMessage(t.messages),this._formatLog(n)}disableLogging(){for(let t of Object.keys(this.logLevelEnabledStatus))this.logLevelEnabledStatus[t]=!1;return this}enableLogging(){for(let t of Object.keys(this.logLevelEnabledStatus))this.logLevelEnabledStatus[t]=!0;return this}muteContext(){return this._config.muteContext=!0,this}unMuteContext(){return this._config.muteContext=!1,this}muteMetadata(){return this._config.muteMetadata=!0,this}unMuteMetadata(){return this._config.muteMetadata=!1,this}enableIndividualLevel(t){let n=t;return n in this.logLevelEnabledStatus&&(this.logLevelEnabledStatus[n]=!0),this}disableIndividualLevel(t){let n=t;return n in this.logLevelEnabledStatus&&(this.logLevelEnabledStatus[n]=!1),this}setLevel(t){let n=sSe[t];for(let i of Object.values(pu)){let o=i,s=sSe[i];this.logLevelEnabledStatus[o]=s>=n}return this}isLevelEnabled(t){let n=t;return this.logLevelEnabledStatus[n]}formatContext(t){let{contextFieldName:n,muteContext:i}=this._config;return t&&Object.keys(t).length>0&&!i?n?{[n]:{...t}}:{...t}:{}}formatMetadata(t=null){let{metadataFieldName:n,muteMetadata:i}=this._config;return t&&!i?n?{[n]:{...t}}:{...t}:{}}getLoggerInstance(t){let n=this.idToTransport[t];if(n)return n.getLoggerInstance()}_formatMessage(t=[]){let{prefix:n}=this._config;n&&typeof t[0]=="string"&&(t[0]=`${n} ${t[0]}`)}_formatLog({logLevel:t,params:n=[],metadata:i=null,err:o,context:s=null}){let{errorSerializer:a,errorFieldInMetadata:u,muteContext:l,contextFieldName:c,metadataFieldName:d,errorFieldName:p}=this._config,f=s!==null?s:this.contextManager.getContext(),A=!!i||(l?!1:s!==null?Object.keys(s).length>0:this.contextManager.hasContextData()),g={};if(A)if(c&&c===d){let b=this.formatContext(f)[c],_=this.formatMetadata(i)[d];g={[c]:{...b,..._}}}else g={...this.formatContext(f),...this.formatMetadata(i)};if(o){let b=a?a(o):o;u&&i&&d?g?.[d]?g[d][p]=b:g={...g,[d]:{[p]:b}}:u&&!i&&d?g={...g,[d]:{[p]:b}}:g={...g,[p]:b},A=!0}if(this.pluginManager.hasPlugins(TP.onBeforeDataOut)&&(g=this.pluginManager.runOnBeforeDataOut({data:A?g:void 0,logLevel:t,error:o,metadata:i,context:f},this),g&&!A&&(A=!0)),this.pluginManager.hasPlugins(TP.onBeforeMessageOut)&&(n=this.pluginManager.runOnBeforeMessageOut({messages:[...n],logLevel:t},this)),this.hasMultipleTransports){let b=this._config.transport.filter(_=>_.enabled).map(async _=>{if(!(this.pluginManager.hasPlugins(TP.shouldSendToLogger)&&!this.pluginManager.runShouldSendToLogger({messages:[...n],data:A?g:void 0,logLevel:t,transportId:_.id,error:o,metadata:i,context:f},this)))return _._sendToLogger({logLevel:t,messages:[...n],data:A?g:void 0,hasData:A,error:o,metadata:i,context:f})});Promise.all(b).catch(_=>{this._config.consoleDebug&&console.error("[LogLayer] Error executing transports:",_)})}else{if(!this.singleTransport?.enabled||this.pluginManager.hasPlugins(TP.shouldSendToLogger)&&!this.pluginManager.runShouldSendToLogger({messages:[...n],data:A?g:void 0,logLevel:t,transportId:this.singleTransport.id,error:o,metadata:i,context:f},this))return;this.singleTransport._sendToLogger({logLevel:t,messages:[...n],data:A?g:void 0,hasData:A,error:o,metadata:i,context:f})}}};var MPa=class extends X8t{shipToLoggerFn;constructor(r){super(r),this.shipToLoggerFn=r.shipToLogger}shipToLogger(r){return this.shipToLoggerFn(r)}};var aSe=class extends MPa{};var zut=class r{constructor(t,n,i=void 0){this.defaultMetadata=t;this.transports=n;this._logger=i}get logger(){return this._logger||(this._logger=new Z8t({transport:this.transports}).withContext(this.defaultMetadata)),this._logger}getContext(t){return{...this.defaultMetadata,...t,...vu().logContext}}logDirect(t,n,i){let o=this.getContext(i),s;t==="warning"||t==="alert"?s="warn":t==="emerg"?s="fatal":s=t;for(let a of this.transports)a instanceof aSe&&!a.enabled||a.shipToLogger&&a.shipToLogger({logLevel:s,messages:[n],data:o,hasData:Object.keys(o).length>0})}debug(t,n){this.logDirect("debug",t,n)}info(t,n){this.logDirect("info",t,n)}warning(t,n){this.logDirect("warning",t,n)}error(t,n){this.logDirect("error",t,n)}emerg(t,n){this.logDirect("emerg",t,n)}alert(t,n){this.logDirect("alert",t,n)}log(t,n,i){this.logDirect(t,n,i)}child(t){return new r({...this.defaultMetadata,...t},this.transports,void 0)}silenceConsole(t){for(let n of this.transports)n instanceof aSe&&(n.enabled=!t)}};var iqd=typeof global=="object"&&global&&global.Object===Object&&global,ekt=iqd;var oqd=typeof self=="object"&&self&&self.Object===Object&&self,sqd=ekt||oqd||Function("return this")(),hE=sqd;var aqd=hE.Symbol,jS=aqd;var wPa=Object.prototype,uqd=wPa.hasOwnProperty,cqd=wPa.toString,Fut=jS?jS.toStringTag:void 0;function lqd(r){var t=uqd.call(r,Fut),n=r[Fut];try{r[Fut]=void 0;var i=!0}catch{}var o=cqd.call(r);return i&&(t?r[Fut]=n:delete r[Fut]),o}var PPa=lqd;var dqd=Object.prototype,pqd=dqd.toString;function fqd(r){return pqd.call(r)}var NPa=fqd;var Aqd="[object Null]",hqd="[object Undefined]",DPa=jS?jS.toStringTag:void 0;function gqd(r){return r==null?r===void 0?hqd:Aqd:DPa&&DPa in Object(r)?PPa(r):NPa(r)}var sT=gqd;function mqd(r){return r!=null&&typeof r=="object"}var Ay=mqd;var yqd="[object Symbol]";function bqd(r){return typeof r=="symbol"||Ay(r)&&sT(r)==yqd}var Cj=bqd;function Eqd(r,t){for(var n=-1,i=r==null?0:r.length,o=Array(i);++n<i;)o[n]=t(r[n],n,r);return o}var IP=Eqd;var Cqd=Array.isArray,v0=Cqd;var Sqd=1/0,xPa=jS?jS.prototype:void 0,BPa=xPa?xPa.toString:void 0;function kPa(r){if(typeof r=="string")return r;if(v0(r))return IP(r,kPa)+"";if(Cj(r))return BPa?BPa.call(r):"";var t=r+"";return t=="0"&&1/r==-Sqd?"-0":t}var LPa=kPa;var _qd=/\s/;function vqd(r){for(var t=r.length;t--&&_qd.test(r.charAt(t)););return t}var qPa=vqd;var Tqd=/^\s+/;function Iqd(r){return r&&r.slice(0,qPa(r)+1).replace(Tqd,"")}var zPa=Iqd;function Oqd(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}var Th=Oqd;var FPa=NaN,Rqd=/^[-+]0x[0-9a-f]+$/i,Mqd=/^0b[01]+$/i,wqd=/^0o[0-7]+$/i,Pqd=parseInt;function Nqd(r){if(typeof r=="number")return r;if(Cj(r))return FPa;if(Th(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=Th(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=zPa(r);var n=Mqd.test(r);return n||wqd.test(r)?Pqd(r.slice(2),n?2:8):Rqd.test(r)?FPa:+r}var QPa=Nqd;var UPa=1/0,Dqd=17976931348623157e292;function xqd(r){if(!r)return r===0?r:0;if(r=QPa(r),r===UPa||r===-UPa){var t=r<0?-1:1;return t*Dqd}return r===r?r:0}var jPa=xqd;function Bqd(r){var t=jPa(r),n=t%1;return t===t?n?t-n:t:0}var GPa=Bqd;function kqd(r){return r}var Sj=kqd;var Lqd="[object AsyncFunction]",qqd="[object Function]",zqd="[object GeneratorFunction]",Fqd="[object Proxy]";function Qqd(r){if(!Th(r))return!1;var t=sT(r);return t==qqd||t==zqd||t==Lqd||t==Fqd}var nBe=Qqd;var Uqd=hE["__core-js_shared__"],tkt=Uqd;var HPa=function(){var r=/[^.]+$/.exec(tkt&&tkt.keys&&tkt.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function jqd(r){return!!HPa&&HPa in r}var WPa=jqd;var Gqd=Function.prototype,Hqd=Gqd.toString;function Wqd(r){if(r!=null){try{return Hqd.call(r)}catch{}try{return r+""}catch{}}return""}var Dee=Wqd;var Vqd=/[\\^$.*+?()[\]{}|]/g,Kqd=/^\[object .+?Constructor\]$/,Yqd=Function.prototype,Jqd=Object.prototype,$qd=Yqd.toString,Xqd=Jqd.hasOwnProperty,Zqd=RegExp("^"+$qd.call(Xqd).replace(Vqd,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function e7d(r){if(!Th(r)||WPa(r))return!1;var t=nBe(r)?Zqd:Kqd;return t.test(Dee(r))}var VPa=e7d;function t7d(r,t){return r?.[t]}var KPa=t7d;function r7d(r,t){var n=KPa(r,t);return VPa(n)?n:void 0}var OP=r7d;var n7d=OP(hE,"WeakMap"),rkt=n7d;var YPa=Object.create,i7d=function(){function r(){}return function(t){if(!Th(t))return{};if(YPa)return YPa(t);r.prototype=t;var n=new r;return r.prototype=void 0,n}}(),JPa=i7d;function o7d(r,t,n){switch(n.length){case 0:return r.call(t);case 1:return r.call(t,n[0]);case 2:return r.call(t,n[0],n[1]);case 3:return r.call(t,n[0],n[1],n[2])}return r.apply(t,n)}var $Pa=o7d;function s7d(r,t){var n=-1,i=r.length;for(t||(t=Array(i));++n<i;)t[n]=r[n];return t}var nkt=s7d;var a7d=800,u7d=16,c7d=Date.now;function l7d(r){var t=0,n=0;return function(){var i=c7d(),o=u7d-(i-n);if(n=i,o>0){if(++t>=a7d)return arguments[0]}else t=0;return r.apply(void 0,arguments)}}var XPa=l7d;function d7d(r){return function(){return r}}var ZPa=d7d;var p7d=function(){try{var r=OP(Object,"defineProperty");return r({},"",{}),r}catch{}}(),iBe=p7d;var f7d=iBe?function(r,t){return iBe(r,"toString",{configurable:!0,enumerable:!1,value:ZPa(t),writable:!0})}:Sj,e4a=f7d;var A7d=XPa(e4a),ikt=A7d;function h7d(r,t){for(var n=-1,i=r==null?0:r.length;++n<i&&t(r[n],n,r)!==!1;);return r}var t4a=h7d;function g7d(r,t,n,i){for(var o=r.length,s=n+(i?1:-1);i?s--:++s<o;)if(t(r[s],s,r))return s;return-1}var r4a=g7d;function m7d(r){return r!==r}var n4a=m7d;function y7d(r,t,n){for(var i=n-1,o=r.length;++i<o;)if(r[i]===t)return i;return-1}var i4a=y7d;function b7d(r,t,n){return t===t?i4a(r,t,n):r4a(r,n4a,n)}var o4a=b7d;function E7d(r,t){var n=r==null?0:r.length;return!!n&&o4a(r,t,0)>-1}var s4a=E7d;var C7d=9007199254740991,S7d=/^(?:0|[1-9]\d*)$/;function _7d(r,t){var n=typeof r;return t=t??C7d,!!t&&(n=="number"||n!="symbol"&&S7d.test(r))&&r>-1&&r%1==0&&r<t}var hue=_7d;function v7d(r,t,n){t=="__proto__"&&iBe?iBe(r,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):r[t]=n}var _j=v7d;function T7d(r,t){return r===t||r!==r&&t!==t}var vj=T7d;var I7d=Object.prototype,O7d=I7d.hasOwnProperty;function R7d(r,t,n){var i=r[t];(!(O7d.call(r,t)&&vj(i,n))||n===void 0&&!(t in r))&&_j(r,t,n)}var oBe=R7d;function M7d(r,t,n,i){var o=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var u=t[s],l=i?i(n[u],r[u],u,n,r):void 0;l===void 0&&(l=r[u]),o?_j(n,u,l):oBe(n,u,l)}return n}var G6=M7d;var a4a=Math.max;function w7d(r,t,n){return t=a4a(t===void 0?r.length-1:t,0),function(){for(var i=arguments,o=-1,s=a4a(i.length-t,0),a=Array(s);++o<s;)a[o]=i[t+o];o=-1;for(var u=Array(t+1);++o<t;)u[o]=i[o];return u[t]=n(a),$Pa(r,this,u)}}var okt=w7d;function P7d(r,t){return ikt(okt(r,t,Sj),r+"")}var skt=P7d;var N7d=9007199254740991;function D7d(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=N7d}var sBe=D7d;function x7d(r){return r!=null&&sBe(r.length)&&!nBe(r)}var H6=x7d;function B7d(r,t,n){if(!Th(n))return!1;var i=typeof t;return(i=="number"?H6(n)&&hue(t,n.length):i=="string"&&t in n)?vj(n[t],r):!1}var akt=B7d;function k7d(r){return skt(function(t,n){var i=-1,o=n.length,s=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(s=r.length>3&&typeof s=="function"?(o--,s):void 0,a&&akt(n[0],n[1],a)&&(s=o<3?void 0:s,o=1),t=Object(t);++i<o;){var u=n[i];u&&r(t,u,i,s)}return t})}var u4a=k7d;var L7d=Object.prototype;function q7d(r){var t=r&&r.constructor,n=typeof t=="function"&&t.prototype||L7d;return r===n}var aBe=q7d;function z7d(r,t){for(var n=-1,i=Array(r);++n<r;)i[n]=t(n);return i}var c4a=z7d;var F7d="[object Arguments]";function Q7d(r){return Ay(r)&&sT(r)==F7d}var zLi=Q7d;var l4a=Object.prototype,U7d=l4a.hasOwnProperty,j7d=l4a.propertyIsEnumerable,G7d=zLi(function(){return arguments}())?zLi:function(r){return Ay(r)&&U7d.call(r,"callee")&&!j7d.call(r,"callee")},xee=G7d;function H7d(){return!1}var d4a=H7d;var A4a=typeof exports=="object"&&exports&&!exports.nodeType&&exports,p4a=A4a&&typeof module=="object"&&module&&!module.nodeType&&module,W7d=p4a&&p4a.exports===A4a,f4a=W7d?hE.Buffer:void 0,V7d=f4a?f4a.isBuffer:void 0,K7d=V7d||d4a,Bee=K7d;var Y7d="[object Arguments]",J7d="[object Array]",$7d="[object Boolean]",X7d="[object Date]",Z7d="[object Error]",ezd="[object Function]",tzd="[object Map]",rzd="[object Number]",nzd="[object Object]",izd="[object RegExp]",ozd="[object Set]",szd="[object String]",azd="[object WeakMap]",uzd="[object ArrayBuffer]",czd="[object DataView]",lzd="[object Float32Array]",dzd="[object Float64Array]",pzd="[object Int8Array]",fzd="[object Int16Array]",Azd="[object Int32Array]",hzd="[object Uint8Array]",gzd="[object Uint8ClampedArray]",mzd="[object Uint16Array]",yzd="[object Uint32Array]",b1={};b1[lzd]=b1[dzd]=b1[pzd]=b1[fzd]=b1[Azd]=b1[hzd]=b1[gzd]=b1[mzd]=b1[yzd]=!0;b1[Y7d]=b1[J7d]=b1[uzd]=b1[$7d]=b1[czd]=b1[X7d]=b1[Z7d]=b1[ezd]=b1[tzd]=b1[rzd]=b1[nzd]=b1[izd]=b1[ozd]=b1[szd]=b1[azd]=!1;function bzd(r){return Ay(r)&&sBe(r.length)&&!!b1[sT(r)]}var h4a=bzd;function Ezd(r){return function(t){return r(t)}}var Tj=Ezd;var g4a=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Qut=g4a&&typeof module=="object"&&module&&!module.nodeType&&module,Czd=Qut&&Qut.exports===g4a,FLi=Czd&&ekt.process,Szd=function(){try{var r=Qut&&Qut.require&&Qut.require("util").types;return r||FLi&&FLi.binding&&FLi.binding("util")}catch{}}(),W6=Szd;var m4a=W6&&W6.isTypedArray,_zd=m4a?Tj(m4a):h4a,uBe=_zd;var vzd=Object.prototype,Tzd=vzd.hasOwnProperty;function Izd(r,t){var n=v0(r),i=!n&&xee(r),o=!n&&!i&&Bee(r),s=!n&&!i&&!o&&uBe(r),a=n||i||o||s,u=a?c4a(r.length,String):[],l=u.length;for(var c in r)(t||Tzd.call(r,c))&&!(a&&(c=="length"||o&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||hue(c,l)))&&u.push(c);return u}var ukt=Izd;function Ozd(r,t){return function(n){return r(t(n))}}var ckt=Ozd;var Rzd=ckt(Object.keys,Object),y4a=Rzd;var Mzd=Object.prototype,wzd=Mzd.hasOwnProperty;function Pzd(r){if(!aBe(r))return y4a(r);var t=[];for(var n in Object(r))wzd.call(r,n)&&n!="constructor"&&t.push(n);return t}var lkt=Pzd;function Nzd(r){return H6(r)?ukt(r):lkt(r)}var LR=Nzd;function Dzd(r){var t=[];if(r!=null)for(var n in Object(r))t.push(n);return t}var b4a=Dzd;var xzd=Object.prototype,Bzd=xzd.hasOwnProperty;function kzd(r){if(!Th(r))return b4a(r);var t=aBe(r),n=[];for(var i in r)i=="constructor"&&(t||!Bzd.call(r,i))||n.push(i);return n}var E4a=kzd;function Lzd(r){return H6(r)?ukt(r,!0):E4a(r)}var Ij=Lzd;var qzd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zzd=/^\w*$/;function Fzd(r,t){if(v0(r))return!1;var n=typeof r;return n=="number"||n=="symbol"||n=="boolean"||r==null||Cj(r)?!0:zzd.test(r)||!qzd.test(r)||t!=null&&r in Object(t)}var cBe=Fzd;var Qzd=OP(Object,"create"),kee=Qzd;function Uzd(){this.__data__=kee?kee(null):{},this.size=0}var C4a=Uzd;function jzd(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}var S4a=jzd;var Gzd="__lodash_hash_undefined__",Hzd=Object.prototype,Wzd=Hzd.hasOwnProperty;function Vzd(r){var t=this.__data__;if(kee){var n=t[r];return n===Gzd?void 0:n}return Wzd.call(t,r)?t[r]:void 0}var _4a=Vzd;var Kzd=Object.prototype,Yzd=Kzd.hasOwnProperty;function Jzd(r){var t=this.__data__;return kee?t[r]!==void 0:Yzd.call(t,r)}var v4a=Jzd;var $zd="__lodash_hash_undefined__";function Xzd(r,t){var n=this.__data__;return this.size+=this.has(r)?0:1,n[r]=kee&&t===void 0?$zd:t,this}var T4a=Xzd;function lBe(r){var t=-1,n=r==null?0:r.length;for(this.clear();++t<n;){var i=r[t];this.set(i[0],i[1])}}lBe.prototype.clear=C4a;lBe.prototype.delete=S4a;lBe.prototype.get=_4a;lBe.prototype.has=v4a;lBe.prototype.set=T4a;var QLi=lBe;function Zzd(){this.__data__=[],this.size=0}var I4a=Zzd;function eFd(r,t){for(var n=r.length;n--;)if(vj(r[n][0],t))return n;return-1}var gue=eFd;var tFd=Array.prototype,rFd=tFd.splice;function nFd(r){var t=this.__data__,n=gue(t,r);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():rFd.call(t,n,1),--this.size,!0}var O4a=nFd;function iFd(r){var t=this.__data__,n=gue(t,r);return n<0?void 0:t[n][1]}var R4a=iFd;function oFd(r){return gue(this.__data__,r)>-1}var M4a=oFd;function sFd(r,t){var n=this.__data__,i=gue(n,r);return i<0?(++this.size,n.push([r,t])):n[i][1]=t,this}var w4a=sFd;function dBe(r){var t=-1,n=r==null?0:r.length;for(this.clear();++t<n;){var i=r[t];this.set(i[0],i[1])}}dBe.prototype.clear=I4a;dBe.prototype.delete=O4a;dBe.prototype.get=R4a;dBe.prototype.has=M4a;dBe.prototype.set=w4a;var mue=dBe;var aFd=OP(hE,"Map"),yue=aFd;function uFd(){this.size=0,this.__data__={hash:new QLi,map:new(yue||mue),string:new QLi}}var P4a=uFd;function cFd(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}var N4a=cFd;function lFd(r,t){var n=r.__data__;return N4a(t)?n[typeof t=="string"?"string":"hash"]:n.map}var bue=lFd;function dFd(r){var t=bue(this,r).delete(r);return this.size-=t?1:0,t}var D4a=dFd;function pFd(r){return bue(this,r).get(r)}var x4a=pFd;function fFd(r){return bue(this,r).has(r)}var B4a=fFd;function AFd(r,t){var n=bue(this,r),i=n.size;return n.set(r,t),this.size+=n.size==i?0:1,this}var k4a=AFd;function pBe(r){var t=-1,n=r==null?0:r.length;for(this.clear();++t<n;){var i=r[t];this.set(i[0],i[1])}}pBe.prototype.clear=P4a;pBe.prototype.delete=D4a;pBe.prototype.get=x4a;pBe.prototype.has=B4a;pBe.prototype.set=k4a;var uSe=pBe;var hFd="Expected a function";function ULi(r,t){if(typeof r!="function"||t!=null&&typeof t!="function")throw new TypeError(hFd);var n=function(){var i=arguments,o=t?t.apply(this,i):i[0],s=n.cache;if(s.has(o))return s.get(o);var a=r.apply(this,i);return n.cache=s.set(o,a)||s,a};return n.cache=new(ULi.Cache||uSe),n}ULi.Cache=uSe;var cSe=ULi;var gFd=500;function mFd(r){var t=cSe(r,function(i){return n.size===gFd&&n.clear(),i}),n=t.cache;return t}var L4a=mFd;var yFd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,bFd=/\\(\\)?/g,EFd=L4a(function(r){var t=[];return r.charCodeAt(0)===46&&t.push(""),r.replace(yFd,function(n,i,o,s){t.push(o?s.replace(bFd,"$1"):i||n)}),t}),q4a=EFd;function CFd(r){return r==null?"":LPa(r)}var fBe=CFd;function SFd(r,t){return v0(r)?r:cBe(r,t)?[r]:q4a(fBe(r))}var V6=SFd;var _Fd=1/0;function vFd(r){if(typeof r=="string"||Cj(r))return r;var t=r+"";return t=="0"&&1/r==-_Fd?"-0":t}var K6=vFd;function TFd(r,t){t=V6(t,r);for(var n=0,i=t.length;r!=null&&n<i;)r=r[K6(t[n++])];return n&&n==i?r:void 0}var Eue=TFd;function IFd(r,t,n){var i=r==null?void 0:Eue(r,t);return i===void 0?n:i}var Uut=IFd;function OFd(r,t){for(var n=-1,i=t.length,o=r.length;++n<i;)r[o+n]=t[n];return r}var ABe=OFd;var z4a=jS?jS.isConcatSpreadable:void 0;function RFd(r){return v0(r)||xee(r)||!!(z4a&&r&&r[z4a])}var F4a=RFd;function Q4a(r,t,n,i,o){var s=-1,a=r.length;for(n||(n=F4a),o||(o=[]);++s<a;){var u=r[s];t>0&&n(u)?t>1?Q4a(u,t-1,n,i,o):ABe(o,u):i||(o[o.length]=u)}return o}var U4a=Q4a;function MFd(r){var t=r==null?0:r.length;return t?U4a(r,1):[]}var j4a=MFd;function wFd(r){return ikt(okt(r,void 0,j4a),r+"")}var dkt=wFd;var PFd=ckt(Object.getPrototypeOf,Object),hBe=PFd;var NFd="[object Object]",DFd=Function.prototype,xFd=Object.prototype,G4a=DFd.toString,BFd=xFd.hasOwnProperty,kFd=G4a.call(Object);function LFd(r){if(!Ay(r)||sT(r)!=NFd)return!1;var t=hBe(r);if(t===null)return!0;var n=BFd.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&G4a.call(n)==kFd}var pkt=LFd;function qFd(r,t,n){var i=-1,o=r.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(o);++i<o;)s[i]=r[i+t];return s}var gBe=qFd;function zFd(r,t,n){var i=r.length;return n=n===void 0?i:n,!t&&n>=i?r:gBe(r,t,n)}var H4a=zFd;var FFd="\\ud800-\\udfff",QFd="\\u0300-\\u036f",UFd="\\ufe20-\\ufe2f",jFd="\\u20d0-\\u20ff",GFd=QFd+UFd+jFd,HFd="\\ufe0e\\ufe0f",WFd="\\u200d",VFd=RegExp("["+WFd+FFd+GFd+HFd+"]");function KFd(r){return VFd.test(r)}var mBe=KFd;function YFd(r){return r.split("")}var W4a=YFd;var V4a="\\ud800-\\udfff",JFd="\\u0300-\\u036f",$Fd="\\ufe20-\\ufe2f",XFd="\\u20d0-\\u20ff",ZFd=JFd+$Fd+XFd,eQd="\\ufe0e\\ufe0f",tQd="["+V4a+"]",jLi="["+ZFd+"]",GLi="\\ud83c[\\udffb-\\udfff]",rQd="(?:"+jLi+"|"+GLi+")",K4a="[^"+V4a+"]",Y4a="(?:\\ud83c[\\udde6-\\uddff]){2}",J4a="[\\ud800-\\udbff][\\udc00-\\udfff]",nQd="\\u200d",$4a=rQd+"?",X4a="["+eQd+"]?",iQd="(?:"+nQd+"(?:"+[K4a,Y4a,J4a].join("|")+")"+X4a+$4a+")*",oQd=X4a+$4a+iQd,sQd="(?:"+[K4a+jLi+"?",jLi,Y4a,J4a,tQd].join("|")+")",aQd=RegExp(GLi+"(?="+GLi+")|"+sQd+oQd,"g");function uQd(r){return r.match(aQd)||[]}var Z4a=uQd;function cQd(r){return mBe(r)?Z4a(r):W4a(r)}var eNa=cQd;function lQd(r){return function(t){t=fBe(t);var n=mBe(t)?eNa(t):void 0,i=n?n[0]:t.charAt(0),o=n?H4a(n,1).join(""):t.slice(1);return i[r]()+o}}var tNa=lQd;var dQd=tNa("toUpperCase"),rNa=dQd;function pQd(r){return rNa(fBe(r).toLowerCase())}var _x=pQd;function fQd(r,t,n,i){var o=-1,s=r==null?0:r.length;for(i&&s&&(n=r[++o]);++o<s;)n=t(n,r[o],o,r);return n}var nNa=fQd;var AQd=Math.ceil,hQd=Math.max;function gQd(r,t,n){(n?akt(r,t,n):t===void 0)?t=1:t=hQd(GPa(t),0);var i=r==null?0:r.length;if(!i||t<1)return[];for(var o=0,s=0,a=Array(AQd(i/t));o<i;)a[s++]=gBe(r,o,o+=t);return a}var T7=gQd;function mQd(){this.__data__=new mue,this.size=0}var iNa=mQd;function yQd(r){var t=this.__data__,n=t.delete(r);return this.size=t.size,n}var oNa=yQd;function bQd(r){return this.__data__.get(r)}var sNa=bQd;function EQd(r){return this.__data__.has(r)}var aNa=EQd;var CQd=200;function SQd(r,t){var n=this.__data__;if(n instanceof mue){var i=n.__data__;if(!yue||i.length<CQd-1)return i.push([r,t]),this.size=++n.size,this;n=this.__data__=new uSe(i)}return n.set(r,t),this.size=n.size,this}var uNa=SQd;function yBe(r){var t=this.__data__=new mue(r);this.size=t.size}yBe.prototype.clear=iNa;yBe.prototype.delete=oNa;yBe.prototype.get=sNa;yBe.prototype.has=aNa;yBe.prototype.set=uNa;var Oj=yBe;function _Qd(r,t){return r&&G6(t,LR(t),r)}var cNa=_Qd;function vQd(r,t){return r&&G6(t,Ij(t),r)}var lNa=vQd;var ANa=typeof exports=="object"&&exports&&!exports.nodeType&&exports,dNa=ANa&&typeof module=="object"&&module&&!module.nodeType&&module,TQd=dNa&&dNa.exports===ANa,pNa=TQd?hE.Buffer:void 0,fNa=pNa?pNa.allocUnsafe:void 0;function IQd(r,t){if(t)return r.slice();var n=r.length,i=fNa?fNa(n):new r.constructor(n);return r.copy(i),i}var fkt=IQd;function OQd(r,t){for(var n=-1,i=r==null?0:r.length,o=0,s=[];++n<i;){var a=r[n];t(a,n,r)&&(s[o++]=a)}return s}var hNa=OQd;function RQd(){return[]}var Akt=RQd;var MQd=Object.prototype,wQd=MQd.propertyIsEnumerable,gNa=Object.getOwnPropertySymbols,PQd=gNa?function(r){return r==null?[]:(r=Object(r),hNa(gNa(r),function(t){return wQd.call(r,t)}))}:Akt,bBe=PQd;function NQd(r,t){return G6(r,bBe(r),t)}var mNa=NQd;var DQd=Object.getOwnPropertySymbols,xQd=DQd?function(r){for(var t=[];r;)ABe(t,bBe(r)),r=hBe(r);return t}:Akt,hkt=xQd;function BQd(r,t){return G6(r,hkt(r),t)}var yNa=BQd;function kQd(r,t,n){var i=t(r);return v0(r)?i:ABe(i,n(r))}var gkt=kQd;function LQd(r){return gkt(r,LR,bBe)}var jut=LQd;function qQd(r){return gkt(r,Ij,hkt)}var EBe=qQd;var zQd=OP(hE,"DataView"),mkt=zQd;var FQd=OP(hE,"Promise"),ykt=FQd;var QQd=OP(hE,"Set"),bkt=QQd;var bNa="[object Map]",UQd="[object Object]",ENa="[object Promise]",CNa="[object Set]",SNa="[object WeakMap]",_Na="[object DataView]",jQd=Dee(mkt),GQd=Dee(yue),HQd=Dee(ykt),WQd=Dee(bkt),VQd=Dee(rkt),lSe=sT;(mkt&&lSe(new mkt(new ArrayBuffer(1)))!=_Na||yue&&lSe(new yue)!=bNa||ykt&&lSe(ykt.resolve())!=ENa||bkt&&lSe(new bkt)!=CNa||rkt&&lSe(new rkt)!=SNa)&&(lSe=function(r){var t=sT(r),n=t==UQd?r.constructor:void 0,i=n?Dee(n):"";if(i)switch(i){case jQd:return _Na;case GQd:return bNa;case HQd:return ENa;case WQd:return CNa;case VQd:return SNa}return t});var vx=lSe;var KQd=Object.prototype,YQd=KQd.hasOwnProperty;function JQd(r){var t=r.length,n=new r.constructor(t);return t&&typeof r[0]=="string"&&YQd.call(r,"index")&&(n.index=r.index,n.input=r.input),n}var vNa=JQd;var $Qd=hE.Uint8Array,CBe=$Qd;function XQd(r){var t=new r.constructor(r.byteLength);return new CBe(t).set(new CBe(r)),t}var SBe=XQd;function ZQd(r,t){var n=t?SBe(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.byteLength)}var TNa=ZQd;var eUd=/\w*$/;function tUd(r){var t=new r.constructor(r.source,eUd.exec(r));return t.lastIndex=r.lastIndex,t}var INa=tUd;var ONa=jS?jS.prototype:void 0,RNa=ONa?ONa.valueOf:void 0;function rUd(r){return RNa?Object(RNa.call(r)):{}}var MNa=rUd;function nUd(r,t){var n=t?SBe(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.length)}var Ekt=nUd;var iUd="[object Boolean]",oUd="[object Date]",sUd="[object Map]",aUd="[object Number]",uUd="[object RegExp]",cUd="[object Set]",lUd="[object String]",dUd="[object Symbol]",pUd="[object ArrayBuffer]",fUd="[object DataView]",AUd="[object Float32Array]",hUd="[object Float64Array]",gUd="[object Int8Array]",mUd="[object Int16Array]",yUd="[object Int32Array]",bUd="[object Uint8Array]",EUd="[object Uint8ClampedArray]",CUd="[object Uint16Array]",SUd="[object Uint32Array]";function _Ud(r,t,n){var i=r.constructor;switch(t){case pUd:return SBe(r);case iUd:case oUd:return new i(+r);case fUd:return TNa(r,n);case AUd:case hUd:case gUd:case mUd:case yUd:case bUd:case EUd:case CUd:case SUd:return Ekt(r,n);case sUd:return new i;case aUd:case lUd:return new i(r);case uUd:return INa(r);case cUd:return new i;case dUd:return MNa(r)}}var wNa=_Ud;function vUd(r){return typeof r.constructor=="function"&&!aBe(r)?JPa(hBe(r)):{}}var Ckt=vUd;var TUd="[object Map]";function IUd(r){return Ay(r)&&vx(r)==TUd}var PNa=IUd;var NNa=W6&&W6.isMap,OUd=NNa?Tj(NNa):PNa,DNa=OUd;var RUd="[object Set]";function MUd(r){return Ay(r)&&vx(r)==RUd}var xNa=MUd;var BNa=W6&&W6.isSet,wUd=BNa?Tj(BNa):xNa,kNa=wUd;var PUd=1,NUd=2,DUd=4,LNa="[object Arguments]",xUd="[object Array]",BUd="[object Boolean]",kUd="[object Date]",LUd="[object Error]",qNa="[object Function]",qUd="[object GeneratorFunction]",zUd="[object Map]",FUd="[object Number]",zNa="[object Object]",QUd="[object RegExp]",UUd="[object Set]",jUd="[object String]",GUd="[object Symbol]",HUd="[object WeakMap]",WUd="[object ArrayBuffer]",VUd="[object DataView]",KUd="[object Float32Array]",YUd="[object Float64Array]",JUd="[object Int8Array]",$Ud="[object Int16Array]",XUd="[object Int32Array]",ZUd="[object Uint8Array]",ejd="[object Uint8ClampedArray]",tjd="[object Uint16Array]",rjd="[object Uint32Array]",mg={};mg[LNa]=mg[xUd]=mg[WUd]=mg[VUd]=mg[BUd]=mg[kUd]=mg[KUd]=mg[YUd]=mg[JUd]=mg[$Ud]=mg[XUd]=mg[zUd]=mg[FUd]=mg[zNa]=mg[QUd]=mg[UUd]=mg[jUd]=mg[GUd]=mg[ZUd]=mg[ejd]=mg[tjd]=mg[rjd]=!0;mg[LUd]=mg[qNa]=mg[HUd]=!1;function Skt(r,t,n,i,o,s){var a,u=t&PUd,l=t&NUd,c=t&DUd;if(n&&(a=o?n(r,i,o,s):n(r)),a!==void 0)return a;if(!Th(r))return r;var d=v0(r);if(d){if(a=vNa(r),!u)return nkt(r,a)}else{var p=vx(r),f=p==qNa||p==qUd;if(Bee(r))return fkt(r,u);if(p==zNa||p==LNa||f&&!o){if(a=l||f?{}:Ckt(r),!u)return l?yNa(r,lNa(a,r)):mNa(r,cNa(a,r))}else{if(!mg[p])return o?r:{};a=wNa(r,p,u)}}s||(s=new Oj);var A=s.get(r);if(A)return A;s.set(r,a),kNa(r)?r.forEach(function(_){a.add(Skt(_,t,n,_,r,s))}):DNa(r)&&r.forEach(function(_,v){a.set(v,Skt(_,t,n,v,r,s))});var g=c?l?EBe:jut:l?Ij:LR,b=d?void 0:g(r);return t4a(b||r,function(_,v){b&&(v=_,_=r[v]),oBe(a,v,Skt(_,t,n,v,r,s))}),a}var _Be=Skt;var njd=1,ijd=4;function ojd(r){return _Be(r,njd|ijd)}var Vc=ojd;var sjd=1,ajd=4;function ujd(r,t){return t=typeof t=="function"?t:void 0,_Be(r,sjd|ajd,t)}var HLi=ujd;var cjd="__lodash_hash_undefined__";function ljd(r){return this.__data__.set(r,cjd),this}var FNa=ljd;function djd(r){return this.__data__.has(r)}var QNa=djd;function _kt(r){var t=-1,n=r==null?0:r.length;for(this.__data__=new uSe;++t<n;)this.add(r[t])}_kt.prototype.add=_kt.prototype.push=FNa;_kt.prototype.has=QNa;var vkt=_kt;function pjd(r,t){for(var n=-1,i=r==null?0:r.length;++n<i;)if(t(r[n],n,r))return!0;return!1}var UNa=pjd;function fjd(r,t){return r.has(t)}var Gut=fjd;var Ajd=1,hjd=2;function gjd(r,t,n,i,o,s){var a=n&Ajd,u=r.length,l=t.length;if(u!=l&&!(a&&l>u))return!1;var c=s.get(r),d=s.get(t);if(c&&d)return c==t&&d==r;var p=-1,f=!0,A=n&hjd?new vkt:void 0;for(s.set(r,t),s.set(t,r);++p<u;){var g=r[p],b=t[p];if(i)var _=a?i(b,g,p,t,r,s):i(g,b,p,r,t,s);if(_!==void 0){if(_)continue;f=!1;break}if(A){if(!UNa(t,function(v,O){if(!Gut(A,O)&&(g===v||o(g,v,n,i,s)))return A.push(O)})){f=!1;break}}else if(!(g===b||o(g,b,n,i,s))){f=!1;break}}return s.delete(r),s.delete(t),f}var Tkt=gjd;function mjd(r){var t=-1,n=Array(r.size);return r.forEach(function(i,o){n[++t]=[o,i]}),n}var Ikt=mjd;function yjd(r){var t=-1,n=Array(r.size);return r.forEach(function(i){n[++t]=i}),n}var jNa=yjd;var bjd=1,Ejd=2,Cjd="[object Boolean]",Sjd="[object Date]",_jd="[object Error]",vjd="[object Map]",Tjd="[object Number]",Ijd="[object RegExp]",Ojd="[object Set]",Rjd="[object String]",Mjd="[object Symbol]",wjd="[object ArrayBuffer]",Pjd="[object DataView]",GNa=jS?jS.prototype:void 0,WLi=GNa?GNa.valueOf:void 0;function Njd(r,t,n,i,o,s,a){switch(n){case Pjd:if(r.byteLength!=t.byteLength||r.byteOffset!=t.byteOffset)return!1;r=r.buffer,t=t.buffer;case wjd:return!(r.byteLength!=t.byteLength||!s(new CBe(r),new CBe(t)));case Cjd:case Sjd:case Tjd:return vj(+r,+t);case _jd:return r.name==t.name&&r.message==t.message;case Ijd:case Rjd:return r==t+"";case vjd:var u=Ikt;case Ojd:var l=i&bjd;if(u||(u=jNa),r.size!=t.size&&!l)return!1;var c=a.get(r);if(c)return c==t;i|=Ejd,a.set(r,t);var d=Tkt(u(r),u(t),i,o,s,a);return a.delete(r),d;case Mjd:if(WLi)return WLi.call(r)==WLi.call(t)}return!1}var HNa=Njd;var Djd=1,xjd=Object.prototype,Bjd=xjd.hasOwnProperty;function kjd(r,t,n,i,o,s){var a=n&Djd,u=jut(r),l=u.length,c=jut(t),d=c.length;if(l!=d&&!a)return!1;for(var p=l;p--;){var f=u[p];if(!(a?f in t:Bjd.call(t,f)))return!1}var A=s.get(r),g=s.get(t);if(A&&g)return A==t&&g==r;var b=!0;s.set(r,t),s.set(t,r);for(var _=a;++p<l;){f=u[p];var v=r[f],O=t[f];if(i)var R=a?i(O,v,f,t,r,s):i(v,O,f,r,t,s);if(!(R===void 0?v===O||o(v,O,n,i,s):R)){b=!1;break}_||(_=f=="constructor")}if(b&&!_){var w=r.constructor,P=t.constructor;w!=P&&"constructor"in r&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof P=="function"&&P instanceof P)&&(b=!1)}return s.delete(r),s.delete(t),b}var WNa=kjd;var Ljd=1,VNa="[object Arguments]",KNa="[object Array]",Okt="[object Object]",qjd=Object.prototype,YNa=qjd.hasOwnProperty;function zjd(r,t,n,i,o,s){var a=v0(r),u=v0(t),l=a?KNa:vx(r),c=u?KNa:vx(t);l=l==VNa?Okt:l,c=c==VNa?Okt:c;var d=l==Okt,p=c==Okt,f=l==c;if(f&&Bee(r)){if(!Bee(t))return!1;a=!0,d=!1}if(f&&!d)return s||(s=new Oj),a||uBe(r)?Tkt(r,t,n,i,o,s):HNa(r,t,l,n,i,o,s);if(!(n&Ljd)){var A=d&&YNa.call(r,"__wrapped__"),g=p&&YNa.call(t,"__wrapped__");if(A||g){var b=A?r.value():r,_=g?t.value():t;return s||(s=new Oj),o(b,_,n,i,s)}}return f?(s||(s=new Oj),WNa(r,t,n,i,o,s)):!1}var JNa=zjd;function $Na(r,t,n,i,o){return r===t?!0:r==null||t==null||!Ay(r)&&!Ay(t)?r!==r&&t!==t:JNa(r,t,n,i,$Na,o)}var vBe=$Na;var Fjd=1,Qjd=2;function Ujd(r,t,n,i){var o=n.length,s=o,a=!i;if(r==null)return!s;for(r=Object(r);o--;){var u=n[o];if(a&&u[2]?u[1]!==r[u[0]]:!(u[0]in r))return!1}for(;++o<s;){u=n[o];var l=u[0],c=r[l],d=u[1];if(a&&u[2]){if(c===void 0&&!(l in r))return!1}else{var p=new Oj;if(i)var f=i(c,d,l,r,t,p);if(!(f===void 0?vBe(d,c,Fjd|Qjd,i,p):f))return!1}}return!0}var XNa=Ujd;function jjd(r){return r===r&&!Th(r)}var Rkt=jjd;function Gjd(r){for(var t=LR(r),n=t.length;n--;){var i=t[n],o=r[i];t[n]=[i,o,Rkt(o)]}return t}var ZNa=Gjd;function Hjd(r,t){return function(n){return n==null?!1:n[r]===t&&(t!==void 0||r in Object(n))}}var Mkt=Hjd;function Wjd(r){var t=ZNa(r);return t.length==1&&t[0][2]?Mkt(t[0][0],t[0][1]):function(n){return n===r||XNa(n,r,t)}}var eDa=Wjd;function Vjd(r,t){return r!=null&&t in Object(r)}var tDa=Vjd;function Kjd(r,t,n){t=V6(t,r);for(var i=-1,o=t.length,s=!1;++i<o;){var a=K6(t[i]);if(!(s=r!=null&&n(r,a)))break;r=r[a]}return s||++i!=o?s:(o=r==null?0:r.length,!!o&&sBe(o)&&hue(a,o)&&(v0(r)||xee(r)))}var wkt=Kjd;function Yjd(r,t){return r!=null&&wkt(r,t,tDa)}var Pkt=Yjd;var Jjd=1,$jd=2;function Xjd(r,t){return cBe(r)&&Rkt(t)?Mkt(K6(r),t):function(n){var i=Uut(n,r);return i===void 0&&i===t?Pkt(n,r):vBe(t,i,Jjd|$jd)}}var rDa=Xjd;function Zjd(r){return function(t){return t?.[r]}}var Nkt=Zjd;function eGd(r){return function(t){return Eue(t,r)}}var nDa=eGd;function tGd(r){return cBe(r)?Nkt(K6(r)):nDa(r)}var iDa=tGd;function rGd(r){return typeof r=="function"?r:r==null?Sj:typeof r=="object"?v0(r)?rDa(r[0],r[1]):eDa(r):iDa(r)}var Y6=rGd;function nGd(r,t,n,i){for(var o=-1,s=r==null?0:r.length;++o<s;){var a=r[o];t(i,a,n(a),r)}return i}var oDa=nGd;function iGd(r){return function(t,n,i){for(var o=-1,s=Object(t),a=i(t),u=a.length;u--;){var l=a[r?u:++o];if(n(s[l],l,s)===!1)break}return t}}var sDa=iGd;var oGd=sDa(),Dkt=oGd;function sGd(r,t){return r&&Dkt(r,t,LR)}var TBe=sGd;function aGd(r,t){return function(n,i){if(n==null)return n;if(!H6(n))return r(n,i);for(var o=n.length,s=t?o:-1,a=Object(n);(t?s--:++s<o)&&i(a[s],s,a)!==!1;);return n}}var aDa=aGd;var uGd=aDa(TBe),xkt=uGd;function cGd(r,t,n,i){return xkt(r,function(o,s,a){t(i,o,n(o),a)}),i}var uDa=cGd;function lGd(r,t){return function(n,i){var o=v0(n)?oDa:uDa,s=t?t():{};return o(n,r,Y6(i,2),s)}}var cDa=lGd;function dGd(r,t,n){(n!==void 0&&!vj(r[t],n)||n===void 0&&!(t in r))&&_j(r,t,n)}var Hut=dGd;function pGd(r){return Ay(r)&&H6(r)}var Bkt=pGd;function fGd(r,t){if(!(t==="constructor"&&typeof r[t]=="function")&&t!="__proto__")return r[t]}var Wut=fGd;function AGd(r){return G6(r,Ij(r))}var lDa=AGd;function hGd(r,t,n,i,o,s,a){var u=Wut(r,n),l=Wut(t,n),c=a.get(l);if(c){Hut(r,n,c);return}var d=s?s(u,l,n+"",r,t,a):void 0,p=d===void 0;if(p){var f=v0(l),A=!f&&Bee(l),g=!f&&!A&&uBe(l);d=l,f||A||g?v0(u)?d=u:Bkt(u)?d=nkt(u):A?(p=!1,d=fkt(l,!0)):g?(p=!1,d=Ekt(l,!0)):d=[]:pkt(l)||xee(l)?(d=u,xee(u)?d=lDa(u):(!Th(u)||nBe(u))&&(d=Ckt(l))):p=!1}p&&(a.set(l,d),o(d,l,i,s,a),a.delete(l)),Hut(r,n,d)}var dDa=hGd;function pDa(r,t,n,i,o){r!==t&&Dkt(t,function(s,a){if(o||(o=new Oj),Th(s))dDa(r,t,a,n,pDa,i,o);else{var u=i?i(Wut(r,a),s,a+"",r,t,o):void 0;u===void 0&&(u=s),Hut(r,a,u)}},Ij)}var fDa=pDa;function gGd(r,t,n){for(var i=-1,o=r==null?0:r.length;++i<o;)if(n(t,r[i]))return!0;return!1}var ADa=gGd;function mGd(r){var t=r==null?0:r.length;return t?r[t-1]:void 0}var hDa=mGd;function yGd(r){return typeof r=="function"?r:Sj}var gDa=yGd;function bGd(r,t){return IP(t,function(n){return[n,r[n]]})}var mDa=bGd;function EGd(r){var t=-1,n=Array(r.size);return r.forEach(function(i){n[++t]=[i,i]}),n}var yDa=EGd;var CGd="[object Map]",SGd="[object Set]";function _Gd(r){return function(t){var n=vx(t);return n==CGd?Ikt(t):n==SGd?yDa(t):mDa(t,r(t))}}var bDa=_Gd;var vGd=bDa(LR),VLi=vGd;function TGd(r,t){return r&&TBe(r,gDa(t))}var Vut=TGd;function IGd(r){for(var t=-1,n=r==null?0:r.length,i={};++t<n;){var o=r[t];i[o[0]]=o[1]}return i}var KLi=IGd;var OGd=Object.prototype,RGd=OGd.hasOwnProperty;function MGd(r,t){return r!=null&&RGd.call(r,t)}var EDa=MGd;function wGd(r,t){return r!=null&&wkt(r,t,EDa)}var YLi=wGd;var PGd="[object String]";function NGd(r){return typeof r=="string"||!v0(r)&&Ay(r)&&sT(r)==PGd}var CDa=NGd;function DGd(r,t){return IP(t,function(n){return r[n]})}var SDa=DGd;function xGd(r){return r==null?[]:SDa(r,LR(r))}var JLi=xGd;var BGd=Math.min;function kGd(r,t,n){for(var i=n?ADa:s4a,o=r[0].length,s=r.length,a=s,u=Array(s),l=1/0,c=[];a--;){var d=r[a];a&&t&&(d=IP(d,Tj(t))),l=BGd(d.length,l),u[a]=!n&&(t||o>=120&&d.length>=120)?new vkt(a&&d):void 0}d=r[0];var p=-1,f=u[0];e:for(;++p<o&&c.length<l;){var A=d[p],g=t?t(A):A;if(A=n||A!==0?A:0,!(f?Gut(f,g):i(c,g,n))){for(a=s;--a;){var b=u[a];if(!(b?Gut(b,g):i(r[a],g,n)))continue e}f&&f.push(g),c.push(A)}}return c}var _Da=kGd;function LGd(r){return Bkt(r)?r:[]}var vDa=LGd;var qGd=skt(function(r){var t=IP(r,vDa);return t.length&&t[0]===r[0]?_Da(t):[]}),$Li=qGd;function zGd(r,t){return t.length<2?r:Eue(r,gBe(t,0,-1))}var TDa=zGd;var FGd="[object Date]";function QGd(r){return Ay(r)&&sT(r)==FGd}var IDa=QGd;var ODa=W6&&W6.isDate,UGd=ODa?Tj(ODa):IDa,kkt=UGd;function jGd(r,t){return vBe(r,t)}var Cue=jGd;var GGd=cDa(function(r,t,n){_j(r,n,t)}),Sue=GGd;function HGd(r,t){return r<t}var RDa=HGd;function WGd(r,t){var n={};return t=Y6(t,3),TBe(r,function(i,o,s){_j(n,o,t(i,o,s))}),n}var OC=WGd;function VGd(r,t,n){for(var i=-1,o=r.length;++i<o;){var s=r[i],a=t(s);if(a!=null&&(u===void 0?a===a&&!Cj(a):n(a,u)))var u=a,l=s}return l}var MDa=VGd;function KGd(r,t){for(var n,i=-1,o=r.length;++i<o;){var s=t(r[i]);s!==void 0&&(n=n===void 0?s:n+s)}return n}var wDa=KGd;var YGd=u4a(function(r,t,n){fDa(r,t,n)}),XLi=YGd;function JGd(r,t){return r&&r.length?MDa(r,Y6(t,2),RDa):void 0}var ZLi=JGd;var $Gd="Expected a function";function XGd(r){if(typeof r!="function")throw new TypeError($Gd);return function(){var t=arguments;switch(t.length){case 0:return!r.call(this);case 1:return!r.call(this,t[0]);case 2:return!r.call(this,t[0],t[1]);case 3:return!r.call(this,t[0],t[1],t[2])}return!r.apply(this,t)}}var PDa=XGd;function ZGd(r,t){return t=V6(t,r),r=TDa(r,t),r==null||delete r[K6(hDa(t))]}var NDa=ZGd;function eHd(r){return pkt(r)?void 0:r}var DDa=eHd;var tHd=1,rHd=2,nHd=4,iHd=dkt(function(r,t){var n={};if(r==null)return n;var i=!1;t=IP(t,function(s){return s=V6(s,r),i||(i=s.length>1),s}),G6(r,EBe(r),n),i&&(n=_Be(n,tHd|rHd|nHd,DDa));for(var o=t.length;o--;)NDa(n,t[o]);return n}),GS=iHd;function oHd(r,t,n,i){if(!Th(r))return r;t=V6(t,r);for(var o=-1,s=t.length,a=s-1,u=r;u!=null&&++o<s;){var l=K6(t[o]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return r;if(o!=a){var d=u[l];c=i?i(d,l,u):void 0,c===void 0&&(c=Th(d)?d:hue(t[o+1])?[]:{})}oBe(u,l,c),u=u[l]}return r}var Lkt=oHd;function sHd(r,t,n){for(var i=-1,o=t.length,s={};++i<o;){var a=t[i],u=Eue(r,a);n(u,a)&&Lkt(s,V6(a,r),u)}return s}var qkt=sHd;function aHd(r,t){if(r==null)return{};var n=IP(EBe(r),function(i){return[i]});return t=Y6(t),qkt(r,n,function(i,o){return t(i,o[0])})}var zkt=aHd;function uHd(r,t){return zkt(r,PDa(Y6(t)))}var e9i=uHd;var cHd=Nkt("length"),xDa=cHd;var kDa="\\ud800-\\udfff",lHd="\\u0300-\\u036f",dHd="\\ufe20-\\ufe2f",pHd="\\u20d0-\\u20ff",fHd=lHd+dHd+pHd,AHd="\\ufe0e\\ufe0f",hHd="["+kDa+"]",t9i="["+fHd+"]",r9i="\\ud83c[\\udffb-\\udfff]",gHd="(?:"+t9i+"|"+r9i+")",LDa="[^"+kDa+"]",qDa="(?:\\ud83c[\\udde6-\\uddff]){2}",zDa="[\\ud800-\\udbff][\\udc00-\\udfff]",mHd="\\u200d",FDa=gHd+"?",QDa="["+AHd+"]?",yHd="(?:"+mHd+"(?:"+[LDa,qDa,zDa].join("|")+")"+QDa+FDa+")*",bHd=QDa+FDa+yHd,EHd="(?:"+[LDa+t9i+"?",t9i,qDa,zDa,hHd].join("|")+")",BDa=RegExp(r9i+"(?="+r9i+")|"+EHd+bHd,"g");function CHd(r){for(var t=BDa.lastIndex=0;BDa.test(r);)++t;return t}var UDa=CHd;function SHd(r){return mBe(r)?UDa(r):xDa(r)}var jDa=SHd;function _Hd(r,t){return qkt(r,t,function(n,i){return Pkt(r,i)})}var GDa=_Hd;var vHd=dkt(function(r,t){return r==null?{}:GDa(r,t)}),ub=vHd;function THd(r,t,n,i,o){return o(r,function(s,a,u){n=i?(i=!1,s):t(n,s,a,u)}),n}var HDa=THd;function IHd(r,t,n){var i=v0(r)?nNa:HDa,o=arguments.length<3;return i(r,Y6(t,4),n,o,xkt)}var n9i=IHd;function OHd(r,t,n){return r==null?r:Lkt(r,t,n)}var Kut=OHd;var RHd="[object Map]",MHd="[object Set]";function wHd(r){if(r==null)return 0;if(H6(r))return CDa(r)?jDa(r):r.length;var t=vx(r);return t==RHd||t==MHd?r.size:lkt(r).length}var HS=wHd;function PHd(r){return r&&r.length?wDa(r,Sj):0}var i9i=PHd;var Rj=r=>HLi(r,(t,n)=>{if(typeof t=="string"&&typeof n=="string"&&n.match(/(password|token|keypair)/i))return"<REDACTED>"});var Lee=class{constructor(t,n,i){this.logger=t;this.getAllFlags=n;this.getFlagValue=i}getValue(t,n,i){let o=this.getFlagValue(t),s=o===void 0?n:o;return this.assertFeatureFlagType(t,s,i)?s:n}get allFlags(){return this.getAllFlags()}getStringValue(t,n){return this.getValue(t,n,"string")}getNumericValue(t,n){return this.getValue(t,n,"number")}getObjectValue(t,n,i){let o=this.getValue(t,i,"object");return o!==void 0?n.assert(o):void 0}isFeatureEnabled(t,n){return!!this.getValue(t,n,"boolean")}assertFeatureFlagType(t,n,i){return gm(!!oT[t],`'${t}' is not a valid feature flag`,this.logger),n!==void 0&&typeof n!==oT[t].valueType?(this.logger.emerg(`Expected ${oT[t].valueType} feature flag value for ${t}, received ${typeof n}`),!1):i&&oT[t].valueType!==i?(this.logger.emerg(`Expected ${i} for feature flag ${t}, but it is defined as ${oT[t].valueType}`),!1):!0}},RP=class extends Lee{constructor(t,n){super(n??Tc(),()=>t,i=>t[i])}};var Yut=class{constructor(t,n){this.instanceConstructor=t;this.logger=n.child({category:SPa})}logger;_instance;get instance(){return this._instance||(this._instance=new this.instanceConstructor(this.logger)),this._instance}async close(){this._instance&&(await this._instance.close(),this._instance=void 0)}};var o9i="default",s9i=r=>{let t=parseInt(process.env.LAUNCHDARKLY_INIT_TIMEOUT_SEC??"");return isNaN(t)?r:t};var Fkt=r=>{let t={kind:"multi"};return r.user&&(t.user={key:r.user.id,name:r.user.name,anonymous:r.user.id===fue.user.id}),r.org&&(t.organization={key:r.org.id,name:r.org.name}),r.subdomain&&(t.subdomain={key:r.subdomain.id}),r.version&&(t.version={key:r.version.id}),r.email&&(t.email={key:r.email.id}),t},WDa=r=>{switch(r){case"org":return"organization";case"subdomain":return"subdomain";case"user":return"user";case"version":return"version";default:throw new et(`Unsupported feature flags context kind '${r}'`)}},a9i=r=>Object.keys(r).reduce((t,n)=>(oT[n]&&!oT[n].isLegacyOrgFlag&&(t[n]=r[n]),t),{});function aT(){let r=null,t=null,n=new Promise((i,o)=>{r=i,t=o});if(r===null||t===null)throw new Error("The laws of [Javascript] physics have been violated!");return{promise:n,resolve:r,reject:t}}var u9i,dSe;function NHd(r){if(!r||r.trim()==="")return{};let t={},n=r.split(";");for(let i of n){let o=i.trim();if(!o)continue;let s=o.indexOf(":");if(s===-1)continue;let a=o.substring(0,s).trim(),u=o.substring(s+1).trim();if(a){let l=a;if(u==="true")t[l]=!0;else if(u==="false")t[l]=!1;else{let c=Number(u);!isNaN(c)&&u.trim()!==""?t[l]=c:t[l]=u}}}return t}function DHd(){if(dSe!==void 0)return dSe;let r=process.env.COALESCE_TEST_FLAGS;if(!r)return dSe={},dSe;try{return dSe=NHd(r),console.log("[COALESCE_TEST_FLAGS] Parsed test flags from environment:",JSON.stringify(dSe,null,2)),dSe}catch(t){throw new Error(`Failed to parse COALESCE_TEST_FLAGS environment variable: ${t.message}
1949
1949
  Value: ${r}`)}}var pSe=()=>(u9i||(u9i=new c9i),u9i),c9i=class{listeners=new Set;flags=new Map;listen(t){return this.listeners.add(t),()=>this.listeners.delete(t)}async setFlag(t,n,i,o){let s=`${t}:${n}`,a=this.flags.get(s);a||(a={},this.flags.set(s,a));let u=a[i];if(a[i]=o,u!==o)for(let l of this.listeners)l(t,n,i,u,o)}getFlags(t){let n=DHd(),i={...n};for(let o in t){let s=t[o].id,a=this.flags.get(`${o}:${s}`);a&&(i={...i,...a})}if(Object.keys(n).length>0){let o=vu(),s=new RP(i);VDa({...o,featureFlags:s})}return i}async clear(){this.flags=new Map,this.listeners=new Set}};var l9i=class{constructor(t){this.logger=t}_isInitialized=!1;async initialize(t){this._isInitialized=!0}get isInitialized(){return this._isInitialized}async identify(t){return new RP(pSe().getFlags(t),this.logger)}async close(){this._isInitialized=!1}setTestFlag(t,n,i,o){return pSe().setFlag(t,n,i,o)}};var Qkt=class extends l9i{listeners=new Set;_context;flags;constructor(t){super(t),this.flags=new Lee(this.logger,()=>pSe().getFlags(this.currentContext),n=>pSe().getFlags(this.currentContext)[n]),pSe().listen(this.onFlagChange.bind(this))}async initializeDefaultFlags(){gm(!this.isInitialized,"MockFeatureFlagsClientService is already initialized",this.logger),this._context=fue}async initialize(t){await super.initialize(t),this._context=t.context}get currentContext(){return gm(!!this._context,"MockFeatureFlagsClientService is not initialized or defaults fetched",this.logger),this._context}get currentFlags(){return this.flags}onChange(t){return this.listeners.add(t),()=>this.listeners.delete(t)}async identify(t){let n=pSe(),i=n.getFlags(this.currentContext);this._context=t;let o=n.getFlags(t),s={},a=new Set([...Object.keys(o),...Object.keys(i)]);for(let l of a){let c=o[l],d=i[l];c!==d&&(s[l]={current:c,previous:d})}let u=aT();return await setTimeout(()=>{this.notifyListeners(s),u.resolve(this.flags)}),u.promise}notifyListeners(t){for(let n of this.listeners)n(t)}onFlagChange(t,n,i,o,s){this.currentContext[t]?.id===n&&this.notifyListeners({[i]:{current:s,previous:o}})}async close(){await super.close(),this._context=void 0}};var k3y=M.object({orgID:Y8t.optional(),userID:J8t.optional(),requestID:M.string().optional()}),Jut,VDa=r=>{let t=Jut;return Jut={...r},t},p9i=()=>(Jut||(Jut={logContext:{},featureFlags:new RP({})}),Jut),d9i=p9i,KDa=r=>{let t=d9i;return d9i=r,t};var vu=()=>d9i();var YDa=()=>process.env.JEST_WORKER_ID!==void 0,JDa=()=>process.env.PLAYWRIGHT==="true"||process.env.REACT_APP_PLAYWRIGHT==="true"?!0:typeof window<"u"&&typeof window.localStorage<"u"?window.localStorage.getItem("playwright")==="true":!1;typeof self>"u"&&typeof global<"u"&&(global.self=global);var uT=()=>typeof process<"u"&&typeof process.release<"u"&&process.release.name==="node",$Da=()=>!uT()&&typeof self<"u"&&(typeof Window>"u"||!(self instanceof Window)),XDa=()=>uT()&&!eval("require")("worker_threads").isMainThread,qf=(0,exa.default)(()=>{let r=uT();return{isWorker:r?XDa():$Da(),isNodeWorker:XDa(),isWebWorker:$Da(),isNode:r,isBrowser:!r,isProduction:!0,isDevelopment:!1,isTest:!1,isPlaywright:JDa(),selfType:typeof self,windowType:typeof Window,selfInstanceOfWindow:typeof Window<"u"&&self instanceof Window,selfPostMessage:typeof self<"u"&&!!self.postMessage}}),Mj=process.env.APPLICATION_CONTEXT||void 0,txa=r=>{if(Mj===void 0)Mj=r;else if(Mj!=="test"&&Mj!==r)throw new Error(`Changing application contexts from ${Mj} to ${r} is disallowed`)},rxa=r=>r===Mj,Ukt=()=>Mj,IBe=()=>Mj==="scheduler"||Mj==="test"&&process.env.GOOGLE_APPLICATION_CREDENTIALS,nxa=()=>Mj==="cleanup",ZDa=()=>{let t=process.env.PORT;return t?parseInt(t):qf().isTest&&typeof process.env.JEST_WORKER_ID=="string"?8080+parseInt(process.env.JEST_WORKER_ID):qf().isTest&&typeof process.env.VITEST_WORKER_ID=="string"?8080+parseInt(process.env.VITEST_WORKER_ID):8080};function mm(){if(uT()){let r=process.env.SCHEDULER_ADDRESS;if(r)return r;throw new Error("Unable to determine base URL")}return self.location.origin}var xHd=r=>`http://${process.env.K8S_COA_TEST_HOST}:${r}`,A9i=()=>process.env.SCHEDULER_ADDRESS?process.env.SCHEDULER_ADDRESS:qf().isTest?xHd(ZDa()):process.env.K8S_COA_SCHEDULER_URL||`http://localhost:${ZDa()}`,BHd=`http://localhost:${process.env.METADATA_SERVICE_PORT||"8808"}`,jkt=(r=BHd)=>{let t=process.env.METADATA_SERVICE_ADDRESS;if(t)return t;let n=process.env.AXIOS_POST_ADDRESS;return n||r},f9i=()=>parseInt(process.env.DEPLOY_SERVICE_PORT||"8008",10),$ut=(r=`http://localhost:${f9i()}`)=>{let t={schedulerAddress:process.env.SCHEDULER_ADDRESS,deployServiceAddress:process.env.DEPLOY_SERVICE_ADDRESS,k8sDeployServiceUrl:process.env.K8S_COA_DEPLOY_SERVICE_URL,axiosPostAddress:process.env.AXIOS_POST_ADDRESS,deployServicePort:f9i(),isTest:qf().isTest,isNode:uT()};if(t.deployServiceAddress)return t.deployServiceAddress;if(t.k8sDeployServiceUrl)return t.k8sDeployServiceUrl;if(t.axiosPostAddress)return t.axiosPostAddress;if(!t.isNode)return"";if(isNaN(t.deployServicePort))throw new Nee(t,"Invalid DEPLOY_SERVICE_PORT value");if(t.schedulerAddress)try{let n=new URL(t.schedulerAddress);return n.hostname!=="localhost"&&n.hostname!=="127.0.0.1"?t.schedulerAddress:`${n.protocol}//${n.hostname}:${t.deployServicePort}`}catch{}if(t.isTest)return r;throw new Nee(t,"Reached drop-through code path in GetDeployServiceURLOnFrontendOrCLI")},ixa=()=>{let r=process.env.DEPLOY_SERVICE_ADDRESS;if(r)return r;let t=process.env.K8S_COA_DEPLOY_SERVICE_URL;if(t)return t;let n=A9i(),i=f9i();if(n)try{let o=new URL(n);if(o.hostname==="localhost"||o.hostname==="127.0.0.1")return`${o.protocol}//${o.hostname}:${i}`;let s=o.hostname,a;if(s.startsWith("pr-scheduler."))a=s.replace("pr-scheduler.","pr-deploy.");else if(s.startsWith("scheduler."))a=s.replace("scheduler.","deploy-service.");else{let u=s.split("."),l=u.indexOf("scheduler");l!==-1&&(u[l]="deploy-service",a=u.join("."))}return a?`${o.protocol}//${a}:${i}`:n}catch{}return`http://localhost:${i}`},fSe=(r=!1,t)=>process.env.DISABLE_PROXIES==="true"||J6()?!1:t?vu().featureFlags.isFeatureEnabled(t,r):r,OBe=()=>mm(),kHd=["app","local","localhost","dev","loadtesting","qa","staging","preview","eu"],oxa=r=>{let t=r?.split("."),n=t?.length?t[0]:void 0;return!n||kHd.includes(n)?void 0:n},LHd="Run timed out. Restart the run, and if this issue persists contact support.",qHd="Marked failed by Coalesce for late network check-in",U3y="Marked failed by Coalesce for missing workspace ID",j3y="Marked failed by Coalesce for no corresponding workspace",J6=()=>!!process.env.COALESCE_COA_CLOUD_JOB_ID;var sxa=["20","22","24"],FHd=typeof process<"u"&&typeof process.release<"u"&&process.release.name==="node"&&!!process.versions.node,QHd=FHd&&sxa.indexOf(process.versions.node.split(".")[0])<0;if(QHd){if(console.error("Node version",process.versions.node,"not supported, use node",sxa.join(" or ")),qf().isTest)throw new Error(`Invalid node version ${process.versions.node} not supported`);process.exit(1)}function $6(r){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];if(0)var o,s;throw Error("[Immer] minified error nr: "+r+(n.length?" "+n.map(function(a){return"'"+a+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function RBe(r){return!!r&&!!r[zf]}function zee(r){var t;return!!r&&(function(n){if(!n||typeof n!="object")return!1;var i=Object.getPrototypeOf(n);if(i===null)return!0;var o=Object.hasOwnProperty.call(i,"constructor")&&i.constructor;return o===Object||typeof o=="function"&&Function.toString.call(o)===JHd}(r)||Array.isArray(r)||!!r[tct]||!!(!((t=r.constructor)===null||t===void 0)&&t[tct])||_9i(r)||v9i(r))}function MBe(r,t,n){n===void 0&&(n=!1),wBe(r)===0?(n?Object.keys:M9i)(r).forEach(function(i){n&&typeof i=="symbol"||t(i,r[i],r)}):r.forEach(function(i,o){return t(o,i,r)})}function wBe(r){var t=r[zf];return t?t.i>3?t.i-4:t.i:Array.isArray(r)?1:_9i(r)?2:v9i(r)?3:0}function b9i(r,t){return wBe(r)===2?r.has(t):Object.prototype.hasOwnProperty.call(r,t)}function UHd(r,t){return wBe(r)===2?r.get(t):r[t]}function fxa(r,t,n){var i=wBe(r);i===2?r.set(t,n):i===3?r.add(n):r[t]=n}function jHd(r,t){return r===t?r!==0||1/r==1/t:r!=r&&t!=t}function _9i(r){return KHd&&r instanceof Map}function v9i(r){return YHd&&r instanceof Set}function WS(r){return r.o||r.t}function T9i(r){if(Array.isArray(r))return Array.prototype.slice.call(r);var t=$Hd(r);delete t[zf];for(var n=M9i(t),i=0;i<n.length;i++){var o=n[i],s=t[o];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(t[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:r[o]})}return Object.create(Object.getPrototypeOf(r),t)}function I9i(r,t){return t===void 0&&(t=!1),O9i(r)||RBe(r)||!zee(r)||(wBe(r)>1&&(r.set=r.add=r.clear=r.delete=GHd),Object.freeze(r),t&&MBe(r,function(n,i){return I9i(i,!0)},!0)),r}function GHd(){$6(2)}function O9i(r){return r==null||typeof r!="object"||Object.isFrozen(r)}function wj(r){var t=C9i[r];return t||$6(18,r),t}function HHd(r,t){C9i[r]||(C9i[r]=t)}function Hkt(){return ect}function h9i(r,t){t&&(wj("Patches"),r.u=[],r.s=[],r.v=t)}function Wkt(r){E9i(r),r.p.forEach(WHd),r.p=null}function E9i(r){r===ect&&(ect=r.l)}function axa(r){return ect={p:[],l:ect,h:r,m:!0,_:0}}function WHd(r){var t=r[zf];t.i===0||t.i===1?t.j():t.g=!0}function g9i(r,t){t._=t.p.length;var n=t.p[0],i=r!==void 0&&r!==n;return t.h.O||wj("ES5").S(t,r,i),i?(n[zf].P&&(Wkt(t),$6(4)),zee(r)&&(r=Vkt(t,r),t.l||Kkt(t,r)),t.u&&wj("Patches").M(n[zf].t,r,t.u,t.s)):r=Vkt(t,n,[]),Wkt(t),t.u&&t.v(t.u,t.s),r!==hxa?r:void 0}function Vkt(r,t,n){if(O9i(t))return t;var i=t[zf];if(!i)return MBe(t,function(u,l){return uxa(r,i,t,u,l,n)},!0),t;if(i.A!==r)return t;if(!i.P)return Kkt(r,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var o=i.i===4||i.i===5?i.o=T9i(i.k):i.o,s=o,a=!1;i.i===3&&(s=new Set(o),o.clear(),a=!0),MBe(s,function(u,l){return uxa(r,i,o,u,l,n,a)}),Kkt(r,o,!1),n&&r.u&&wj("Patches").N(i,n,r.u,r.s)}return i.o}function uxa(r,t,n,i,o,s,a){if(RBe(o)){var u=Vkt(r,o,s&&t&&t.i!==3&&!b9i(t.R,i)?s.concat(i):void 0);if(fxa(n,i,u),!RBe(u))return;r.m=!1}else a&&n.add(o);if(zee(o)&&!O9i(o)){if(!r.h.D&&r._<1)return;Vkt(r,o),t&&t.A.l||Kkt(r,o)}}function Kkt(r,t,n){n===void 0&&(n=!1),!r.l&&r.h.D&&r.m&&I9i(t,n)}function m9i(r,t){var n=r[zf];return(n?WS(n):r)[t]}function cxa(r,t){if(t in r)for(var n=Object.getPrototypeOf(r);n;){var i=Object.getOwnPropertyDescriptor(n,t);if(i)return i;n=Object.getPrototypeOf(n)}}function qee(r){r.P||(r.P=!0,r.l&&qee(r.l))}function y9i(r){r.o||(r.o=T9i(r.t))}function Zut(r,t,n){var i=_9i(t)?wj("MapSet").F(t,n):v9i(t)?wj("MapSet").T(t,n):r.O?function(o,s){var a=Array.isArray(o),u={i:a?1:0,A:s?s.A:Hkt(),P:!1,I:!1,R:{},l:s,t:o,k:null,o:null,j:null,C:!1},l=u,c=S9i;a&&(l=[u],c=Xut);var d=Proxy.revocable(l,c),p=d.revoke,f=d.proxy;return u.k=f,u.j=p,f}(t,n):wj("ES5").J(t,n);return(n?n.A:Hkt()).p.push(i),i}function VHd(r){return RBe(r)||$6(22,r),function t(n){if(!zee(n))return n;var i,o=n[zf],s=wBe(n);if(o){if(!o.P&&(o.i<4||!wj("ES5").K(o)))return o.t;o.I=!0,i=lxa(n,s),o.I=!1}else i=lxa(n,s);return MBe(i,function(a,u){o&&UHd(o.t,a)===u||fxa(i,a,t(u))}),s===3?new Set(i):i}(r)}function lxa(r,t){switch(t){case 2:return new Map(r);case 3:return Array.from(r)}return T9i(r)}function Axa(){function r(u,l){function c(){this.constructor=u}o(u,l),u.prototype=(c.prototype=l.prototype,new c)}function t(u){u.o||(u.R=new Map,u.o=new Map(u.t))}function n(u){u.o||(u.o=new Set,u.t.forEach(function(l){if(zee(l)){var c=Zut(u.A.h,l,u);u.p.set(l,c),u.o.add(c)}else u.o.add(l)}))}function i(u){u.g&&$6(3,JSON.stringify(WS(u)))}var o=function(u,l){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,d){c.__proto__=d}||function(c,d){for(var p in d)d.hasOwnProperty(p)&&(c[p]=d[p])})(u,l)},s=function(){function u(c,d){return this[zf]={i:2,l:d,A:d?d.A:Hkt(),P:!1,I:!1,o:void 0,R:void 0,t:c,k:this,C:!1,g:!1},this}r(u,Map);var l=u.prototype;return Object.defineProperty(l,"size",{get:function(){return WS(this[zf]).size}}),l.has=function(c){return WS(this[zf]).has(c)},l.set=function(c,d){var p=this[zf];return i(p),WS(p).has(c)&&WS(p).get(c)===d||(t(p),qee(p),p.R.set(c,!0),p.o.set(c,d),p.R.set(c,!0)),this},l.delete=function(c){if(!this.has(c))return!1;var d=this[zf];return i(d),t(d),qee(d),d.t.has(c)?d.R.set(c,!1):d.R.delete(c),d.o.delete(c),!0},l.clear=function(){var c=this[zf];i(c),WS(c).size&&(t(c),qee(c),c.R=new Map,MBe(c.t,function(d){c.R.set(d,!1)}),c.o.clear())},l.forEach=function(c,d){var p=this;WS(this[zf]).forEach(function(f,A){c.call(d,p.get(A),A,p)})},l.get=function(c){var d=this[zf];i(d);var p=WS(d).get(c);if(d.I||!zee(p)||p!==d.t.get(c))return p;var f=Zut(d.A.h,p,d);return t(d),d.o.set(c,f),f},l.keys=function(){return WS(this[zf]).keys()},l.values=function(){var c,d=this,p=this.keys();return(c={})[Gkt]=function(){return d.values()},c.next=function(){var f=p.next();return f.done?f:{done:!1,value:d.get(f.value)}},c},l.entries=function(){var c,d=this,p=this.keys();return(c={})[Gkt]=function(){return d.entries()},c.next=function(){var f=p.next();if(f.done)return f;var A=d.get(f.value);return{done:!1,value:[f.value,A]}},c},l[Gkt]=function(){return this.entries()},u}(),a=function(){function u(c,d){return this[zf]={i:3,l:d,A:d?d.A:Hkt(),P:!1,I:!1,o:void 0,t:c,k:this,p:new Map,g:!1,C:!1},this}r(u,Set);var l=u.prototype;return Object.defineProperty(l,"size",{get:function(){return WS(this[zf]).size}}),l.has=function(c){var d=this[zf];return i(d),d.o?!!d.o.has(c)||!(!d.p.has(c)||!d.o.has(d.p.get(c))):d.t.has(c)},l.add=function(c){var d=this[zf];return i(d),this.has(c)||(n(d),qee(d),d.o.add(c)),this},l.delete=function(c){if(!this.has(c))return!1;var d=this[zf];return i(d),n(d),qee(d),d.o.delete(c)||!!d.p.has(c)&&d.o.delete(d.p.get(c))},l.clear=function(){var c=this[zf];i(c),WS(c).size&&(n(c),qee(c),c.o.clear())},l.values=function(){var c=this[zf];return i(c),n(c),c.o.values()},l.entries=function(){var c=this[zf];return i(c),n(c),c.o.entries()},l.keys=function(){return this.values()},l[Gkt]=function(){return this.values()},l.forEach=function(c,d){for(var p=this.values(),f=p.next();!f.done;)c.call(d,f.value,f.value,this),f=p.next()},u}();HHd("MapSet",{F:function(u,l){return new s(u,l)},T:function(u,l){return new a(u,l)}})}var dxa,ect,R9i=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",KHd=typeof Map<"u",YHd=typeof Set<"u",pxa=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",hxa=R9i?Symbol.for("immer-nothing"):((dxa={})["immer-nothing"]=!0,dxa),tct=R9i?Symbol.for("immer-draftable"):"__$immer_draftable",zf=R9i?Symbol.for("immer-state"):"__$immer_state",Gkt=typeof Symbol<"u"&&Symbol.iterator||"@@iterator";var JHd=""+Object.prototype.constructor,M9i=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:Object.getOwnPropertyNames,$Hd=Object.getOwnPropertyDescriptors||function(r){var t={};return M9i(r).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(r,n)}),t},C9i={},S9i={get:function(r,t){if(t===zf)return r;var n=WS(r);if(!b9i(n,t))return function(o,s,a){var u,l=cxa(s,a);return l?"value"in l?l.value:(u=l.get)===null||u===void 0?void 0:u.call(o.k):void 0}(r,n,t);var i=n[t];return r.I||!zee(i)?i:i===m9i(r.t,t)?(y9i(r),r.o[t]=Zut(r.A.h,i,r)):i},has:function(r,t){return t in WS(r)},ownKeys:function(r){return Reflect.ownKeys(WS(r))},set:function(r,t,n){var i=cxa(WS(r),t);if(i?.set)return i.set.call(r.k,n),!0;if(!r.P){var o=m9i(WS(r),t),s=o?.[zf];if(s&&s.t===n)return r.o[t]=n,r.R[t]=!1,!0;if(jHd(n,o)&&(n!==void 0||b9i(r.t,t)))return!0;y9i(r),qee(r)}return r.o[t]===n&&(n!==void 0||t in r.o)||Number.isNaN(n)&&Number.isNaN(r.o[t])||(r.o[t]=n,r.R[t]=!0),!0},deleteProperty:function(r,t){return m9i(r.t,t)!==void 0||t in r.t?(r.R[t]=!1,y9i(r),qee(r)):delete r.R[t],r.o&&delete r.o[t],!0},getOwnPropertyDescriptor:function(r,t){var n=WS(r),i=Reflect.getOwnPropertyDescriptor(n,t);return i&&{writable:!0,configurable:r.i!==1||t!=="length",enumerable:i.enumerable,value:n[t]}},defineProperty:function(){$6(11)},getPrototypeOf:function(r){return Object.getPrototypeOf(r.t)},setPrototypeOf:function(){$6(12)}},Xut={};MBe(S9i,function(r,t){Xut[r]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Xut.deleteProperty=function(r,t){return Xut.set.call(this,r,t,void 0)},Xut.set=function(r,t,n){return S9i.set.call(this,r[0],t,n,r[0])};var XHd=function(){function r(n){var i=this;this.O=pxa,this.D=!0,this.produce=function(o,s,a){if(typeof o=="function"&&typeof s!="function"){var u=s;s=o;var l=i;return function(b){var _=this;b===void 0&&(b=u);for(var v=arguments.length,O=Array(v>1?v-1:0),R=1;R<v;R++)O[R-1]=arguments[R];return l.produce(b,function(w){var P;return(P=s).call.apply(P,[_,w].concat(O))})}}var c;if(typeof s!="function"&&$6(6),a!==void 0&&typeof a!="function"&&$6(7),zee(o)){var d=axa(i),p=Zut(i,o,void 0),f=!0;try{c=s(p),f=!1}finally{f?Wkt(d):E9i(d)}return typeof Promise<"u"&&c instanceof Promise?c.then(function(b){return h9i(d,a),g9i(b,d)},function(b){throw Wkt(d),b}):(h9i(d,a),g9i(c,d))}if(!o||typeof o!="object"){if((c=s(o))===void 0&&(c=o),c===hxa&&(c=void 0),i.D&&I9i(c,!0),a){var A=[],g=[];wj("Patches").M(o,c,A,g),a(A,g)}return c}$6(21,o)},this.produceWithPatches=function(o,s){if(typeof o=="function")return function(c){for(var d=arguments.length,p=Array(d>1?d-1:0),f=1;f<d;f++)p[f-1]=arguments[f];return i.produceWithPatches(c,function(A){return o.apply(void 0,[A].concat(p))})};var a,u,l=i.produce(o,s,function(c,d){a=c,u=d});return typeof Promise<"u"&&l instanceof Promise?l.then(function(c){return[c,a,u]}):[l,a,u]},typeof n?.useProxies=="boolean"&&this.setUseProxies(n.useProxies),typeof n?.autoFreeze=="boolean"&&this.setAutoFreeze(n.autoFreeze)}var t=r.prototype;return t.createDraft=function(n){zee(n)||$6(8),RBe(n)&&(n=VHd(n));var i=axa(this),o=Zut(this,n,void 0);return o[zf].C=!0,E9i(i),o},t.finishDraft=function(n,i){var o=n&&n[zf],s=o.A;return h9i(s,i),g9i(void 0,s)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!pxa&&$6(20),this.O=n},t.applyPatches=function(n,i){var o;for(o=i.length-1;o>=0;o--){var s=i[o];if(s.path.length===0&&s.op==="replace"){n=s.value;break}}o>-1&&(i=i.slice(o+1));var a=wj("Patches").$;return RBe(n)?a(n,i):this.produce(n,function(u){return a(u,i)})},r}(),Tx=new XHd,X6=Tx.produce,H3y=Tx.produceWithPatches.bind(Tx),gxa=Tx.setAutoFreeze.bind(Tx),W3y=Tx.setUseProxies.bind(Tx),V3y=Tx.applyPatches.bind(Tx),K3y=Tx.createDraft.bind(Tx),Y3y=Tx.finishDraft.bind(Tx),mxa=X6;Axa();gxa(!1);var Iza=require("os");var ZHd=["debug","info","warn","error","fatal"],yxa=r=>ZHd.includes(r);var w9i=["ACTUAL_STATE","ADVANCED_DEPLOY","APP","AUTH","BULK_WRITE","CLEANUP_TOOL","CLI","CLI_INTERNAL","COLUMN_LINEAGE","COLUMN_METADATA","COMMON","CONNECTION","DEBUG","DEPLOY","DNS","DOCS","DRAG","ENTITY_API","ENV","ENVIRONMENTS","ERROR_OPERATIONS","FIREBASE","FOLDERS","GIT","GIT_SETTINGS","GOOGLE_DEBUG","GRAPH","HEARTBEAT","INTEGRATIONS","JDBC_SERVICE","JEST","JOBS","JSON_PARSER","LIGHTNING_FS","LISTENERS","MACROS","MAPPING_GRID","METADATA_HYDRATION","METADATA_OPERATIONS","NARROW_METADATA","NODE_TYPES","ORGS","ORG_BOOTSTRAP","ORG_SCANNER","ORG_SETTINGS","ORG_UPGRADE","PACKAGES","PACKAGES_BACKEND","PACKAGE_NAMESPACES","PACKAGE_REGISTRY","PALETTE","PARTNER_CONNECT","PENDO","PERFORMANCE","PIPELINE","PLAN","PLATFORM","PRESYNC","PROBLEM_SCANNER","PROJECTS","RBAC","RENDERER","RUNNER","RUNNER_BACKEND","RUN_RESULTS","RUN_TRANSACTION","SEARCH","SECRETS","SECURE_RUN_AND_WORKSPACE","SERVICE_WORKSPACE_STATUS","SQL_PARSING","SQL_TESTING","STATE","STEPS","STORAGE_LOCATIONS","STRUMENTA","SYSTEM_EMAILS","TEMPLATE_EDITOR","TESTING","TIMING_UTILS","TREE_OPERATIONS","TYPESENSE","UI","USERS","USER_ACTIVATION","USER_MANAGEMENT","USER_SETTINGS","VERSIONING","VERSION_CONTROL_ACTIONS","WORKSPACES","XML_PARSER","YAML","ZIP","AI_COLUMN_DESCRIPTIONS","AI_NODE_DESCRIPTIONS","AI_GIT_COMMIT_MESSAGE","AI_COPILOT","SSO_SETTINGS"],Z6={...Object.fromEntries(w9i.map(r=>[r,{level:"info"}]))};var bxa=["Authorization","Token","Password","Secret","idToken","id_token","clientID","clientSecret","apiKey","snowflakeKeyPairKey","snowflakeKeyPairPass","keyPairKey","keyPairPass","key","keyPair","privateKey","passphrase","serviceAccountKey","bigQueryServiceAccountKey"];var P9i=()=>{let r=new WeakSet;return(t,n)=>{if(typeof n=="object"&&n!==null){if(r.has(n))return;r.add(n)}return n}},PBe=r=>{switch(typeof r){case"object":if(r===null)return"null";try{if(r instanceof Error){if(Ag(r)){let t=r.toJSON();try{"config"in t&&typeof t.config=="object"&&t.config!==null&&(delete t.config.httpAgent,delete t.config.httpsAgent)}catch{}return`AxiosError: ${JSON.stringify(t,P9i())}`}if(r instanceof et)return r.toString();if($8t(r))return`Error: [${r.code}] ${r.message}`}switch(r?.constructor?.name){case"Object":case"Array":return JSON.stringify(r,P9i());case"Set":return JSON.stringify(Array.from(r),P9i());case"Error":{let t=r.toString();try{let n=JSON.stringify(r);n!=="{}"&&(t=n)}catch{}return t}case"Null":return"null";case"Function":case"RegExp":return r.toString();case"Date":return r.toDateString();case"ReferenceError":case"TypeError":case"SyntaxError":case"JestAssertionError":return r.toString();case void 0:default:return`attempting to stringify object w/ constructor: ${r?.constructor?.name}; ${JSON.stringify(r)}`}}catch(t){return`Error converting object to string:${t}`}case"undefined":return typeof r;case"bigint":case"number":case"symbol":return r.toString();case"boolean":return String(r);case"string":return r;default:return"Can't convert arg to string"}};var Exa=1e6,Cxa=.8,_ue=r=>{let t;return r&&r.length>5?t="*"+r.substring(r.length-4,r.length):r.length?t="****":t="",t},NBe=r=>{if(r.length===0)return"";if(r.length===1){let o=PBe(r[0]),s=Exa*Cxa/2;return o.length>s?o.slice(0,s):o}let n=Exa*Cxa/2/r.length,i=new Array(r.length);for(let o=0;o<r.length;o++){let s=PBe(r[o]);i[o]=s.length>n?s.slice(0,n):s}return i.join(" ")},eWd=bxa.map(r=>new RegExp(`("${r}"\\s*:\\s*)"(?:\\\\.|[^"])*"`,"gi")),N9i=r=>{if(!r)return"";let t=r;for(let n of eWd)n.lastIndex=0,t=t.replace(n,'$1"[REDACTED]"');return t};var Jkt=class extends et{};var LBe=_t(gE());var qBe=class extends aSe{constructor(n,i){super({level:n,shipToLogger:({logLevel:o,messages:s,data:a,hasData:u})=>{let l=this.format({logLevel:o,messages:s,data:a&&u?a:{}});return this.consoleLog(l),[]}});this.logFormat=i}colorizeLogLevel(n){if(n==="trace"||n==="debug")return LBe.default.magenta(`${n}`);if(n==="info")return LBe.default.green(`${n}`);if(n==="warn")return LBe.default.yellow(`${n}`);if(n==="error")return LBe.default.cyan(`${n}`);if(n==="fatal")return LBe.default.red(`${n}`);{let i=n;throw new et(`Invalid log level ${i}`)}}format(n){if(this.logFormat==="text")return this.textFormat(n);if(this.logFormat==="json")return this.jsonFormat(n);{let i=this.logFormat;throw new et(`Invalid log formatter: ${i}`)}}jsonFormat(n){let{logLevel:i,messages:o,data:s}=n,a=NBe(o);return JSON.stringify({...s,message:a,level:i})}textFormat(n){let{logLevel:i,messages:o,data:s}=n,a=NBe(o),u=[{key:"orgID",prefix:"org"},{key:"workspaceID",prefix:"env"},{key:"userID",prefix:"user"},{key:"runID",prefix:"run"},{key:"runType",prefix:"runType"},{key:"nodeID",prefix:"node"},{key:"kubernetesJobUuid",prefix:"k8s-job"},{key:"planID",prefix:"plan"}],l=process.env.JEST_WORKER_ID?`[SHARD:${process.env.JEST_WORKER_ID}]`:"",c=u.map(({key:A,prefix:g})=>s[A]?`|(${g}:${s[A]})`:"").join(""),d=this.colorizeLogLevel(i),p=s.time??new Date().toISOString(),f=s.loggingArea??"COMMON";return`|${p}|${l}[${f}]${c}|${d}:${a}`}};var nLt={fatal:0,error:1,warn:2,info:3,debug:4},iLt=class{constructor(t,n,i=void 0){this.area=t;this.logLevel=n;this._logger=i;this.currentLevelPriority=nLt[n]}transports=void 0;defaultContext={};currentLevelPriority;isLevelEnabled(t){return nLt[t]<=this.currentLevelPriority}get logger(){return this._logger||(this._logger=this.createLogger()),this._logger}createLogger(){if(!this.transports)throw new et("Must create transports before using the logger!");return new Z8t({transport:this.transports})}noContextLogger(t,n){this.contextLogger(t,void 0,n)}contextLogger(t,n,i){if(!this.isLevelEnabled(t))return;let o=NBe(i);try{o=N9i(o)}catch(l){console.debug(`[${this.area}] Failed to redact sensitive data: ${PBe(l)}`),console.error(`[${this.area}] Failed to redact sensitive data. Swallowing log and returning early.`);return}let a={...vu().logContext,...this.defaultContext,...n,loggingArea:this.area},u=e9i(a,l=>l===void 0);if(this.transports)for(let l of this.transports)l.shipToLogger&&l.shipToLogger({logLevel:t,messages:[o],data:u,hasData:Object.keys(u).length>0})}debug(...t){this.noContextLogger("debug",t)}info(...t){this.noContextLogger("info",t)}warn(...t){this.noContextLogger("warn",t)}error(...t){this.noContextLogger("error",t)}fatal(...t){this.noContextLogger("fatal",t)}alert(...t){this.noContextLogger("warn",t)}app(...t){this.noContextLogger("info",t)}assert(...t){this.noContextLogger("error",t)}emerg(...t){this.noContextLogger("fatal",t)}debugContext(t,...n){this.contextLogger("debug",t,n)}infoContext(t,...n){this.contextLogger("info",t,n)}warnContext(t,...n){this.contextLogger("warn",t,n)}errorContext(t,...n){this.contextLogger("error",t,n)}fatalContext(t,...n){this.contextLogger("fatal",t,n)}alertContext(t,...n){this.contextLogger("warn",t,n)}appContext(t,...n){this.contextLogger("info",t,n)}assertContext(t,...n){this.contextLogger("error",t,n)}emergContext(t,...n){this.contextLogger("fatal",t,n)}logAtLevel(t,...n){this.noContextLogger(t,n)}logContextAtLevel(t,n,...i){this.contextLogger(t,n,i)}getConsoleTransport(){for(let t of this.transports??[])if(t instanceof qBe)return t;throw new Jkt("Invalid confguration: there must always be a console transport")}changeConsoleLogLevel(t){if(t){let n=this.getConsoleTransport();n.level=t,n.enabled=!0,this.currentLevelPriority=nLt[t];return}else{let n=this.getConsoleTransport();n.level=this.logLevel,n.enabled=!1,this.currentLevelPriority=nLt[this.logLevel]}}silenceConsole(t){this.getConsoleTransport().enabled=!t}async close(t){}setDefaultLogContext(t){this.defaultContext={...this.defaultContext,...t}}setTransports(t){if(this.transports)throw new et("Got a repeat call of setTransports()");this.transports=t}getCommonLogger(){if(!this.transports)throw new et("Must create transports before getting a child logger!");return new zut({loggingArea:this.area},this.transports,this.logger)}};var We=r=>{let t=Z6[r];if(!t)throw new Error(`Logging area "${r}" is not a valid LoggingAreas key`);return t.logger||(t.logger=new iLt(r,t.level)),t.logger},U9i=r=>{let t=We("COMMON").getCommonLogger().child(r);return qLi(t),t};var oLt=(r,t)=>{let n=r.toUpperCase(),i=[];if(n in Z6||i.push(`invalid logging area '${n}'`),yxa(t)||i.push("`invalid log level '${logLevel}'`"),i.length)throw i.forEach(s=>{console.error(s)}),new Error("Invalid logging area or log level: "+i.join(", "));We(n).changeConsoleLogLevel(t)},_Wd=r=>{for(let t of w9i)oLt(t,r)},j9i=()=>_Wd("debug");var Fee=r=>{for(let t of Object.keys(Z6))We(t).setDefaultLogContext(r)},Kxa=(r,t)=>{for(let n in Z6){let i=n,{level:o}=Z6[i];r(i).setTransports(t(i,o))}};var zBe=(r,t,n,i,o)=>({orgID:r,workspaceID:t,userID:n,runID:i,nodeID:o}),FBe=(r,t)=>{r.runID=t};var MP={};var sLt=class{constructor(t){this.logger=t}info=(...t)=>this.log("info",void 0,t);debug=(...t)=>this.log("debug",void 0,t);error=(...t)=>this.log("error",void 0,t);assert=(...t)=>this.log("assert",void 0,t);warn=(...t)=>this.log("warn",void 0,t);alert=(...t)=>this.log("alert",void 0,t);emerg=(...t)=>this.log("emerg",void 0,t);fatal=(...t)=>this.log("emerg",void 0,t);app=(...t)=>this.log("app",void 0,t);infoContext=(t,...n)=>this.log("infoContext",t,n);debugContext=(t,...n)=>this.log("debugContext",t,n);errorContext=(t,...n)=>this.log("errorContext",t,n);assertContext=(t,...n)=>this.log("assertContext",t,n);alertContext=(t,...n)=>this.log("alertContext",t,n);warnContext=(t,...n)=>this.log("warnContext",t,n);emergContext=(t,...n)=>this.log("emergContext",t,n);fatalContext=(t,...n)=>this.log("emergContext",t,n);appContext=(t,...n)=>this.log("appContext",t,n);logAtLevel=(t,...n)=>{t==="fatal"?this.log("emerg",void 0,n):this.log(t,void 0,n)};logContextAtLevel=(t,n,...i)=>{t==="fatal"?this.log("emergContext",n,i):this.log(`${t}Context`,n,i)}};var G9i=class extends sLt{constructor(n,i){super(n);this.logContext=i;this.start=performance.now()}start;reset(){this.start=performance.now()}log(n,i,...o){let s=performance.now()-this.start;this.logger[n](i??this.logContext??{},...o,`
1950
- total event time: `,s.toFixed(0),"ms")}},cT=class extends G9i{shouldAllowInTestEnv;constructor(t,n,i){super(t,n),this.shouldAllowInTestEnv=i??!1}log(t,n,...i){qf().isTest&&!this.shouldAllowInTestEnv||super.log(t,n,"PERF METRIC:",i)}logMetric(t,n,i){if(qf().isTest&&!this.shouldAllowInTestEnv)return;let o=i||performance.now()-this.start,s={name:t,"time-ms":Math.round(o),...n||{}};n?.warning?this.logger.warnContext(this.logContext??{},"PERF METRIC:",s):this.logger.infoContext(this.logContext??{},"PERF METRIC:",s)}logMetricWithMinDuration(t,n,i){if(qf().isTest&&!this.shouldAllowInTestEnv)return;let o=performance.now()-this.start;if(o<n)return;let s={name:t,"time-ms":Math.round(o),params:i};i?.warning?this.logger.warnContext(this.logContext??{},"PERF METRIC:",s):this.logger.infoContext(this.logContext??{},"PERF METRIC:",s)}};var Cct=_t(e8()),VJd=_t(XBe()),wMy=(0,Cct.Record)({version:Cct.String,hash:Cct.String}),KJd=()=>({version:"7.30.7",hash:"14d8c3df7b1780dbe45eb743ea73d0228241812d"}),DP=KJd();var ULt,j6a=r=>{ULt=r},G6a=r=>({coalesceSoftwareVersion:DP?.version||"",service:r,env:process.env.REACT_APP_OWNER??"",reactAppCoalesceDev:process.env.REACT_APP_COALESCE_DEV??""}),Pqi=r=>r.includes("production")?"production":r.includes("staging")?"staging":r.includes("qa")?"qa":"development",Nqi=()=>{if(uT()){let r=process.env.RUNTIME_ENVIRONMENT||"development";return rxa("coa")?J6()?Pqi(r):void 0:Pqi(r)}else{let r;try{r=self.ENVIRONMENT}catch{}return typeof r=="string"?Pqi(r):void 0}};var yPn=_t(dza(),1),Cza=_t(L8o(),1),O_e=_t(require("process"),1),IQ0=Object.prototype.toString,OQ0=r=>IQ0.call(r)==="[object Error]",RQ0=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]);function MQ0(r){return r&&OQ0(r)&&r.name==="TypeError"&&typeof r.message=="string"?r.message==="Load failed"?r.stack===void 0:RQ0.has(r.message):!1}var wQ0=class extends Error{constructor(r){super(),r instanceof Error?(this.originalError=r,{message:r}=r):(this.originalError=new Error(r),this.originalError.stack=this.stack),this.name="AbortError",this.message=r}},gza=(r,t,n)=>{let i=n.retries-(t-1);return r.attemptNumber=t,r.retriesLeft=i,r};async function PQ0(r,t){return new Promise((n,i)=>{t={onFailedAttempt(){},retries:10,shouldRetry:()=>!0,...t};let o=Cza.default.operation(t),s=()=>{o.stop(),i(t.signal?.reason)};t.signal&&!t.signal.aborted&&t.signal.addEventListener("abort",s,{once:!0});let a=()=>{t.signal?.removeEventListener("abort",s),o.stop()};o.attempt(async u=>{try{let l=await r(u);a(),n(l)}catch(l){try{if(!(l instanceof Error))throw new TypeError(`Non-error was thrown: "${l}". You should only throw errors.`);if(l instanceof wQ0)throw l.originalError;if(l instanceof TypeError&&!MQ0(l))throw l;if(gza(l,u,t),await t.shouldRetry(l)||(o.stop(),i(l)),await t.onFailedAttempt(l),!o.retry(l))throw o.mainError()}catch(c){gza(c,u,t),a(),i(c)}}})})}var mPn=new Set,q8o=new Set,mza=!1,yza=!1;async function Adt(r,t,n){if(mza)return;mza=!0,mPn.size>0&&t&&console.error(["SYNCHRONOUS TERMINATION NOTICE:","When explicitly exiting the process via process.exit or via a parent process,","asynchronous tasks in your exitHooks will not run. Either remove these tasks,","use gracefulExit() instead of process.exit(), or ensure your parent process","sends a SIGINT to the process running this code."].join(" "));let i=128+n,o=(l=!1)=>{(l===!0||r===!0)&&O_e.default.exit(i)};for(let l of q8o)l(i);if(t){o();return}let s=[],a=0;for(let[l,c]of mPn)a=Math.max(a,c),s.push(Promise.resolve(l(i)));let u=setTimeout(()=>{o(!0)},a);await Promise.all(s),clearTimeout(u),o()}function NQ0(r){let{onExit:t,wait:n,isSynchronous:i}=r,o=[t,n];return i?q8o.add(t):mPn.add(o),yza||(yza=!0,O_e.default.once("beforeExit",Adt.bind(void 0,!0,!1,-128)),O_e.default.once("SIGINT",Adt.bind(void 0,!0,!1,2)),O_e.default.once("SIGTERM",Adt.bind(void 0,!0,!1,15)),O_e.default.once("exit",Adt.bind(void 0,!1,!0,0)),O_e.default.on("message",s=>{s==="shutdown"&&Adt(!0,!0,-128)})),()=>{i?q8o.delete(t):mPn.delete(o)}}function DQ0(r){if(typeof r!="function")throw new TypeError("onExit must be a function");return NQ0({onExit:r,isSynchronous:!0})}function xQ0(){return`${Date.now()}_${Math.floor(Math.random()*1e3)}`}var BQ0=class{currentBucket;logBucket;constructor(){this.logBucket={},this.newLogBucket()}newLogBucket(){this.currentBucket&&delete this.logBucket[this.currentBucket],this.currentBucket=xQ0(),this.logBucket[this.currentBucket]={size:0,logItems:[]}}getLogBucketByteSize(){return this.logBucket[this.currentBucket].size}getLogCount(){return this.logBucket[this.currentBucket].logItems.length}finishLogBatch(){let r=this.logBucket[this.currentBucket].logItems;return this.newLogBucket(),r}addLog(r,t){this.logBucket[this.currentBucket].size+=t,this.logBucket[this.currentBucket].logItems.push(r)}},kQ0=5138022,bza=996147,Eza=3e3,LQ0=995,Sza=class{logStorage;timer=null;apiInstance;config;constructor(r){this.logStorage=new BQ0,this.config=r,r.onInit&&r.onInit();let t=yPn.client.createConfiguration(r.ddClientConf);t.setServerVariables(r?.ddServerConf||{}),this.apiInstance=new yPn.v2.LogsApi(t),this.setupRegularSend(),this.setupExitHook()}sendLogs({logsToSend:r,bucketName:t}){PQ0(async()=>{let n={body:r,contentEncoding:"gzip"},i=await this.apiInstance.submitLog(n);return this.config.onDebug&&this.config.onDebug(`(${t}) Sending ${r.length} logs to Datadog completed`),i},{retries:this.config.retries??5}).catch(n=>{this.config.onError&&this.config.onError(n,r)})}setupRegularSend(){this.config.sendImmediate||(this.config.onDebug&&this.config.onDebug(`Configured to send logs every ${this.config.sendIntervalMs||Eza}ms`),this.timer=setInterval(()=>{let r=this.logStorage.getLogCount(),t=this.logStorage.currentBucket;r>0&&(this.config.onDebug&&this.config.onDebug(`(${t}) Sending ${r} logs to Datadog on timer`),this.sendLogs({logsToSend:this.logStorage.finishLogBatch(),bucketName:t}))},this.config.sendIntervalMs||Eza))}setupExitHook(){this.config.sendImmediate||(this.config.onDebug&&this.config.onDebug("Configuring exit hook"),DQ0(()=>{if(this.logStorage.getLogCount()>0){this.config.onDebug&&this.config.onDebug("Shutdown detected. Attempting to send remaining logs to Datadog"),this.timer&&clearInterval(this.timer);let r=this.logStorage.currentBucket;this.sendLogs({logsToSend:this.logStorage.finishLogBatch(),bucketName:r})}}))}processLog(r){let t={message:JSON.stringify(r)};this.config.ddsource&&(t.ddsource=this.config.ddsource),this.config.ddtags&&(t.ddtags=this.config.ddtags),this.config.service&&(t.service=this.config.service);let n=t.message.length+(t.ddsource?.length||0)+(t.ddtags?.length||0)+(t.hostname?.length||0)+(t.service?.length||0);if(n>bza&&this.config.onError&&this.config.onError(new Error(`Log entry exceeds size limit of ${bza} bytes: ${n}`),[t]),this.config.sendImmediate){this.config.onDebug&&this.config.onDebug("(send-immediate) Sending log to Datadog"),this.sendLogs({logsToSend:[t],bucketName:"send-immediate"});return}this.logStorage.addLog(t,n);let i=this.logStorage.getLogCount();if(this.logStorage.getLogBucketByteSize()>kQ0||i>LQ0){let s=this.logStorage.currentBucket;this.config.onDebug&&this.config.onDebug(`(${s}) Sending ${i} logs to Datadog`),this.sendLogs({logsToSend:this.logStorage.finishLogBatch(),bucketName:s})}}};var _za=class extends X8t{messageField;levelField;timestampField;timestampFunction;transport;constructor(r){super(r),this.enabled&&(this.transport=new Sza(r.options),this.messageField=r.messageField??"message",this.levelField=r.levelField??"level",this.timestampField=r.timestampField??"time",this.timestampFunction=r.timestampFunction)}shipToLogger({logLevel:r,messages:t,data:n,hasData:i}){let o={};if(!this.transport)throw new Error("DataDogTransport was previously disabled; enabling the flag manually on the transport instance is not supported.");return n&&i&&Object.assign(o,n),this.timestampFunction?o[this.timestampField]=this.timestampFunction():o[this.timestampField]=new Date().toISOString(),o[this.levelField]=r,o[this.messageField]=t.join(" "),this.transport.processLog(o),t}};var vza=require("node:os");var bPn=class extends qBe{consoleLog(t){process.stdout.write(`${t}${vza.EOL}`)}};var Tza=(r,t,n=!1)=>{let i=G6a(ULt),o={ddClientConf:{authMethods:{apiKeyAuth:"pub04bd017317b60c96b62874179d82ff97"}},sendImmediate:n,ddtags:`env:${i.env},coalesceSoftwareVersion:${i.coalesceSoftwareVersion}`,ddsource:"nodejs",service:`${ULt}`},s=[];return s.push(new bPn(r,t)),s.push(new _za({id:"ddNode",options:o,level:r})),s};var Oza=r=>{j6a(r);let t=process.env.CONSOLE_JSON_LOGS==="true"?"json":"text",n=r==="CLI"||r==="cleanup";Kxa(We,(a,u)=>Tza(u,t,n));let i=Nqi()??"",o=DP?.version??"",s={service:r,category:"global",coalescesoftwareversion:o,hostname:(0,Iza.hostname)(),env:i};return U9i(s)};var uhu=_t(require("node:child_process")),chu=_t(require("node:fs")),Cde=_t(require("node:process"));var Rza,z8o=new WeakMap,qQ0=()=>{},zQ0=class Sce{constructor(t){this.subscribers=[],this.settlement=null,this[Rza]="Unpromise",t instanceof Promise?this.promise=t:this.promise=new Promise(t),this.promise.then(n=>{let{subscribers:i}=this;this.subscribers=null,this.settlement={status:"fulfilled",value:n},i?.forEach(({resolve:o})=>{o(n)})}).catch(n=>{let{subscribers:i}=this;this.subscribers=null,this.settlement={status:"rejected",reason:n},i?.forEach(({reject:o})=>{o(n)})})}subscribe(){let t,n,{settlement:i}=this;if(i===null){if(this.subscribers===null)throw new Error("Unpromise settled but still has subscribers");let o=FQ0();this.subscribers=QQ0(this.subscribers,o),t=o.promise,n=()=>{this.subscribers!==null&&(this.subscribers=jQ0(this.subscribers,o))}}else{let{status:o}=i;o==="fulfilled"?t=Promise.resolve(i.value):t=Promise.reject(i.reason),n=qQ0}return Object.assign(t,{unsubscribe:n})}then(t,n){let i=this.subscribe(),{unsubscribe:o}=i;return Object.assign(i.then(t,n),{unsubscribe:o})}catch(t){let n=this.subscribe(),{unsubscribe:i}=n;return Object.assign(n.catch(t),{unsubscribe:i})}finally(t){let n=this.subscribe(),{unsubscribe:i}=n;return Object.assign(n.finally(t),{unsubscribe:i})}static proxy(t){let n=Sce.getSubscribablePromise(t);return typeof n<"u"?n:Sce.createSubscribablePromise(t)}static createSubscribablePromise(t){let n=new Sce(t);return z8o.set(t,n),z8o.set(n,n),n}static getSubscribablePromise(t){return z8o.get(t)}static resolve(t){return Sce.proxy(t).subscribe()}static async any(t){let n=t.map(Sce.resolve);try{return await Promise.any(n)}finally{n.forEach(({unsubscribe:i})=>{i()})}}static async race(t){let n=t.map(Sce.resolve);try{return await Promise.race(n)}finally{n.forEach(({unsubscribe:i})=>{i()})}}static async raceSingletons(t){let n=t.map(i=>Sce.proxy(i).then(()=>[i]));try{return await Promise.race(n)}finally{for(let i of n)i.unsubscribe()}}};Rza=Symbol.toStringTag;var EPn=zQ0;function FQ0(){let r,t;return{promise:new Promise((n,i)=>{r=n,t=i}),resolve:r,reject:t}}function QQ0(r,t){return[...r,t]}function UQ0(r,t){return[...r.slice(0,t),...r.slice(t+1)]}function jQ0(r,t){let n=r.indexOf(t);return n!==-1?UQ0(r,n):r}var R_e=class extends et{};var TT=async(r,t,n)=>{let i=GQ0(r),o=i.promise.then(()=>{throw new R_e(t)});return await EPn.race([n,o]).finally(i.cancel)},GQ0=r=>{let t=aT(),n=setTimeout(t.resolve,r),i=()=>clearTimeout(n);return{promise:t.promise,cancel:i}};var rIb=global.setImmediate??setTimeout;var aIb=new Error("timeout while waiting for mutex to become available"),uIb=new Error("mutex already locked"),HQ0=new Error("request for lock canceled"),WQ0=function(r,t,n,i){function o(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function u(d){try{c(i.next(d))}catch(p){a(p)}}function l(d){try{c(i.throw(d))}catch(p){a(p)}}function c(d){d.done?s(d.value):o(d.value).then(u,l)}c((i=i.apply(r,t||[])).next())})},qx=class{constructor(t,n=HQ0){this._value=t,this._cancelError=n,this._weightedQueues=[],this._weightedWaiters=[]}acquire(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return new Promise((n,i)=>{this._weightedQueues[t-1]||(this._weightedQueues[t-1]=[]),this._weightedQueues[t-1].push({resolve:n,reject:i}),this._dispatch()})}runExclusive(t,n=1){return WQ0(this,void 0,void 0,function*(){let[i,o]=yield this.acquire(n);try{return yield t(i)}finally{o()}})}waitForUnlock(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return new Promise(n=>{this._weightedWaiters[t-1]||(this._weightedWaiters[t-1]=[]),this._weightedWaiters[t-1].push(n),this._dispatch()})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(t){this._value=t,this._dispatch()}release(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);this._value+=t,this._dispatch()}cancel(){this._weightedQueues.forEach(t=>t.forEach(n=>n.reject(this._cancelError))),this._weightedQueues=[]}_dispatch(){var t;for(let n=this._value;n>0;n--){let i=(t=this._weightedQueues[n-1])===null||t===void 0?void 0:t.shift();if(!i)continue;let o=this._value,s=n;this._value-=n,n=this._value+1,i.resolve([o,this._newReleaser(s)])}this._drainUnlockWaiters()}_newReleaser(t){let n=!1;return()=>{n||(n=!0,this.release(t))}}_drainUnlockWaiters(){for(let t=this._value;t>0;t--)this._weightedWaiters[t-1]&&(this._weightedWaiters[t-1].forEach(n=>n()),this._weightedWaiters[t-1]=[])}},VQ0=function(r,t,n,i){function o(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function u(d){try{c(i.next(d))}catch(p){a(p)}}function l(d){try{c(i.throw(d))}catch(p){a(p)}}function c(d){d.done?s(d.value):o(d.value).then(u,l)}c((i=i.apply(r,t||[])).next())})},yte=class{constructor(t){this._semaphore=new qx(1,t)}acquire(){return VQ0(this,void 0,void 0,function*(){let[,t]=yield this._semaphore.acquire();return t})}runExclusive(t){return this._semaphore.runExclusive(()=>t())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};var BG0=_t(Qza());var P0;(function(r){r.Root="root",r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype"})(P0||(P0={}));function Uza(r){return r.type===P0.Tag||r.type===P0.Script||r.type===P0.Style}var jza=P0.Root,Gza=P0.Text,Hza=P0.Directive,Wza=P0.Comment,Vza=P0.Script,Kza=P0.Style,Yza=P0.Tag,Jza=P0.CDATA,$za=P0.Doctype;var SPn=class{constructor(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}get parentNode(){return this.parent}set parentNode(t){this.parent=t}get previousSibling(){return this.prev}set previousSibling(t){this.prev=t}get nextSibling(){return this.next}set nextSibling(t){this.next=t}cloneNode(t=!1){return eFa(this,t)}},gdt=class extends SPn{constructor(t){super(),this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t}},v6e=class extends gdt{constructor(){super(...arguments),this.type=P0.Text}get nodeType(){return 3}},mdt=class extends gdt{constructor(){super(...arguments),this.type=P0.Comment}get nodeType(){return 8}},ydt=class extends gdt{constructor(t,n){super(n),this.name=t,this.type=P0.Directive}get nodeType(){return 1}},bdt=class extends SPn{constructor(t){super(),this.children=t}get firstChild(){var t;return(t=this.children[0])!==null&&t!==void 0?t:null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(t){this.children=t}},Edt=class extends bdt{constructor(){super(...arguments),this.type=P0.CDATA}get nodeType(){return 4}},T6e=class extends bdt{constructor(){super(...arguments),this.type=P0.Root}get nodeType(){return 9}},Cdt=class extends bdt{constructor(t,n,i=[],o=t==="script"?P0.Script:t==="style"?P0.Style:P0.Tag){super(i),this.name=t,this.attribs=n,this.type=o}get nodeType(){return 1}get tagName(){return this.name}set tagName(t){this.name=t}get attributes(){return Object.keys(this.attribs).map(t=>{var n,i;return{name:t,value:this.attribs[t],namespace:(n=this["x-attribsNamespace"])===null||n===void 0?void 0:n[t],prefix:(i=this["x-attribsPrefix"])===null||i===void 0?void 0:i[t]}})}};function bte(r){return Uza(r)}function Q8o(r){return r.type===P0.CDATA}function _Pn(r){return r.type===P0.Text}function U8o(r){return r.type===P0.Comment}function tU0(r){return r.type===P0.Directive}function Zza(r){return r.type===P0.Root}function eFa(r,t=!1){let n;if(_Pn(r))n=new v6e(r.data);else if(U8o(r))n=new mdt(r.data);else if(bte(r)){let i=t?F8o(r.children):[],o=new Cdt(r.name,{...r.attribs},i);i.forEach(s=>s.parent=o),r.namespace!=null&&(o.namespace=r.namespace),r["x-attribsNamespace"]&&(o["x-attribsNamespace"]={...r["x-attribsNamespace"]}),r["x-attribsPrefix"]&&(o["x-attribsPrefix"]={...r["x-attribsPrefix"]}),n=o}else if(Q8o(r)){let i=t?F8o(r.children):[],o=new Edt(i);i.forEach(s=>s.parent=o),n=o}else if(Zza(r)){let i=t?F8o(r.children):[],o=new T6e(i);i.forEach(s=>s.parent=o),r["x-mode"]&&(o["x-mode"]=r["x-mode"]),n=o}else if(tU0(r)){let i=new ydt(r.name,r.data);r["x-name"]!=null&&(i["x-name"]=r["x-name"],i["x-publicId"]=r["x-publicId"],i["x-systemId"]=r["x-systemId"]),n=i}else throw new Error(`Not implemented yet: ${r.type}`);return n.startIndex=r.startIndex,n.endIndex=r.endIndex,r.sourceCodeLocation!=null&&(n.sourceCodeLocation=r.sourceCodeLocation),n}function F8o(r){let t=r.map(n=>eFa(n,!0));for(let n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}var tFa={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},vPn=class{constructor(t,n,i){this.dom=[],this.root=new T6e(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof n=="function"&&(i=n,n=tFa),typeof t=="object"&&(n=t,t=void 0),this.callback=t??null,this.options=n??tFa,this.elementCB=i??null}onparserinit(t){this.parser=t}onreset(){this.dom=[],this.root=new T6e(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null}onend(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))}onerror(t){this.handleCallback(t)}onclosetag(){this.lastNode=null;let t=this.tagStack.pop();this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(t)}onopentag(t,n){let i=this.options.xmlMode?P0.Tag:void 0,o=new Cdt(t,n,void 0,i);this.addNode(o),this.tagStack.push(o)}ontext(t){let{lastNode:n}=this;if(n&&n.type===P0.Text)n.data+=t,this.options.withEndIndices&&(n.endIndex=this.parser.endIndex);else{let i=new v6e(t);this.addNode(i),this.lastNode=i}}oncomment(t){if(this.lastNode&&this.lastNode.type===P0.Comment){this.lastNode.data+=t;return}let n=new mdt(t);this.addNode(n),this.lastNode=n}oncommentend(){this.lastNode=null}oncdatastart(){let t=new v6e(""),n=new Edt([t]);this.addNode(n),t.parent=n,this.lastNode=t}oncdataend(){this.lastNode=null}onprocessinginstruction(t,n){let i=new ydt(t,n);this.addNode(i)}handleCallback(t){if(typeof this.callback=="function")this.callback(t,this.dom);else if(t)throw t}addNode(t){let n=this.tagStack[this.tagStack.length-1],i=n.children[n.children.length-1];this.options.withStartIndices&&(t.startIndex=this.parser.startIndex),this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),n.children.push(t),i&&(t.prev=i,i.next=t),t.parent=n,this.lastNode=null}};var rU0=/\n/g;function nU0(r){let t=[...r.matchAll(rU0)].map(i=>i.index||0);t.unshift(-1);let n=j8o(t,0,t.length);return i=>nFa(n,i)}function j8o(r,t,n){if(n-t==1)return{offset:r[t],index:t+1};let i=Math.ceil((t+n)/2),o=j8o(r,t,i),s=j8o(r,i,n);return{offset:o.offset,low:o,high:s}}function nFa(r,t){return function(n){return Object.prototype.hasOwnProperty.call(n,"index")}(r)?{line:r.index,column:t-r.offset}:nFa(r.high.offset<t?r.high:r.low,t)}function iFa(r,t="",n={}){let i=typeof t!="string"?t:n,o=typeof t=="string"?t:"",s=r.map(iU0),a=!!i.lineNumbers;return function(u,l=0){let c=a?nU0(u):()=>({line:0,column:0}),d=l,p=[];e:for(;d<u.length;){let f=!1;for(let A of s){A.regex.lastIndex=d;let g=A.regex.exec(u);if(g&&g[0].length>0){if(!A.discard){let b=c(d),_=typeof A.replace=="string"?g[0].replace(new RegExp(A.regex.source,A.regex.flags),A.replace):g[0];p.push({state:o,name:A.name,text:_,offset:d,len:g[0].length,line:b.line,column:b.column})}if(d=A.regex.lastIndex,f=!0,A.push){let b=A.push(u,d);p.push(...b.tokens),d=b.offset}if(A.pop)break e;break}}if(!f)break}return{tokens:p,offset:d,complete:u.length<=d}}}function iU0(r,t){return{...r,regex:oU0(r,t)}}function oU0(r,t){if(r.name.length===0)throw new Error(`Rule #${t} has empty name, which is not allowed.`);if(function(n){return Object.prototype.hasOwnProperty.call(n,"regex")}(r))return function(n){if(n.global)throw new Error(`Regular expression /${n.source}/${n.flags} contains the global flag, which is not allowed.`);return n.sticky?n:new RegExp(n.source,n.flags+"y")}(r.regex);if(function(n){return Object.prototype.hasOwnProperty.call(n,"str")}(r)){if(r.str.length===0)throw new Error(`Rule #${t} ("${r.name}") has empty "str" property, which is not allowed.`);return new RegExp(rFa(r.str),"y")}return new RegExp(rFa(r.name),"y")}function rFa(r){return r.replace(/[-[\]{}()*+!<=:?./\\^$|#\s,]/g,"\\$&")}function M_e(r,t){return(n,i)=>{let o=i,s;return i<n.tokens.length?(s=r(n.tokens[i],n,i),s!==void 0&&o++):t?.(n,i),s===void 0?{matched:!1}:{matched:!0,position:o,value:s}}}function G8o(r,t){return r.matched?{matched:!0,position:r.position,value:t(r.value,r.position)}:r}function TPn(r,t){return r.matched?t(r):r}function D3(r,t){return(n,i)=>G8o(r(n,i),(o,s)=>t(o,n,i,s))}function Sdt(r,t){return(n,i)=>{let o=r(n,i);return o.matched?o:{matched:!0,position:i,value:t}}}function IPn(...r){return(t,n)=>{for(let i of r){let o=i(t,n);if(o.matched)return o}return{matched:!1}}}function _ce(r,t){return(n,i)=>{let o=r(n,i);return o.matched?o:t(n,i)}}function sU0(r,t){return(n,i)=>{let o=[],s=!0;do{let a=r(n,i);a.matched&&t(a.value,o.length+1,n,i,a.position)?(o.push(a.value),i=a.position):s=!1}while(s);return{matched:!0,position:i,value:o}}}function H8o(r){return sU0(r,()=>!0)}function oFa(r){return x3(r,H8o(r),(t,n)=>[t,...n])}function x3(r,t,n){return(i,o)=>TPn(r(i,o),s=>G8o(t(i,s.position),(a,u)=>n(s.value,a,i,o,u)))}function sFa(r,t){return x3(r,t,n=>n)}function W8o(r,t){return x3(r,t,(n,i)=>i)}function OPn(r,t,n,i){return(o,s)=>TPn(r(o,s),a=>TPn(t(o,a.position),u=>G8o(n(o,u.position),(l,c)=>i(a.value,u.value,l,o,s,c))))}function V8o(r,t,n){return OPn(r,t,n,(i,o)=>o)}function aU0(...r){return(t,n)=>{let i=[],o=n;for(let s of r){let a=s(t,o);if(a.matched)i.push(a.value),o=a.position;else return{matched:!1}}return{matched:!0,position:o,value:i}}}function aFa(...r){return uU0(aU0(...r))}function uU0(r){return D3(r,t=>t.flatMap(n=>n))}function cU0(r,t){return(n,i)=>{let o=!0,s=r,a=i;do{let u=t(s,n,a)(n,a);u.matched?(s=u.value,a=u.position):o=!1}while(o);return{matched:!0,position:a,value:s}}}function lU0(r,t,n){return cU0(r,i=>D3(t,(o,s,a,u)=>n(i,o,s,a,u)))}function K8o(r,t,n){return dU0(r,i=>lU0(i,x3(t,n,(o,s)=>[o,s]),(o,[s,a])=>s(o,a)))}function dU0(r,t){return(n,i)=>TPn(r(n,i),o=>t(o.value,n,i,o.position)(n,o.position))}var fU0=iFa([{name:"ws",regex:/[ \t\r\n\f]+/},{name:"idn",regex:/[a-zA-Z_-][a-zA-Z0-9_-]*/},{name:"#id",regex:/#[a-zA-Z0-9_-]+/},{name:"str1",regex:/'(?:\\['\\]|[^\n'\\])*'/},{name:"str2",regex:/"(?:\\["\\]|[^\n"\\])*"/},{name:"*"},{name:"."},{name:","},{name:"["},{name:"]"},{name:"="},{name:">"},{name:"|"},{name:"+"},{name:"~"},{name:"^"},{name:"$"}]);function fFa([r,t,n],[i,o,s]){return[r+i,t+o,n+s]}function AU0(r){return r.reduce(fFa,[0,0,0])}function _1(r){return M_e(t=>t.name===r?!0:void 0)}var $8o=M_e(r=>r.name==="ws"?null:void 0),Y8o=Sdt($8o,null);function I6e(r){return V8o(Y8o,r,Y8o)}var vdt=M_e(r=>r.name==="idn"?r.text:void 0),hU0=M_e(r=>r.name==="#id"?r.text.slice(1):void 0),gU0=M_e(r=>r.name.startsWith("str")?r.text.slice(1,-1):void 0),AFa=sFa(Sdt(vdt,""),_1("|")),X8o=_ce(x3(AFa,vdt,(r,t)=>({name:t,namespace:r})),D3(vdt,r=>({name:r,namespace:null}))),mU0=_ce(x3(AFa,_1("*"),r=>({type:"universal",namespace:r,specificity:[0,0,0]})),D3(_1("*"),()=>({type:"universal",namespace:null,specificity:[0,0,0]}))),yU0=D3(X8o,({name:r,namespace:t})=>({type:"tag",name:r,namespace:t,specificity:[0,0,1]})),bU0=x3(_1("."),vdt,(r,t)=>({type:"class",name:t,specificity:[0,1,0]})),EU0=D3(hU0,r=>({type:"id",name:r,specificity:[1,0,0]})),uFa=M_e(r=>{if(r.name==="idn"){if(r.text==="i"||r.text==="I")return"i";if(r.text==="s"||r.text==="S")return"s"}}),CU0=_ce(x3(gU0,Sdt(W8o(Y8o,uFa),null),(r,t)=>({value:r,modifier:t})),x3(vdt,Sdt(W8o($8o,uFa),null),(r,t)=>({value:r,modifier:t}))),SU0=IPn(D3(_1("="),()=>"="),x3(_1("~"),_1("="),()=>"~="),x3(_1("|"),_1("="),()=>"|="),x3(_1("^"),_1("="),()=>"^="),x3(_1("$"),_1("="),()=>"$="),x3(_1("*"),_1("="),()=>"*=")),_U0=OPn(_1("["),I6e(X8o),_1("]"),(r,{name:t,namespace:n})=>({type:"attrPresence",name:t,namespace:n,specificity:[0,1,0]})),vU0=V8o(_1("["),OPn(I6e(X8o),SU0,I6e(CU0),({name:r,namespace:t},n,{value:i,modifier:o})=>({type:"attrValue",name:r,namespace:t,matcher:n,value:i,modifier:o,specificity:[0,1,0]})),_1("]")),TU0=_ce(_U0,vU0),IU0=_ce(mU0,yU0),cFa=IPn(EU0,bU0,TU0),lFa=D3(_ce(aFa(IU0,H8o(cFa)),oFa(cFa)),r=>({type:"compound",list:r,specificity:AU0(r.map(t=>t.specificity))})),OU0=IPn(D3(_1(">"),()=>">"),D3(_1("+"),()=>"+"),D3(_1("~"),()=>"~"),x3(_1("|"),_1("|"),()=>"||")),RU0=_ce(I6e(OU0),D3($8o,()=>" ")),J8o=K8o(lFa,D3(RU0,r=>(t,n)=>({type:"compound",list:[...n.list,{type:"combinator",combinator:r,left:t,specificity:t.specificity}],specificity:fFa(t.specificity,n.specificity)})),lFa),SIb=K8o(D3(J8o,r=>({type:"list",list:[r]})),D3(I6e(_1(",")),()=>(r,t)=>({type:"list",list:[...r.list,t]})),J8o);function MU0(r,t){let n=fU0(t);if(!n.complete)throw new Error(`The input "${t}" was only partially tokenized, stopped at offset ${n.offset}!
1950
+ total event time: `,s.toFixed(0),"ms")}},cT=class extends G9i{shouldAllowInTestEnv;constructor(t,n,i){super(t,n),this.shouldAllowInTestEnv=i??!1}log(t,n,...i){qf().isTest&&!this.shouldAllowInTestEnv||super.log(t,n,"PERF METRIC:",i)}logMetric(t,n,i){if(qf().isTest&&!this.shouldAllowInTestEnv)return;let o=i||performance.now()-this.start,s={name:t,"time-ms":Math.round(o),...n||{}};n?.warning?this.logger.warnContext(this.logContext??{},"PERF METRIC:",s):this.logger.infoContext(this.logContext??{},"PERF METRIC:",s)}logMetricWithMinDuration(t,n,i){if(qf().isTest&&!this.shouldAllowInTestEnv)return;let o=performance.now()-this.start;if(o<n)return;let s={name:t,"time-ms":Math.round(o),params:i};i?.warning?this.logger.warnContext(this.logContext??{},"PERF METRIC:",s):this.logger.infoContext(this.logContext??{},"PERF METRIC:",s)}};var Cct=_t(e8()),VJd=_t(XBe()),wMy=(0,Cct.Record)({version:Cct.String,hash:Cct.String}),KJd=()=>({version:"7.30.9",hash:"97b6c0291c0182e1b1cd865525be1686aaab116b"}),DP=KJd();var ULt,j6a=r=>{ULt=r},G6a=r=>({coalesceSoftwareVersion:DP?.version||"",service:r,env:process.env.REACT_APP_OWNER??"",reactAppCoalesceDev:process.env.REACT_APP_COALESCE_DEV??""}),Pqi=r=>r.includes("production")?"production":r.includes("staging")?"staging":r.includes("qa")?"qa":"development",Nqi=()=>{if(uT()){let r=process.env.RUNTIME_ENVIRONMENT||"development";return rxa("coa")?J6()?Pqi(r):void 0:Pqi(r)}else{let r;try{r=self.ENVIRONMENT}catch{}return typeof r=="string"?Pqi(r):void 0}};var yPn=_t(dza(),1),Cza=_t(L8o(),1),O_e=_t(require("process"),1),IQ0=Object.prototype.toString,OQ0=r=>IQ0.call(r)==="[object Error]",RQ0=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]);function MQ0(r){return r&&OQ0(r)&&r.name==="TypeError"&&typeof r.message=="string"?r.message==="Load failed"?r.stack===void 0:RQ0.has(r.message):!1}var wQ0=class extends Error{constructor(r){super(),r instanceof Error?(this.originalError=r,{message:r}=r):(this.originalError=new Error(r),this.originalError.stack=this.stack),this.name="AbortError",this.message=r}},gza=(r,t,n)=>{let i=n.retries-(t-1);return r.attemptNumber=t,r.retriesLeft=i,r};async function PQ0(r,t){return new Promise((n,i)=>{t={onFailedAttempt(){},retries:10,shouldRetry:()=>!0,...t};let o=Cza.default.operation(t),s=()=>{o.stop(),i(t.signal?.reason)};t.signal&&!t.signal.aborted&&t.signal.addEventListener("abort",s,{once:!0});let a=()=>{t.signal?.removeEventListener("abort",s),o.stop()};o.attempt(async u=>{try{let l=await r(u);a(),n(l)}catch(l){try{if(!(l instanceof Error))throw new TypeError(`Non-error was thrown: "${l}". You should only throw errors.`);if(l instanceof wQ0)throw l.originalError;if(l instanceof TypeError&&!MQ0(l))throw l;if(gza(l,u,t),await t.shouldRetry(l)||(o.stop(),i(l)),await t.onFailedAttempt(l),!o.retry(l))throw o.mainError()}catch(c){gza(c,u,t),a(),i(c)}}})})}var mPn=new Set,q8o=new Set,mza=!1,yza=!1;async function Adt(r,t,n){if(mza)return;mza=!0,mPn.size>0&&t&&console.error(["SYNCHRONOUS TERMINATION NOTICE:","When explicitly exiting the process via process.exit or via a parent process,","asynchronous tasks in your exitHooks will not run. Either remove these tasks,","use gracefulExit() instead of process.exit(), or ensure your parent process","sends a SIGINT to the process running this code."].join(" "));let i=128+n,o=(l=!1)=>{(l===!0||r===!0)&&O_e.default.exit(i)};for(let l of q8o)l(i);if(t){o();return}let s=[],a=0;for(let[l,c]of mPn)a=Math.max(a,c),s.push(Promise.resolve(l(i)));let u=setTimeout(()=>{o(!0)},a);await Promise.all(s),clearTimeout(u),o()}function NQ0(r){let{onExit:t,wait:n,isSynchronous:i}=r,o=[t,n];return i?q8o.add(t):mPn.add(o),yza||(yza=!0,O_e.default.once("beforeExit",Adt.bind(void 0,!0,!1,-128)),O_e.default.once("SIGINT",Adt.bind(void 0,!0,!1,2)),O_e.default.once("SIGTERM",Adt.bind(void 0,!0,!1,15)),O_e.default.once("exit",Adt.bind(void 0,!1,!0,0)),O_e.default.on("message",s=>{s==="shutdown"&&Adt(!0,!0,-128)})),()=>{i?q8o.delete(t):mPn.delete(o)}}function DQ0(r){if(typeof r!="function")throw new TypeError("onExit must be a function");return NQ0({onExit:r,isSynchronous:!0})}function xQ0(){return`${Date.now()}_${Math.floor(Math.random()*1e3)}`}var BQ0=class{currentBucket;logBucket;constructor(){this.logBucket={},this.newLogBucket()}newLogBucket(){this.currentBucket&&delete this.logBucket[this.currentBucket],this.currentBucket=xQ0(),this.logBucket[this.currentBucket]={size:0,logItems:[]}}getLogBucketByteSize(){return this.logBucket[this.currentBucket].size}getLogCount(){return this.logBucket[this.currentBucket].logItems.length}finishLogBatch(){let r=this.logBucket[this.currentBucket].logItems;return this.newLogBucket(),r}addLog(r,t){this.logBucket[this.currentBucket].size+=t,this.logBucket[this.currentBucket].logItems.push(r)}},kQ0=5138022,bza=996147,Eza=3e3,LQ0=995,Sza=class{logStorage;timer=null;apiInstance;config;constructor(r){this.logStorage=new BQ0,this.config=r,r.onInit&&r.onInit();let t=yPn.client.createConfiguration(r.ddClientConf);t.setServerVariables(r?.ddServerConf||{}),this.apiInstance=new yPn.v2.LogsApi(t),this.setupRegularSend(),this.setupExitHook()}sendLogs({logsToSend:r,bucketName:t}){PQ0(async()=>{let n={body:r,contentEncoding:"gzip"},i=await this.apiInstance.submitLog(n);return this.config.onDebug&&this.config.onDebug(`(${t}) Sending ${r.length} logs to Datadog completed`),i},{retries:this.config.retries??5}).catch(n=>{this.config.onError&&this.config.onError(n,r)})}setupRegularSend(){this.config.sendImmediate||(this.config.onDebug&&this.config.onDebug(`Configured to send logs every ${this.config.sendIntervalMs||Eza}ms`),this.timer=setInterval(()=>{let r=this.logStorage.getLogCount(),t=this.logStorage.currentBucket;r>0&&(this.config.onDebug&&this.config.onDebug(`(${t}) Sending ${r} logs to Datadog on timer`),this.sendLogs({logsToSend:this.logStorage.finishLogBatch(),bucketName:t}))},this.config.sendIntervalMs||Eza))}setupExitHook(){this.config.sendImmediate||(this.config.onDebug&&this.config.onDebug("Configuring exit hook"),DQ0(()=>{if(this.logStorage.getLogCount()>0){this.config.onDebug&&this.config.onDebug("Shutdown detected. Attempting to send remaining logs to Datadog"),this.timer&&clearInterval(this.timer);let r=this.logStorage.currentBucket;this.sendLogs({logsToSend:this.logStorage.finishLogBatch(),bucketName:r})}}))}processLog(r){let t={message:JSON.stringify(r)};this.config.ddsource&&(t.ddsource=this.config.ddsource),this.config.ddtags&&(t.ddtags=this.config.ddtags),this.config.service&&(t.service=this.config.service);let n=t.message.length+(t.ddsource?.length||0)+(t.ddtags?.length||0)+(t.hostname?.length||0)+(t.service?.length||0);if(n>bza&&this.config.onError&&this.config.onError(new Error(`Log entry exceeds size limit of ${bza} bytes: ${n}`),[t]),this.config.sendImmediate){this.config.onDebug&&this.config.onDebug("(send-immediate) Sending log to Datadog"),this.sendLogs({logsToSend:[t],bucketName:"send-immediate"});return}this.logStorage.addLog(t,n);let i=this.logStorage.getLogCount();if(this.logStorage.getLogBucketByteSize()>kQ0||i>LQ0){let s=this.logStorage.currentBucket;this.config.onDebug&&this.config.onDebug(`(${s}) Sending ${i} logs to Datadog`),this.sendLogs({logsToSend:this.logStorage.finishLogBatch(),bucketName:s})}}};var _za=class extends X8t{messageField;levelField;timestampField;timestampFunction;transport;constructor(r){super(r),this.enabled&&(this.transport=new Sza(r.options),this.messageField=r.messageField??"message",this.levelField=r.levelField??"level",this.timestampField=r.timestampField??"time",this.timestampFunction=r.timestampFunction)}shipToLogger({logLevel:r,messages:t,data:n,hasData:i}){let o={};if(!this.transport)throw new Error("DataDogTransport was previously disabled; enabling the flag manually on the transport instance is not supported.");return n&&i&&Object.assign(o,n),this.timestampFunction?o[this.timestampField]=this.timestampFunction():o[this.timestampField]=new Date().toISOString(),o[this.levelField]=r,o[this.messageField]=t.join(" "),this.transport.processLog(o),t}};var vza=require("node:os");var bPn=class extends qBe{consoleLog(t){process.stdout.write(`${t}${vza.EOL}`)}};var Tza=(r,t,n=!1)=>{let i=G6a(ULt),o={ddClientConf:{authMethods:{apiKeyAuth:"pub04bd017317b60c96b62874179d82ff97"}},sendImmediate:n,ddtags:`env:${i.env},coalesceSoftwareVersion:${i.coalesceSoftwareVersion}`,ddsource:"nodejs",service:`${ULt}`},s=[];return s.push(new bPn(r,t)),s.push(new _za({id:"ddNode",options:o,level:r})),s};var Oza=r=>{j6a(r);let t=process.env.CONSOLE_JSON_LOGS==="true"?"json":"text",n=r==="CLI"||r==="cleanup";Kxa(We,(a,u)=>Tza(u,t,n));let i=Nqi()??"",o=DP?.version??"",s={service:r,category:"global",coalescesoftwareversion:o,hostname:(0,Iza.hostname)(),env:i};return U9i(s)};var uhu=_t(require("node:child_process")),chu=_t(require("node:fs")),Cde=_t(require("node:process"));var Rza,z8o=new WeakMap,qQ0=()=>{},zQ0=class Sce{constructor(t){this.subscribers=[],this.settlement=null,this[Rza]="Unpromise",t instanceof Promise?this.promise=t:this.promise=new Promise(t),this.promise.then(n=>{let{subscribers:i}=this;this.subscribers=null,this.settlement={status:"fulfilled",value:n},i?.forEach(({resolve:o})=>{o(n)})}).catch(n=>{let{subscribers:i}=this;this.subscribers=null,this.settlement={status:"rejected",reason:n},i?.forEach(({reject:o})=>{o(n)})})}subscribe(){let t,n,{settlement:i}=this;if(i===null){if(this.subscribers===null)throw new Error("Unpromise settled but still has subscribers");let o=FQ0();this.subscribers=QQ0(this.subscribers,o),t=o.promise,n=()=>{this.subscribers!==null&&(this.subscribers=jQ0(this.subscribers,o))}}else{let{status:o}=i;o==="fulfilled"?t=Promise.resolve(i.value):t=Promise.reject(i.reason),n=qQ0}return Object.assign(t,{unsubscribe:n})}then(t,n){let i=this.subscribe(),{unsubscribe:o}=i;return Object.assign(i.then(t,n),{unsubscribe:o})}catch(t){let n=this.subscribe(),{unsubscribe:i}=n;return Object.assign(n.catch(t),{unsubscribe:i})}finally(t){let n=this.subscribe(),{unsubscribe:i}=n;return Object.assign(n.finally(t),{unsubscribe:i})}static proxy(t){let n=Sce.getSubscribablePromise(t);return typeof n<"u"?n:Sce.createSubscribablePromise(t)}static createSubscribablePromise(t){let n=new Sce(t);return z8o.set(t,n),z8o.set(n,n),n}static getSubscribablePromise(t){return z8o.get(t)}static resolve(t){return Sce.proxy(t).subscribe()}static async any(t){let n=t.map(Sce.resolve);try{return await Promise.any(n)}finally{n.forEach(({unsubscribe:i})=>{i()})}}static async race(t){let n=t.map(Sce.resolve);try{return await Promise.race(n)}finally{n.forEach(({unsubscribe:i})=>{i()})}}static async raceSingletons(t){let n=t.map(i=>Sce.proxy(i).then(()=>[i]));try{return await Promise.race(n)}finally{for(let i of n)i.unsubscribe()}}};Rza=Symbol.toStringTag;var EPn=zQ0;function FQ0(){let r,t;return{promise:new Promise((n,i)=>{r=n,t=i}),resolve:r,reject:t}}function QQ0(r,t){return[...r,t]}function UQ0(r,t){return[...r.slice(0,t),...r.slice(t+1)]}function jQ0(r,t){let n=r.indexOf(t);return n!==-1?UQ0(r,n):r}var R_e=class extends et{};var TT=async(r,t,n)=>{let i=GQ0(r),o=i.promise.then(()=>{throw new R_e(t)});return await EPn.race([n,o]).finally(i.cancel)},GQ0=r=>{let t=aT(),n=setTimeout(t.resolve,r),i=()=>clearTimeout(n);return{promise:t.promise,cancel:i}};var rIb=global.setImmediate??setTimeout;var aIb=new Error("timeout while waiting for mutex to become available"),uIb=new Error("mutex already locked"),HQ0=new Error("request for lock canceled"),WQ0=function(r,t,n,i){function o(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function u(d){try{c(i.next(d))}catch(p){a(p)}}function l(d){try{c(i.throw(d))}catch(p){a(p)}}function c(d){d.done?s(d.value):o(d.value).then(u,l)}c((i=i.apply(r,t||[])).next())})},qx=class{constructor(t,n=HQ0){this._value=t,this._cancelError=n,this._weightedQueues=[],this._weightedWaiters=[]}acquire(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return new Promise((n,i)=>{this._weightedQueues[t-1]||(this._weightedQueues[t-1]=[]),this._weightedQueues[t-1].push({resolve:n,reject:i}),this._dispatch()})}runExclusive(t,n=1){return WQ0(this,void 0,void 0,function*(){let[i,o]=yield this.acquire(n);try{return yield t(i)}finally{o()}})}waitForUnlock(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return new Promise(n=>{this._weightedWaiters[t-1]||(this._weightedWaiters[t-1]=[]),this._weightedWaiters[t-1].push(n),this._dispatch()})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(t){this._value=t,this._dispatch()}release(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);this._value+=t,this._dispatch()}cancel(){this._weightedQueues.forEach(t=>t.forEach(n=>n.reject(this._cancelError))),this._weightedQueues=[]}_dispatch(){var t;for(let n=this._value;n>0;n--){let i=(t=this._weightedQueues[n-1])===null||t===void 0?void 0:t.shift();if(!i)continue;let o=this._value,s=n;this._value-=n,n=this._value+1,i.resolve([o,this._newReleaser(s)])}this._drainUnlockWaiters()}_newReleaser(t){let n=!1;return()=>{n||(n=!0,this.release(t))}}_drainUnlockWaiters(){for(let t=this._value;t>0;t--)this._weightedWaiters[t-1]&&(this._weightedWaiters[t-1].forEach(n=>n()),this._weightedWaiters[t-1]=[])}},VQ0=function(r,t,n,i){function o(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function u(d){try{c(i.next(d))}catch(p){a(p)}}function l(d){try{c(i.throw(d))}catch(p){a(p)}}function c(d){d.done?s(d.value):o(d.value).then(u,l)}c((i=i.apply(r,t||[])).next())})},yte=class{constructor(t){this._semaphore=new qx(1,t)}acquire(){return VQ0(this,void 0,void 0,function*(){let[,t]=yield this._semaphore.acquire();return t})}runExclusive(t){return this._semaphore.runExclusive(()=>t())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};var BG0=_t(Qza());var P0;(function(r){r.Root="root",r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype"})(P0||(P0={}));function Uza(r){return r.type===P0.Tag||r.type===P0.Script||r.type===P0.Style}var jza=P0.Root,Gza=P0.Text,Hza=P0.Directive,Wza=P0.Comment,Vza=P0.Script,Kza=P0.Style,Yza=P0.Tag,Jza=P0.CDATA,$za=P0.Doctype;var SPn=class{constructor(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}get parentNode(){return this.parent}set parentNode(t){this.parent=t}get previousSibling(){return this.prev}set previousSibling(t){this.prev=t}get nextSibling(){return this.next}set nextSibling(t){this.next=t}cloneNode(t=!1){return eFa(this,t)}},gdt=class extends SPn{constructor(t){super(),this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t}},v6e=class extends gdt{constructor(){super(...arguments),this.type=P0.Text}get nodeType(){return 3}},mdt=class extends gdt{constructor(){super(...arguments),this.type=P0.Comment}get nodeType(){return 8}},ydt=class extends gdt{constructor(t,n){super(n),this.name=t,this.type=P0.Directive}get nodeType(){return 1}},bdt=class extends SPn{constructor(t){super(),this.children=t}get firstChild(){var t;return(t=this.children[0])!==null&&t!==void 0?t:null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(t){this.children=t}},Edt=class extends bdt{constructor(){super(...arguments),this.type=P0.CDATA}get nodeType(){return 4}},T6e=class extends bdt{constructor(){super(...arguments),this.type=P0.Root}get nodeType(){return 9}},Cdt=class extends bdt{constructor(t,n,i=[],o=t==="script"?P0.Script:t==="style"?P0.Style:P0.Tag){super(i),this.name=t,this.attribs=n,this.type=o}get nodeType(){return 1}get tagName(){return this.name}set tagName(t){this.name=t}get attributes(){return Object.keys(this.attribs).map(t=>{var n,i;return{name:t,value:this.attribs[t],namespace:(n=this["x-attribsNamespace"])===null||n===void 0?void 0:n[t],prefix:(i=this["x-attribsPrefix"])===null||i===void 0?void 0:i[t]}})}};function bte(r){return Uza(r)}function Q8o(r){return r.type===P0.CDATA}function _Pn(r){return r.type===P0.Text}function U8o(r){return r.type===P0.Comment}function tU0(r){return r.type===P0.Directive}function Zza(r){return r.type===P0.Root}function eFa(r,t=!1){let n;if(_Pn(r))n=new v6e(r.data);else if(U8o(r))n=new mdt(r.data);else if(bte(r)){let i=t?F8o(r.children):[],o=new Cdt(r.name,{...r.attribs},i);i.forEach(s=>s.parent=o),r.namespace!=null&&(o.namespace=r.namespace),r["x-attribsNamespace"]&&(o["x-attribsNamespace"]={...r["x-attribsNamespace"]}),r["x-attribsPrefix"]&&(o["x-attribsPrefix"]={...r["x-attribsPrefix"]}),n=o}else if(Q8o(r)){let i=t?F8o(r.children):[],o=new Edt(i);i.forEach(s=>s.parent=o),n=o}else if(Zza(r)){let i=t?F8o(r.children):[],o=new T6e(i);i.forEach(s=>s.parent=o),r["x-mode"]&&(o["x-mode"]=r["x-mode"]),n=o}else if(tU0(r)){let i=new ydt(r.name,r.data);r["x-name"]!=null&&(i["x-name"]=r["x-name"],i["x-publicId"]=r["x-publicId"],i["x-systemId"]=r["x-systemId"]),n=i}else throw new Error(`Not implemented yet: ${r.type}`);return n.startIndex=r.startIndex,n.endIndex=r.endIndex,r.sourceCodeLocation!=null&&(n.sourceCodeLocation=r.sourceCodeLocation),n}function F8o(r){let t=r.map(n=>eFa(n,!0));for(let n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}var tFa={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},vPn=class{constructor(t,n,i){this.dom=[],this.root=new T6e(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof n=="function"&&(i=n,n=tFa),typeof t=="object"&&(n=t,t=void 0),this.callback=t??null,this.options=n??tFa,this.elementCB=i??null}onparserinit(t){this.parser=t}onreset(){this.dom=[],this.root=new T6e(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null}onend(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))}onerror(t){this.handleCallback(t)}onclosetag(){this.lastNode=null;let t=this.tagStack.pop();this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(t)}onopentag(t,n){let i=this.options.xmlMode?P0.Tag:void 0,o=new Cdt(t,n,void 0,i);this.addNode(o),this.tagStack.push(o)}ontext(t){let{lastNode:n}=this;if(n&&n.type===P0.Text)n.data+=t,this.options.withEndIndices&&(n.endIndex=this.parser.endIndex);else{let i=new v6e(t);this.addNode(i),this.lastNode=i}}oncomment(t){if(this.lastNode&&this.lastNode.type===P0.Comment){this.lastNode.data+=t;return}let n=new mdt(t);this.addNode(n),this.lastNode=n}oncommentend(){this.lastNode=null}oncdatastart(){let t=new v6e(""),n=new Edt([t]);this.addNode(n),t.parent=n,this.lastNode=t}oncdataend(){this.lastNode=null}onprocessinginstruction(t,n){let i=new ydt(t,n);this.addNode(i)}handleCallback(t){if(typeof this.callback=="function")this.callback(t,this.dom);else if(t)throw t}addNode(t){let n=this.tagStack[this.tagStack.length-1],i=n.children[n.children.length-1];this.options.withStartIndices&&(t.startIndex=this.parser.startIndex),this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),n.children.push(t),i&&(t.prev=i,i.next=t),t.parent=n,this.lastNode=null}};var rU0=/\n/g;function nU0(r){let t=[...r.matchAll(rU0)].map(i=>i.index||0);t.unshift(-1);let n=j8o(t,0,t.length);return i=>nFa(n,i)}function j8o(r,t,n){if(n-t==1)return{offset:r[t],index:t+1};let i=Math.ceil((t+n)/2),o=j8o(r,t,i),s=j8o(r,i,n);return{offset:o.offset,low:o,high:s}}function nFa(r,t){return function(n){return Object.prototype.hasOwnProperty.call(n,"index")}(r)?{line:r.index,column:t-r.offset}:nFa(r.high.offset<t?r.high:r.low,t)}function iFa(r,t="",n={}){let i=typeof t!="string"?t:n,o=typeof t=="string"?t:"",s=r.map(iU0),a=!!i.lineNumbers;return function(u,l=0){let c=a?nU0(u):()=>({line:0,column:0}),d=l,p=[];e:for(;d<u.length;){let f=!1;for(let A of s){A.regex.lastIndex=d;let g=A.regex.exec(u);if(g&&g[0].length>0){if(!A.discard){let b=c(d),_=typeof A.replace=="string"?g[0].replace(new RegExp(A.regex.source,A.regex.flags),A.replace):g[0];p.push({state:o,name:A.name,text:_,offset:d,len:g[0].length,line:b.line,column:b.column})}if(d=A.regex.lastIndex,f=!0,A.push){let b=A.push(u,d);p.push(...b.tokens),d=b.offset}if(A.pop)break e;break}}if(!f)break}return{tokens:p,offset:d,complete:u.length<=d}}}function iU0(r,t){return{...r,regex:oU0(r,t)}}function oU0(r,t){if(r.name.length===0)throw new Error(`Rule #${t} has empty name, which is not allowed.`);if(function(n){return Object.prototype.hasOwnProperty.call(n,"regex")}(r))return function(n){if(n.global)throw new Error(`Regular expression /${n.source}/${n.flags} contains the global flag, which is not allowed.`);return n.sticky?n:new RegExp(n.source,n.flags+"y")}(r.regex);if(function(n){return Object.prototype.hasOwnProperty.call(n,"str")}(r)){if(r.str.length===0)throw new Error(`Rule #${t} ("${r.name}") has empty "str" property, which is not allowed.`);return new RegExp(rFa(r.str),"y")}return new RegExp(rFa(r.name),"y")}function rFa(r){return r.replace(/[-[\]{}()*+!<=:?./\\^$|#\s,]/g,"\\$&")}function M_e(r,t){return(n,i)=>{let o=i,s;return i<n.tokens.length?(s=r(n.tokens[i],n,i),s!==void 0&&o++):t?.(n,i),s===void 0?{matched:!1}:{matched:!0,position:o,value:s}}}function G8o(r,t){return r.matched?{matched:!0,position:r.position,value:t(r.value,r.position)}:r}function TPn(r,t){return r.matched?t(r):r}function D3(r,t){return(n,i)=>G8o(r(n,i),(o,s)=>t(o,n,i,s))}function Sdt(r,t){return(n,i)=>{let o=r(n,i);return o.matched?o:{matched:!0,position:i,value:t}}}function IPn(...r){return(t,n)=>{for(let i of r){let o=i(t,n);if(o.matched)return o}return{matched:!1}}}function _ce(r,t){return(n,i)=>{let o=r(n,i);return o.matched?o:t(n,i)}}function sU0(r,t){return(n,i)=>{let o=[],s=!0;do{let a=r(n,i);a.matched&&t(a.value,o.length+1,n,i,a.position)?(o.push(a.value),i=a.position):s=!1}while(s);return{matched:!0,position:i,value:o}}}function H8o(r){return sU0(r,()=>!0)}function oFa(r){return x3(r,H8o(r),(t,n)=>[t,...n])}function x3(r,t,n){return(i,o)=>TPn(r(i,o),s=>G8o(t(i,s.position),(a,u)=>n(s.value,a,i,o,u)))}function sFa(r,t){return x3(r,t,n=>n)}function W8o(r,t){return x3(r,t,(n,i)=>i)}function OPn(r,t,n,i){return(o,s)=>TPn(r(o,s),a=>TPn(t(o,a.position),u=>G8o(n(o,u.position),(l,c)=>i(a.value,u.value,l,o,s,c))))}function V8o(r,t,n){return OPn(r,t,n,(i,o)=>o)}function aU0(...r){return(t,n)=>{let i=[],o=n;for(let s of r){let a=s(t,o);if(a.matched)i.push(a.value),o=a.position;else return{matched:!1}}return{matched:!0,position:o,value:i}}}function aFa(...r){return uU0(aU0(...r))}function uU0(r){return D3(r,t=>t.flatMap(n=>n))}function cU0(r,t){return(n,i)=>{let o=!0,s=r,a=i;do{let u=t(s,n,a)(n,a);u.matched?(s=u.value,a=u.position):o=!1}while(o);return{matched:!0,position:a,value:s}}}function lU0(r,t,n){return cU0(r,i=>D3(t,(o,s,a,u)=>n(i,o,s,a,u)))}function K8o(r,t,n){return dU0(r,i=>lU0(i,x3(t,n,(o,s)=>[o,s]),(o,[s,a])=>s(o,a)))}function dU0(r,t){return(n,i)=>TPn(r(n,i),o=>t(o.value,n,i,o.position)(n,o.position))}var fU0=iFa([{name:"ws",regex:/[ \t\r\n\f]+/},{name:"idn",regex:/[a-zA-Z_-][a-zA-Z0-9_-]*/},{name:"#id",regex:/#[a-zA-Z0-9_-]+/},{name:"str1",regex:/'(?:\\['\\]|[^\n'\\])*'/},{name:"str2",regex:/"(?:\\["\\]|[^\n"\\])*"/},{name:"*"},{name:"."},{name:","},{name:"["},{name:"]"},{name:"="},{name:">"},{name:"|"},{name:"+"},{name:"~"},{name:"^"},{name:"$"}]);function fFa([r,t,n],[i,o,s]){return[r+i,t+o,n+s]}function AU0(r){return r.reduce(fFa,[0,0,0])}function _1(r){return M_e(t=>t.name===r?!0:void 0)}var $8o=M_e(r=>r.name==="ws"?null:void 0),Y8o=Sdt($8o,null);function I6e(r){return V8o(Y8o,r,Y8o)}var vdt=M_e(r=>r.name==="idn"?r.text:void 0),hU0=M_e(r=>r.name==="#id"?r.text.slice(1):void 0),gU0=M_e(r=>r.name.startsWith("str")?r.text.slice(1,-1):void 0),AFa=sFa(Sdt(vdt,""),_1("|")),X8o=_ce(x3(AFa,vdt,(r,t)=>({name:t,namespace:r})),D3(vdt,r=>({name:r,namespace:null}))),mU0=_ce(x3(AFa,_1("*"),r=>({type:"universal",namespace:r,specificity:[0,0,0]})),D3(_1("*"),()=>({type:"universal",namespace:null,specificity:[0,0,0]}))),yU0=D3(X8o,({name:r,namespace:t})=>({type:"tag",name:r,namespace:t,specificity:[0,0,1]})),bU0=x3(_1("."),vdt,(r,t)=>({type:"class",name:t,specificity:[0,1,0]})),EU0=D3(hU0,r=>({type:"id",name:r,specificity:[1,0,0]})),uFa=M_e(r=>{if(r.name==="idn"){if(r.text==="i"||r.text==="I")return"i";if(r.text==="s"||r.text==="S")return"s"}}),CU0=_ce(x3(gU0,Sdt(W8o(Y8o,uFa),null),(r,t)=>({value:r,modifier:t})),x3(vdt,Sdt(W8o($8o,uFa),null),(r,t)=>({value:r,modifier:t}))),SU0=IPn(D3(_1("="),()=>"="),x3(_1("~"),_1("="),()=>"~="),x3(_1("|"),_1("="),()=>"|="),x3(_1("^"),_1("="),()=>"^="),x3(_1("$"),_1("="),()=>"$="),x3(_1("*"),_1("="),()=>"*=")),_U0=OPn(_1("["),I6e(X8o),_1("]"),(r,{name:t,namespace:n})=>({type:"attrPresence",name:t,namespace:n,specificity:[0,1,0]})),vU0=V8o(_1("["),OPn(I6e(X8o),SU0,I6e(CU0),({name:r,namespace:t},n,{value:i,modifier:o})=>({type:"attrValue",name:r,namespace:t,matcher:n,value:i,modifier:o,specificity:[0,1,0]})),_1("]")),TU0=_ce(_U0,vU0),IU0=_ce(mU0,yU0),cFa=IPn(EU0,bU0,TU0),lFa=D3(_ce(aFa(IU0,H8o(cFa)),oFa(cFa)),r=>({type:"compound",list:r,specificity:AU0(r.map(t=>t.specificity))})),OU0=IPn(D3(_1(">"),()=>">"),D3(_1("+"),()=>"+"),D3(_1("~"),()=>"~"),x3(_1("|"),_1("|"),()=>"||")),RU0=_ce(I6e(OU0),D3($8o,()=>" ")),J8o=K8o(lFa,D3(RU0,r=>(t,n)=>({type:"compound",list:[...n.list,{type:"combinator",combinator:r,left:t,specificity:t.specificity}],specificity:fFa(t.specificity,n.specificity)})),lFa),SIb=K8o(D3(J8o,r=>({type:"list",list:[r]})),D3(I6e(_1(",")),()=>(r,t)=>({type:"list",list:[...r.list,t]})),J8o);function MU0(r,t){let n=fU0(t);if(!n.complete)throw new Error(`The input "${t}" was only partially tokenized, stopped at offset ${n.offset}!
1951
1951
  `+dFa(t,n.offset));let i=I6e(r)({tokens:n.tokens,options:void 0},0);if(!i.matched)throw new Error(`No match for "${t}" input!`);if(i.position<n.tokens.length){let o=n.tokens[i.position];throw new Error(`The input "${t}" was only partially parsed, stopped at offset ${o.offset}!
1952
1952
  `+dFa(t,o.offset,o.len))}return i.value}function dFa(r,t,n=1){return`${r.replace(/(\t)|(\r)|(\n)/g,(i,o,s)=>o?"\u2409":s?"\u240D":"\u240A")}
1953
1953
  ${"".padEnd(t)}${"^".repeat(n)}`}function hFa(r){return MU0(J8o,r)}function X7(r){if(!r.type)throw new Error("This is not an AST node.");switch(r.type){case"universal":return RPn(r.namespace)+"*";case"tag":return RPn(r.namespace)+r.name;case"class":return"."+r.name;case"id":return"#"+r.name;case"attrPresence":return`[${RPn(r.namespace)}${r.name}]`;case"attrValue":return`[${RPn(r.namespace)}${r.name}${r.matcher}${wU0(r.value)}${r.modifier?r.modifier:""}]`;case"combinator":return X7(r.left)+r.combinator;case"compound":return r.list.reduce((t,n)=>n.type==="combinator"?X7(n)+t:t+X7(n),"");case"list":return r.list.map(X7).join(",")}}function RPn(r){return r||r===""?r+"|":""}function wU0(r){return r.indexOf('"')===-1?`"${r}"`:r.indexOf("'")===-1?`'${r}'`:`"${r.replace('"','\\"')}"`}function _dt(r){if(!r.type)throw new Error("This is not an AST node.");switch(r.type){case"compound":{r.list.forEach(_dt),r.list.sort((t,n)=>gFa(pFa(t),pFa(n)));break}case"combinator":{_dt(r.left);break}case"list":{r.list.forEach(_dt),r.list.sort((t,n)=>X7(t)<X7(n)?-1:1);break}}return r}function pFa(r){switch(r.type){case"universal":return[1];case"tag":return[1];case"id":return[2];case"class":return[3,r.name];case"attrPresence":return[4,X7(r)];case"attrValue":return[5,X7(r)];case"combinator":return[15,X7(r)]}}function Z8o(r,t){return gFa(r,t)}function gFa(r,t){if(!Array.isArray(r)||!Array.isArray(t))throw new Error("Arguments must be arrays.");let n=r.length<t.length?r.length:t.length;for(let i=0;i<n;i++)if(r[i]!==t[i])return r[i]<t[i]?-1:1;return r.length-t.length}var Tdt=class{constructor(t){this.branches=O6e(NU0(t))}build(t){return t(this.branches)}};function NU0(r){let t=r.length,n=new Array(t);for(let i=0;i<t;i++){let[o,s]=r[i],a=DU0(hFa(o));n[i]={ast:a,terminal:{type:"terminal",valueContainer:{index:i,value:s,specificity:a.specificity}}}}return n}function DU0(r){return yFa(r),_dt(r),r}function yFa(r){let t=[];r.list.forEach(n=>{switch(n.type){case"class":t.push({matcher:"~=",modifier:null,name:"class",namespace:null,specificity:n.specificity,type:"attrValue",value:n.name});break;case"id":t.push({matcher:"=",modifier:null,name:"id",namespace:null,specificity:n.specificity,type:"attrValue",value:n.name});break;case"combinator":yFa(n.left),t.push(n);break;case"universal":break;default:t.push(n);break}}),r.list=t}function O6e(r){let t=[];for(;r.length;){let n=CFa(r,a=>!0,bFa),{matches:i,nonmatches:o,empty:s}=BU0(r,n);r=o,i.length&&t.push(kU0(n,i)),s.length&&t.push(...xU0(s))}return t}function xU0(r){let t=[];for(let n of r){let i=n.terminal;if(i.type==="terminal")t.push(i);else{let{matches:o,rest:s}=QU0(i.cont,a=>a.type==="terminal");o.forEach(a=>t.push(a)),s.length&&(i.cont=s,t.push(i))}}return t}function BU0(r,t){let n=[],i=[],o=[];for(let s of r){let a=s.ast.list;a.length?(a.some(l=>bFa(l)===t)?n:i).push(s):o.push(s)}return{matches:n,nonmatches:i,empty:o}}function bFa(r){switch(r.type){case"attrPresence":return`attrPresence ${r.name}`;case"attrValue":return`attrValue ${r.name}`;case"combinator":return`combinator ${r.combinator}`;default:return r.type}}function kU0(r,t){if(r==="tag")return LU0(t);if(r.startsWith("attrValue "))return zU0(r.substring(10),t);if(r.startsWith("attrPresence "))return qU0(r.substring(13),t);if(r==="combinator >")return mFa(">",t);if(r==="combinator +")return mFa("+",t);throw new Error(`Unsupported selector kind: ${r}`)}function LU0(r){let t=eko(r,i=>i.type==="tag",i=>i.name);return{type:"tagName",variants:Object.entries(t).map(([i,o])=>({type:"variant",value:i,cont:O6e(o.items)}))}}function qU0(r,t){for(let n of t)EFa(n,i=>i.type==="attrPresence"&&i.name===r);return{type:"attrPresence",name:r,cont:O6e(t)}}function zU0(r,t){let n=eko(t,o=>o.type==="attrValue"&&o.name===r,o=>`${o.matcher} ${o.modifier||""} ${o.value}`),i=[];for(let o of Object.values(n)){let s=o.oneSimpleSelector,a=FU0(s),u=O6e(o.items);i.push({type:"matcher",matcher:s.matcher,modifier:s.modifier,value:s.value,predicate:a,cont:u})}return{type:"attrValue",name:r,matchers:i}}function FU0(r){if(r.modifier==="i"){let t=r.value.toLowerCase();switch(r.matcher){case"=":return n=>t===n.toLowerCase();case"~=":return n=>n.toLowerCase().split(/[ \t]+/).includes(t);case"^=":return n=>n.toLowerCase().startsWith(t);case"$=":return n=>n.toLowerCase().endsWith(t);case"*=":return n=>n.toLowerCase().includes(t);case"|=":return n=>{let i=n.toLowerCase();return t===i||i.startsWith(t)&&i[t.length]==="-"}}}else{let t=r.value;switch(r.matcher){case"=":return n=>t===n;case"~=":return n=>n.split(/[ \t]+/).includes(t);case"^=":return n=>n.startsWith(t);case"$=":return n=>n.endsWith(t);case"*=":return n=>n.includes(t);case"|=":return n=>t===n||n.startsWith(t)&&n[t.length]==="-"}}}function mFa(r,t){let n=eko(t,o=>o.type==="combinator"&&o.combinator===r,o=>X7(o.left)),i=[];for(let o of Object.values(n)){let s=O6e(o.items),a=o.oneSimpleSelector.left;i.push({ast:a,terminal:{type:"popElement",cont:s}})}return{type:"pushElement",combinator:r,cont:O6e(i)}}function eko(r,t,n){let i={};for(;r.length;){let o=CFa(r,t,n),s=d=>t(d)&&n(d)===o,a=d=>d.ast.list.some(s),{matches:u,rest:l}=UU0(r,a),c=null;for(let d of u){let p=EFa(d,s);c||(c=p)}if(c==null)throw new Error("No simple selector is found.");i[o]={oneSimpleSelector:c,items:u},r=l}return i}function EFa(r,t){let n=r.ast.list,i=new Array(n.length),o=-1;for(let a=n.length;a-- >0;)t(n[a])&&(i[a]=!0,o=a);if(o==-1)throw new Error("Couldn't find the required simple selector.");let s=n[o];return r.ast.list=n.filter((a,u)=>!i[u]),s}function CFa(r,t,n){let i={};for(let a of r){let u={};for(let l of a.ast.list.filter(t))u[n(l)]=!0;for(let l of Object.keys(u))i[l]?i[l]++:i[l]=1}let o="",s=0;for(let a of Object.entries(i))a[1]>s&&(o=a[0],s=a[1]);return o}function QU0(r,t){let n=[],i=[];for(let o of r)t(o)?n.push(o):i.push(o);return{matches:n,rest:i}}function UU0(r,t){let n=[],i=[];for(let o of r)t(o)?n.push(o):i.push(o);return{matches:n,rest:i}}var MPn=class{constructor(t){this.f=t}pickAll(t){return this.f(t)}pick1(t,n=!1){let i=this.f(t),o=i.length;if(o===0)return null;if(o===1)return i[0].value;let s=n?jU0:GU0,a=i[0];for(let u=1;u<o;u++){let l=i[u];s(a,l)&&(a=l)}return a.value}};function jU0(r,t){let n=Z8o(t.specificity,r.specificity);return n>0||n===0&&t.index<r.index}function GU0(r,t){let n=Z8o(t.specificity,r.specificity);return n>0||n===0&&t.index>r.index}function tko(r){return new MPn(R6e(r))}function R6e(r){let t=r.map(HU0);return(n,...i)=>t.flatMap(o=>o(n,...i))}function HU0(r){switch(r.type){case"terminal":{let t=[r.valueContainer];return(n,...i)=>t}case"tagName":return WU0(r);case"attrValue":return KU0(r);case"attrPresence":return VU0(r);case"pushElement":return YU0(r);case"popElement":return $U0(r)}}function WU0(r){let t={};for(let n of r.variants)t[n.value]=R6e(n.cont);return(n,...i)=>{let o=t[n.name];return o?o(n,...i):[]}}function VU0(r){let t=r.name,n=R6e(r.cont);return(i,...o)=>Object.prototype.hasOwnProperty.call(i.attribs,t)?n(i,...o):[]}function KU0(r){let t=[];for(let i of r.matchers){let o=i.predicate,s=R6e(i.cont);t.push((a,u,...l)=>o(a)?s(u,...l):[])}let n=r.name;return(i,...o)=>{let s=i.attribs[n];return s||s===""?t.flatMap(a=>a(s,i,...o)):[]}}function YU0(r){let t=R6e(r.cont),n=r.combinator==="+"?SFa:JU0;return(i,...o)=>{let s=n(i);return s===null?[]:t(s,i,...o)}}var SFa=r=>{let t=r.prev;return t===null?null:bte(t)?t:SFa(t)},JU0=r=>{let t=r.parent;return t&&bte(t)?t:null};function $U0(r){let t=R6e(r.cont);return(n,i,...o)=>t(i,...o)}var wPn=new Uint16Array('\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map(r=>r.charCodeAt(0)));var PPn=new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(r=>r.charCodeAt(0)));var rko,XU0=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),M6e=(rko=String.fromCodePoint)!==null&&rko!==void 0?rko:function(r){let t="";return r>65535&&(r-=65536,t+=String.fromCharCode(r>>>10&1023|55296),r=56320|r&1023),t+=String.fromCharCode(r),t};function Idt(r){var t;return r>=55296&&r<=57343||r>1114111?65533:(t=XU0.get(r))!==null&&t!==void 0?t:r}var f_;(function(r){r[r.NUM=35]="NUM",r[r.SEMI=59]="SEMI",r[r.EQUALS=61]="EQUALS",r[r.ZERO=48]="ZERO",r[r.NINE=57]="NINE",r[r.LOWER_A=97]="LOWER_A",r[r.LOWER_F=102]="LOWER_F",r[r.LOWER_X=120]="LOWER_X",r[r.LOWER_Z=122]="LOWER_Z",r[r.UPPER_A=65]="UPPER_A",r[r.UPPER_F=70]="UPPER_F",r[r.UPPER_Z=90]="UPPER_Z"})(f_||(f_={}));var ZU0=32,Z8;(function(r){r[r.VALUE_LENGTH=49152]="VALUE_LENGTH",r[r.BRANCH_LENGTH=16256]="BRANCH_LENGTH",r[r.JUMP_TABLE=127]="JUMP_TABLE"})(Z8||(Z8={}));function nko(r){return r>=f_.ZERO&&r<=f_.NINE}function ej0(r){return r>=f_.UPPER_A&&r<=f_.UPPER_F||r>=f_.LOWER_A&&r<=f_.LOWER_F}function tj0(r){return r>=f_.UPPER_A&&r<=f_.UPPER_Z||r>=f_.LOWER_A&&r<=f_.LOWER_Z||nko(r)}function rj0(r){return r===f_.EQUALS||tj0(r)}var p_;(function(r){r[r.EntityStart=0]="EntityStart",r[r.NumericStart=1]="NumericStart",r[r.NumericDecimal=2]="NumericDecimal",r[r.NumericHex=3]="NumericHex",r[r.NamedEntity=4]="NamedEntity"})(p_||(p_={}));var Ete;(function(r){r[r.Legacy=0]="Legacy",r[r.Strict=1]="Strict",r[r.Attribute=2]="Attribute"})(Ete||(Ete={}));var NPn=class{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=p_.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ete.Strict}startEntity(t){this.decodeMode=t,this.state=p_.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case p_.EntityStart:return t.charCodeAt(n)===f_.NUM?(this.state=p_.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=p_.NamedEntity,this.stateNamedEntity(t,n));case p_.NumericStart:return this.stateNumericStart(t,n);case p_.NumericDecimal:return this.stateNumericDecimal(t,n);case p_.NumericHex:return this.stateNumericHex(t,n);case p_.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|ZU0)===f_.LOWER_X?(this.state=p_.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=p_.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,i,o){if(n!==i){let s=i-n;this.result=this.result*Math.pow(o,s)+parseInt(t.substr(n,s),o),this.consumed+=s}}stateNumericHex(t,n){let i=n;for(;n<t.length;){let o=t.charCodeAt(n);if(nko(o)||ej0(o))n+=1;else return this.addToNumericResult(t,i,n,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(t,i,n,16),-1}stateNumericDecimal(t,n){let i=n;for(;n<t.length;){let o=t.charCodeAt(n);if(nko(o))n+=1;else return this.addToNumericResult(t,i,n,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(t,i,n,10),-1}emitNumericEntity(t,n){var i;if(this.consumed<=n)return(i=this.errors)===null||i===void 0||i.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===f_.SEMI)this.consumed+=1;else if(this.decodeMode===Ete.Strict)return 0;return this.emitCodePoint(Idt(this.result),this.consumed),this.errors&&(t!==f_.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){let{decodeTree:i}=this,o=i[this.treeIndex],s=(o&Z8.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){let a=t.charCodeAt(n);if(this.treeIndex=iko(i,o,this.treeIndex+Math.max(1,s),a),this.treeIndex<0)return this.result===0||this.decodeMode===Ete.Attribute&&(s===0||rj0(a))?0:this.emitNotTerminatedNamedEntity();if(o=i[this.treeIndex],s=(o&Z8.VALUE_LENGTH)>>14,s!==0){if(a===f_.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Ete.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;let{result:n,decodeTree:i}=this,o=(i[n]&Z8.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,o,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,i){let{decodeTree:o}=this;return this.emitCodePoint(n===1?o[t]&~Z8.VALUE_LENGTH:o[t+1],i),n===3&&this.emitCodePoint(o[t+2],i),i}end(){var t;switch(this.state){case p_.NamedEntity:return this.result!==0&&(this.decodeMode!==Ete.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case p_.NumericDecimal:return this.emitNumericEntity(0,2);case p_.NumericHex:return this.emitNumericEntity(0,3);case p_.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case p_.EntityStart:return 0}}};function _Fa(r){let t="",n=new NPn(r,i=>t+=M6e(i));return function(o,s){let a=0,u=0;for(;(u=o.indexOf("&",u))>=0;){t+=o.slice(a,u),n.startEntity(s);let c=n.write(o,u+1);if(c<0){a=u+n.end();break}a=u+c,u=c===0?a+1:a}let l=t+o.slice(a);return t="",l}}function iko(r,t,n,i){let o=(t&Z8.BRANCH_LENGTH)>>7,s=t&Z8.JUMP_TABLE;if(o===0)return s!==0&&i===s?n:-1;if(s){let l=i-s;return l<0||l>=o?-1:r[n+l]-1}let a=n,u=a+o-1;for(;a<=u;){let l=a+u>>>1,c=r[l];if(c<i)a=l+1;else if(c>i)u=l-1;else return r[l+o]}return-1}var BIb=_Fa(wPn),kIb=_Fa(PPn);var vs;(function(r){r[r.Tab=9]="Tab",r[r.NewLine=10]="NewLine",r[r.FormFeed=12]="FormFeed",r[r.CarriageReturn=13]="CarriageReturn",r[r.Space=32]="Space",r[r.ExclamationMark=33]="ExclamationMark",r[r.Num=35]="Num",r[r.Amp=38]="Amp",r[r.SingleQuote=39]="SingleQuote",r[r.DoubleQuote=34]="DoubleQuote",r[r.Dash=45]="Dash",r[r.Slash=47]="Slash",r[r.Zero=48]="Zero",r[r.Nine=57]="Nine",r[r.Semi=59]="Semi",r[r.Lt=60]="Lt",r[r.Eq=61]="Eq",r[r.Gt=62]="Gt",r[r.Questionmark=63]="Questionmark",r[r.UpperA=65]="UpperA",r[r.LowerA=97]="LowerA",r[r.UpperF=70]="UpperF",r[r.LowerF=102]="LowerF",r[r.UpperZ=90]="UpperZ",r[r.LowerZ=122]="LowerZ",r[r.LowerX=120]="LowerX",r[r.OpeningSquareBracket=91]="OpeningSquareBracket"})(vs||(vs={}));var In;(function(r){r[r.Text=1]="Text",r[r.BeforeTagName=2]="BeforeTagName",r[r.InTagName=3]="InTagName",r[r.InSelfClosingTag=4]="InSelfClosingTag",r[r.BeforeClosingTagName=5]="BeforeClosingTagName",r[r.InClosingTagName=6]="InClosingTagName",r[r.AfterClosingTagName=7]="AfterClosingTagName",r[r.BeforeAttributeName=8]="BeforeAttributeName",r[r.InAttributeName=9]="InAttributeName",r[r.AfterAttributeName=10]="AfterAttributeName",r[r.BeforeAttributeValue=11]="BeforeAttributeValue",r[r.InAttributeValueDq=12]="InAttributeValueDq",r[r.InAttributeValueSq=13]="InAttributeValueSq",r[r.InAttributeValueNq=14]="InAttributeValueNq",r[r.BeforeDeclaration=15]="BeforeDeclaration",r[r.InDeclaration=16]="InDeclaration",r[r.InProcessingInstruction=17]="InProcessingInstruction",r[r.BeforeComment=18]="BeforeComment",r[r.CDATASequence=19]="CDATASequence",r[r.InSpecialComment=20]="InSpecialComment",r[r.InCommentLike=21]="InCommentLike",r[r.BeforeSpecialS=22]="BeforeSpecialS",r[r.SpecialStartSequence=23]="SpecialStartSequence",r[r.InSpecialTag=24]="InSpecialTag",r[r.BeforeEntity=25]="BeforeEntity",r[r.BeforeNumericEntity=26]="BeforeNumericEntity",r[r.InNamedEntity=27]="InNamedEntity",r[r.InNumericEntity=28]="InNumericEntity",r[r.InHexEntity=29]="InHexEntity"})(In||(In={}));function Cte(r){return r===vs.Space||r===vs.NewLine||r===vs.Tab||r===vs.FormFeed||r===vs.CarriageReturn}function DPn(r){return r===vs.Slash||r===vs.Gt||Cte(r)}function vFa(r){return r>=vs.Zero&&r<=vs.Nine}function nj0(r){return r>=vs.LowerA&&r<=vs.LowerZ||r>=vs.UpperA&&r<=vs.UpperZ}function ij0(r){return r>=vs.UpperA&&r<=vs.UpperF||r>=vs.LowerA&&r<=vs.LowerF}var Z7;(function(r){r[r.NoValue=0]="NoValue",r[r.Unquoted=1]="Unquoted",r[r.Single=2]="Single",r[r.Double=3]="Double"})(Z7||(Z7={}));var w4={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101])},w6e=class{constructor({xmlMode:t=!1,decodeEntities:n=!0},i){this.cbs=i,this.state=In.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=In.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.sequenceIndex=0,this.trieIndex=0,this.trieCurrent=0,this.entityResult=0,this.entityExcess=0,this.xmlMode=t,this.decodeEntities=n,this.entityTrie=t?PPn:wPn}reset(){this.state=In.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=In.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(t){this.offset+=this.buffer.length,this.buffer=t,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()}getIndex(){return this.index}getSectionStart(){return this.sectionStart}stateText(t){t===vs.Lt||!this.decodeEntities&&this.fastForwardTo(vs.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=In.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&t===vs.Amp&&(this.state=In.BeforeEntity)}stateSpecialStartSequence(t){let n=this.sequenceIndex===this.currentSequence.length;if(!(n?DPn(t):(t|32)===this.currentSequence[this.sequenceIndex]))this.isSpecial=!1;else if(!n){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=In.InTagName,this.stateInTagName(t)}stateInSpecialTag(t){if(this.sequenceIndex===this.currentSequence.length){if(t===vs.Gt||Cte(t)){let n=this.index-this.currentSequence.length;if(this.sectionStart<n){let i=this.index;this.index=n,this.cbs.ontext(this.sectionStart,n),this.index=i}this.isSpecial=!1,this.sectionStart=n+2,this.stateInClosingTagName(t);return}this.sequenceIndex=0}(t|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===w4.TitleEnd?this.decodeEntities&&t===vs.Amp&&(this.state=In.BeforeEntity):this.fastForwardTo(vs.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=+(t===vs.Lt)}stateCDATASequence(t){t===w4.Cdata[this.sequenceIndex]?++this.sequenceIndex===w4.Cdata.length&&(this.state=In.InCommentLike,this.currentSequence=w4.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=In.InDeclaration,this.stateInDeclaration(t))}fastForwardTo(t){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===t)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(t){t===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===w4.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=In.Text):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):t!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(t){return this.xmlMode?!DPn(t):nj0(t)}startSpecial(t,n){this.isSpecial=!0,this.currentSequence=t,this.sequenceIndex=n,this.state=In.SpecialStartSequence}stateBeforeTagName(t){if(t===vs.ExclamationMark)this.state=In.BeforeDeclaration,this.sectionStart=this.index+1;else if(t===vs.Questionmark)this.state=In.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(t)){let n=t|32;this.sectionStart=this.index,!this.xmlMode&&n===w4.TitleEnd[2]?this.startSpecial(w4.TitleEnd,3):this.state=!this.xmlMode&&n===w4.ScriptEnd[2]?In.BeforeSpecialS:In.InTagName}else t===vs.Slash?this.state=In.BeforeClosingTagName:(this.state=In.Text,this.stateText(t))}stateInTagName(t){DPn(t)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=In.BeforeAttributeName,this.stateBeforeAttributeName(t))}stateBeforeClosingTagName(t){Cte(t)||(t===vs.Gt?this.state=In.Text:(this.state=this.isTagStartChar(t)?In.InClosingTagName:In.InSpecialComment,this.sectionStart=this.index))}stateInClosingTagName(t){(t===vs.Gt||Cte(t))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=In.AfterClosingTagName,this.stateAfterClosingTagName(t))}stateAfterClosingTagName(t){(t===vs.Gt||this.fastForwardTo(vs.Gt))&&(this.state=In.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(t){t===vs.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=In.InSpecialTag,this.sequenceIndex=0):this.state=In.Text,this.baseState=this.state,this.sectionStart=this.index+1):t===vs.Slash?this.state=In.InSelfClosingTag:Cte(t)||(this.state=In.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(t){t===vs.Gt?(this.cbs.onselfclosingtag(this.index),this.state=In.Text,this.baseState=In.Text,this.sectionStart=this.index+1,this.isSpecial=!1):Cte(t)||(this.state=In.BeforeAttributeName,this.stateBeforeAttributeName(t))}stateInAttributeName(t){(t===vs.Eq||DPn(t))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=-1,this.state=In.AfterAttributeName,this.stateAfterAttributeName(t))}stateAfterAttributeName(t){t===vs.Eq?this.state=In.BeforeAttributeValue:t===vs.Slash||t===vs.Gt?(this.cbs.onattribend(Z7.NoValue,this.index),this.state=In.BeforeAttributeName,this.stateBeforeAttributeName(t)):Cte(t)||(this.cbs.onattribend(Z7.NoValue,this.index),this.state=In.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(t){t===vs.DoubleQuote?(this.state=In.InAttributeValueDq,this.sectionStart=this.index+1):t===vs.SingleQuote?(this.state=In.InAttributeValueSq,this.sectionStart=this.index+1):Cte(t)||(this.sectionStart=this.index,this.state=In.InAttributeValueNq,this.stateInAttributeValueNoQuotes(t))}handleInAttributeValue(t,n){t===n||!this.decodeEntities&&this.fastForwardTo(n)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(n===vs.DoubleQuote?Z7.Double:Z7.Single,this.index),this.state=In.BeforeAttributeName):this.decodeEntities&&t===vs.Amp&&(this.baseState=this.state,this.state=In.BeforeEntity)}stateInAttributeValueDoubleQuotes(t){this.handleInAttributeValue(t,vs.DoubleQuote)}stateInAttributeValueSingleQuotes(t){this.handleInAttributeValue(t,vs.SingleQuote)}stateInAttributeValueNoQuotes(t){Cte(t)||t===vs.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(Z7.Unquoted,this.index),this.state=In.BeforeAttributeName,this.stateBeforeAttributeName(t)):this.decodeEntities&&t===vs.Amp&&(this.baseState=this.state,this.state=In.BeforeEntity)}stateBeforeDeclaration(t){t===vs.OpeningSquareBracket?(this.state=In.CDATASequence,this.sequenceIndex=0):this.state=t===vs.Dash?In.BeforeComment:In.InDeclaration}stateInDeclaration(t){(t===vs.Gt||this.fastForwardTo(vs.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=In.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(t){(t===vs.Gt||this.fastForwardTo(vs.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=In.Text,this.sectionStart=this.index+1)}stateBeforeComment(t){t===vs.Dash?(this.state=In.InCommentLike,this.currentSequence=w4.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=In.InDeclaration}stateInSpecialComment(t){(t===vs.Gt||this.fastForwardTo(vs.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=In.Text,this.sectionStart=this.index+1)}stateBeforeSpecialS(t){let n=t|32;n===w4.ScriptEnd[3]?this.startSpecial(w4.ScriptEnd,4):n===w4.StyleEnd[3]?this.startSpecial(w4.StyleEnd,4):(this.state=In.InTagName,this.stateInTagName(t))}stateBeforeEntity(t){this.entityExcess=1,this.entityResult=0,t===vs.Num?this.state=In.BeforeNumericEntity:t===vs.Amp||(this.trieIndex=0,this.trieCurrent=this.entityTrie[0],this.state=In.InNamedEntity,this.stateInNamedEntity(t))}stateInNamedEntity(t){if(this.entityExcess+=1,this.trieIndex=iko(this.entityTrie,this.trieCurrent,this.trieIndex+1,t),this.trieIndex<0){this.emitNamedEntity(),this.index--;return}this.trieCurrent=this.entityTrie[this.trieIndex];let n=this.trieCurrent&Z8.VALUE_LENGTH;if(n){let i=(n>>14)-1;if(!this.allowLegacyEntity()&&t!==vs.Semi)this.trieIndex+=i;else{let o=this.index-this.entityExcess+1;o>this.sectionStart&&this.emitPartial(this.sectionStart,o),this.entityResult=this.trieIndex,this.trieIndex+=i,this.entityExcess=0,this.sectionStart=this.index+1,i===0&&this.emitNamedEntity()}}}emitNamedEntity(){if(this.state=this.baseState,this.entityResult===0)return;switch((this.entityTrie[this.entityResult]&Z8.VALUE_LENGTH)>>14){case 1:this.emitCodePoint(this.entityTrie[this.entityResult]&~Z8.VALUE_LENGTH);break;case 2:this.emitCodePoint(this.entityTrie[this.entityResult+1]);break;case 3:this.emitCodePoint(this.entityTrie[this.entityResult+1]),this.emitCodePoint(this.entityTrie[this.entityResult+2])}}stateBeforeNumericEntity(t){(t|32)===vs.LowerX?(this.entityExcess++,this.state=In.InHexEntity):(this.state=In.InNumericEntity,this.stateInNumericEntity(t))}emitNumericEntity(t){let n=this.index-this.entityExcess-1;n+2+ +(this.state===In.InHexEntity)!==this.index&&(n>this.sectionStart&&this.emitPartial(this.sectionStart,n),this.sectionStart=this.index+Number(t),this.emitCodePoint(Idt(this.entityResult))),this.state=this.baseState}stateInNumericEntity(t){t===vs.Semi?this.emitNumericEntity(!0):vFa(t)?(this.entityResult=this.entityResult*10+(t-vs.Zero),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)}stateInHexEntity(t){t===vs.Semi?this.emitNumericEntity(!0):vFa(t)?(this.entityResult=this.entityResult*16+(t-vs.Zero),this.entityExcess++):ij0(t)?(this.entityResult=this.entityResult*16+((t|32)-vs.LowerA+10),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)}allowLegacyEntity(){return!this.xmlMode&&(this.baseState===In.Text||this.baseState===In.InSpecialTag)}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===In.Text||this.state===In.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===In.InAttributeValueDq||this.state===In.InAttributeValueSq||this.state===In.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){for(;this.shouldContinue();){let t=this.buffer.charCodeAt(this.index-this.offset);this.state===In.Text?this.stateText(t):this.state===In.SpecialStartSequence?this.stateSpecialStartSequence(t):this.state===In.InSpecialTag?this.stateInSpecialTag(t):this.state===In.CDATASequence?this.stateCDATASequence(t):this.state===In.InAttributeValueDq?this.stateInAttributeValueDoubleQuotes(t):this.state===In.InAttributeName?this.stateInAttributeName(t):this.state===In.InCommentLike?this.stateInCommentLike(t):this.state===In.InSpecialComment?this.stateInSpecialComment(t):this.state===In.BeforeAttributeName?this.stateBeforeAttributeName(t):this.state===In.InTagName?this.stateInTagName(t):this.state===In.InClosingTagName?this.stateInClosingTagName(t):this.state===In.BeforeTagName?this.stateBeforeTagName(t):this.state===In.AfterAttributeName?this.stateAfterAttributeName(t):this.state===In.InAttributeValueSq?this.stateInAttributeValueSingleQuotes(t):this.state===In.BeforeAttributeValue?this.stateBeforeAttributeValue(t):this.state===In.BeforeClosingTagName?this.stateBeforeClosingTagName(t):this.state===In.AfterClosingTagName?this.stateAfterClosingTagName(t):this.state===In.BeforeSpecialS?this.stateBeforeSpecialS(t):this.state===In.InAttributeValueNq?this.stateInAttributeValueNoQuotes(t):this.state===In.InSelfClosingTag?this.stateInSelfClosingTag(t):this.state===In.InDeclaration?this.stateInDeclaration(t):this.state===In.BeforeDeclaration?this.stateBeforeDeclaration(t):this.state===In.BeforeComment?this.stateBeforeComment(t):this.state===In.InProcessingInstruction?this.stateInProcessingInstruction(t):this.state===In.InNamedEntity?this.stateInNamedEntity(t):this.state===In.BeforeEntity?this.stateBeforeEntity(t):this.state===In.InHexEntity?this.stateInHexEntity(t):this.state===In.InNumericEntity?this.stateInNumericEntity(t):this.stateBeforeNumericEntity(t),this.index++}this.cleanup()}finish(){this.state===In.InNamedEntity&&this.emitNamedEntity(),this.sectionStart<this.index&&this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){let t=this.buffer.length+this.offset;this.state===In.InCommentLike?this.currentSequence===w4.CdataEnd?this.cbs.oncdata(this.sectionStart,t,0):this.cbs.oncomment(this.sectionStart,t,0):this.state===In.InNumericEntity&&this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state===In.InHexEntity&&this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state===In.InTagName||this.state===In.BeforeAttributeName||this.state===In.BeforeAttributeValue||this.state===In.AfterAttributeName||this.state===In.InAttributeName||this.state===In.InAttributeValueSq||this.state===In.InAttributeValueDq||this.state===In.InAttributeValueNq||this.state===In.InClosingTagName||this.cbs.ontext(this.sectionStart,t)}emitPartial(t,n){this.baseState!==In.Text&&this.baseState!==In.InSpecialTag?this.cbs.onattribdata(t,n):this.cbs.ontext(t,n)}emitCodePoint(t){this.baseState!==In.Text&&this.baseState!==In.InSpecialTag?this.cbs.onattribentity(t):this.cbs.ontextentity(t)}};var P6e=new Set(["input","option","optgroup","select","button","datalist","textarea"]),rh=new Set(["p"]),TFa=new Set(["thead","tbody"]),IFa=new Set(["dd","dt"]),OFa=new Set(["rt","rp"]),oj0=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",rh],["h1",rh],["h2",rh],["h3",rh],["h4",rh],["h5",rh],["h6",rh],["select",P6e],["input",P6e],["output",P6e],["button",P6e],["datalist",P6e],["textarea",P6e],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",IFa],["dt",IFa],["address",rh],["article",rh],["aside",rh],["blockquote",rh],["details",rh],["div",rh],["dl",rh],["fieldset",rh],["figcaption",rh],["figure",rh],["footer",rh],["form",rh],["header",rh],["hr",rh],["main",rh],["nav",rh],["ol",rh],["pre",rh],["section",rh],["table",rh],["ul",rh],["rt",OFa],["rp",OFa],["tbody",TFa],["tfoot",TFa]]),sj0=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),RFa=new Set(["math","svg"]),MFa=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),aj0=/\s|\//,xPn=class{constructor(t,n={}){var i,o,s,a,u;this.options=n,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.foreignContext=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=t??{},this.lowerCaseTagNames=(i=n.lowerCaseTags)!==null&&i!==void 0?i:!n.xmlMode,this.lowerCaseAttributeNames=(o=n.lowerCaseAttributeNames)!==null&&o!==void 0?o:!n.xmlMode,this.tokenizer=new((s=n.Tokenizer)!==null&&s!==void 0?s:w6e)(this.options,this),(u=(a=this.cbs).onparserinit)===null||u===void 0||u.call(a,this)}ontext(t,n){var i,o;let s=this.getSlice(t,n);this.endIndex=n-1,(o=(i=this.cbs).ontext)===null||o===void 0||o.call(i,s),this.startIndex=n}ontextentity(t){var n,i;let o=this.tokenizer.getSectionStart();this.endIndex=o-1,(i=(n=this.cbs).ontext)===null||i===void 0||i.call(n,M6e(t)),this.startIndex=o}isVoidElement(t){return!this.options.xmlMode&&sj0.has(t)}onopentagname(t,n){this.endIndex=n;let i=this.getSlice(t,n);this.lowerCaseTagNames&&(i=i.toLowerCase()),this.emitOpenTag(i)}emitOpenTag(t){var n,i,o,s;this.openTagStart=this.startIndex,this.tagname=t;let a=!this.options.xmlMode&&oj0.get(t);if(a)for(;this.stack.length>0&&a.has(this.stack[this.stack.length-1]);){let u=this.stack.pop();(i=(n=this.cbs).onclosetag)===null||i===void 0||i.call(n,u,!0)}this.isVoidElement(t)||(this.stack.push(t),RFa.has(t)?this.foreignContext.push(!0):MFa.has(t)&&this.foreignContext.push(!1)),(s=(o=this.cbs).onopentagname)===null||s===void 0||s.call(o,t),this.cbs.onopentag&&(this.attribs={})}endOpenTag(t){var n,i;this.startIndex=this.openTagStart,this.attribs&&((i=(n=this.cbs).onopentag)===null||i===void 0||i.call(n,this.tagname,this.attribs,t),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""}onopentagend(t){this.endIndex=t,this.endOpenTag(!1),this.startIndex=t+1}onclosetag(t,n){var i,o,s,a,u,l;this.endIndex=n;let c=this.getSlice(t,n);if(this.lowerCaseTagNames&&(c=c.toLowerCase()),(RFa.has(c)||MFa.has(c))&&this.foreignContext.pop(),this.isVoidElement(c))!this.options.xmlMode&&c==="br"&&((o=(i=this.cbs).onopentagname)===null||o===void 0||o.call(i,"br"),(a=(s=this.cbs).onopentag)===null||a===void 0||a.call(s,"br",{},!0),(l=(u=this.cbs).onclosetag)===null||l===void 0||l.call(u,"br",!1));else{let d=this.stack.lastIndexOf(c);if(d!==-1)if(this.cbs.onclosetag){let p=this.stack.length-d;for(;p--;)this.cbs.onclosetag(this.stack.pop(),p!==0)}else this.stack.length=d;else!this.options.xmlMode&&c==="p"&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=n+1}onselfclosingtag(t){this.endIndex=t,this.options.xmlMode||this.options.recognizeSelfClosing||this.foreignContext[this.foreignContext.length-1]?(this.closeCurrentTag(!1),this.startIndex=t+1):this.onopentagend(t)}closeCurrentTag(t){var n,i;let o=this.tagname;this.endOpenTag(t),this.stack[this.stack.length-1]===o&&((i=(n=this.cbs).onclosetag)===null||i===void 0||i.call(n,o,!t),this.stack.pop())}onattribname(t,n){this.startIndex=t;let i=this.getSlice(t,n);this.attribname=this.lowerCaseAttributeNames?i.toLowerCase():i}onattribdata(t,n){this.attribvalue+=this.getSlice(t,n)}onattribentity(t){this.attribvalue+=M6e(t)}onattribend(t,n){var i,o;this.endIndex=n,(o=(i=this.cbs).onattribute)===null||o===void 0||o.call(i,this.attribname,this.attribvalue,t===Z7.Double?'"':t===Z7.Single?"'":t===Z7.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""}getInstructionName(t){let n=t.search(aj0),i=n<0?t:t.substr(0,n);return this.lowerCaseTagNames&&(i=i.toLowerCase()),i}ondeclaration(t,n){this.endIndex=n;let i=this.getSlice(t,n);if(this.cbs.onprocessinginstruction){let o=this.getInstructionName(i);this.cbs.onprocessinginstruction(`!${o}`,`!${i}`)}this.startIndex=n+1}onprocessinginstruction(t,n){this.endIndex=n;let i=this.getSlice(t,n);if(this.cbs.onprocessinginstruction){let o=this.getInstructionName(i);this.cbs.onprocessinginstruction(`?${o}`,`?${i}`)}this.startIndex=n+1}oncomment(t,n,i){var o,s,a,u;this.endIndex=n,(s=(o=this.cbs).oncomment)===null||s===void 0||s.call(o,this.getSlice(t,n-i)),(u=(a=this.cbs).oncommentend)===null||u===void 0||u.call(a),this.startIndex=n+1}oncdata(t,n,i){var o,s,a,u,l,c,d,p,f,A;this.endIndex=n;let g=this.getSlice(t,n-i);this.options.xmlMode||this.options.recognizeCDATA?((s=(o=this.cbs).oncdatastart)===null||s===void 0||s.call(o),(u=(a=this.cbs).ontext)===null||u===void 0||u.call(a,g),(c=(l=this.cbs).oncdataend)===null||c===void 0||c.call(l)):((p=(d=this.cbs).oncomment)===null||p===void 0||p.call(d,`[CDATA[${g}]]`),(A=(f=this.cbs).oncommentend)===null||A===void 0||A.call(f)),this.startIndex=n+1}onend(){var t,n;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let i=this.stack.length;i>0;this.cbs.onclosetag(this.stack[--i],!0));}(n=(t=this.cbs).onend)===null||n===void 0||n.call(t)}reset(){var t,n,i,o;(n=(t=this.cbs).onreset)===null||n===void 0||n.call(t),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(o=(i=this.cbs).onparserinit)===null||o===void 0||o.call(i,this),this.buffers.length=0,this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(t){this.reset(),this.end(t)}getSlice(t,n){for(;t-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let i=this.buffers[0].slice(t-this.bufferOffset,n-this.bufferOffset);for(;n-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),i+=this.buffers[0].slice(0,n-this.bufferOffset);return i}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(t){var n,i;if(this.ended){(i=(n=this.cbs).onerror)===null||i===void 0||i.call(n,new Error(".write() after done!"));return}this.buffers.push(t),this.tokenizer.running&&(this.tokenizer.write(t),this.writeIndex++)}end(t){var n,i;if(this.ended){(i=(n=this.cbs).onerror)===null||i===void 0||i.call(n,Error(".end() after done!"));return}t&&this.write(t),this.ended=!0,this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()}parseChunk(t){this.write(t)}done(t){this.end(t)}};function BPn(r){for(let t=1;t<r.length;t++)r[t][0]+=r[t-1][0]+1;return r}var uj0=new Map(BPn([[9,"&Tab;"],[0,"&NewLine;"],[22,"&excl;"],[0,"&quot;"],[0,"&num;"],[0,"&dollar;"],[0,"&percnt;"],[0,"&amp;"],[0,"&apos;"],[0,"&lpar;"],[0,"&rpar;"],[0,"&ast;"],[0,"&plus;"],[0,"&comma;"],[1,"&period;"],[0,"&sol;"],[10,"&colon;"],[0,"&semi;"],[0,{v:"&lt;",n:8402,o:"&nvlt;"}],[0,{v:"&equals;",n:8421,o:"&bne;"}],[0,{v:"&gt;",n:8402,o:"&nvgt;"}],[0,"&quest;"],[0,"&commat;"],[26,"&lbrack;"],[0,"&bsol;"],[0,"&rbrack;"],[0,"&Hat;"],[0,"&lowbar;"],[0,"&DiacriticalGrave;"],[5,{n:106,o:"&fjlig;"}],[20,"&lbrace;"],[0,"&verbar;"],[0,"&rbrace;"],[34,"&nbsp;"],[0,"&iexcl;"],[0,"&cent;"],[0,"&pound;"],[0,"&curren;"],[0,"&yen;"],[0,"&brvbar;"],[0,"&sect;"],[0,"&die;"],[0,"&copy;"],[0,"&ordf;"],[0,"&laquo;"],[0,"&not;"],[0,"&shy;"],[0,"&circledR;"],[0,"&macr;"],[0,"&deg;"],[0,"&PlusMinus;"],[0,"&sup2;"],[0,"&sup3;"],[0,"&acute;"],[0,"&micro;"],[0,"&para;"],[0,"&centerdot;"],[0,"&cedil;"],[0,"&sup1;"],[0,"&ordm;"],[0,"&raquo;"],[0,"&frac14;"],[0,"&frac12;"],[0,"&frac34;"],[0,"&iquest;"],[0,"&Agrave;"],[0,"&Aacute;"],[0,"&Acirc;"],[0,"&Atilde;"],[0,"&Auml;"],[0,"&angst;"],[0,"&AElig;"],[0,"&Ccedil;"],[0,"&Egrave;"],[0,"&Eacute;"],[0,"&Ecirc;"],[0,"&Euml;"],[0,"&Igrave;"],[0,"&Iacute;"],[0,"&Icirc;"],[0,"&Iuml;"],[0,"&ETH;"],[0,"&Ntilde;"],[0,"&Ograve;"],[0,"&Oacute;"],[0,"&Ocirc;"],[0,"&Otilde;"],[0,"&Ouml;"],[0,"&times;"],[0,"&Oslash;"],[0,"&Ugrave;"],[0,"&Uacute;"],[0,"&Ucirc;"],[0,"&Uuml;"],[0,"&Yacute;"],[0,"&THORN;"],[0,"&szlig;"],[0,"&agrave;"],[0,"&aacute;"],[0,"&acirc;"],[0,"&atilde;"],[0,"&auml;"],[0,"&aring;"],[0,"&aelig;"],[0,"&ccedil;"],[0,"&egrave;"],[0,"&eacute;"],[0,"&ecirc;"],[0,"&euml;"],[0,"&igrave;"],[0,"&iacute;"],[0,"&icirc;"],[0,"&iuml;"],[0,"&eth;"],[0,"&ntilde;"],[0,"&ograve;"],[0,"&oacute;"],[0,"&ocirc;"],[0,"&otilde;"],[0,"&ouml;"],[0,"&div;"],[0,"&oslash;"],[0,"&ugrave;"],[0,"&uacute;"],[0,"&ucirc;"],[0,"&uuml;"],[0,"&yacute;"],[0,"&thorn;"],[0,"&yuml;"],[0,"&Amacr;"],[0,"&amacr;"],[0,"&Abreve;"],[0,"&abreve;"],[0,"&Aogon;"],[0,"&aogon;"],[0,"&Cacute;"],[0,"&cacute;"],[0,"&Ccirc;"],[0,"&ccirc;"],[0,"&Cdot;"],[0,"&cdot;"],[0,"&Ccaron;"],[0,"&ccaron;"],[0,"&Dcaron;"],[0,"&dcaron;"],[0,"&Dstrok;"],[0,"&dstrok;"],[0,"&Emacr;"],[0,"&emacr;"],[2,"&Edot;"],[0,"&edot;"],[0,"&Eogon;"],[0,"&eogon;"],[0,"&Ecaron;"],[0,"&ecaron;"],[0,"&Gcirc;"],[0,"&gcirc;"],[0,"&Gbreve;"],[0,"&gbreve;"],[0,"&Gdot;"],[0,"&gdot;"],[0,"&Gcedil;"],[1,"&Hcirc;"],[0,"&hcirc;"],[0,"&Hstrok;"],[0,"&hstrok;"],[0,"&Itilde;"],[0,"&itilde;"],[0,"&Imacr;"],[0,"&imacr;"],[2,"&Iogon;"],[0,"&iogon;"],[0,"&Idot;"],[0,"&imath;"],[0,"&IJlig;"],[0,"&ijlig;"],[0,"&Jcirc;"],[0,"&jcirc;"],[0,"&Kcedil;"],[0,"&kcedil;"],[0,"&kgreen;"],[0,"&Lacute;"],[0,"&lacute;"],[0,"&Lcedil;"],[0,"&lcedil;"],[0,"&Lcaron;"],[0,"&lcaron;"],[0,"&Lmidot;"],[0,"&lmidot;"],[0,"&Lstrok;"],[0,"&lstrok;"],[0,"&Nacute;"],[0,"&nacute;"],[0,"&Ncedil;"],[0,"&ncedil;"],[0,"&Ncaron;"],[0,"&ncaron;"],[0,"&napos;"],[0,"&ENG;"],[0,"&eng;"],[0,"&Omacr;"],[0,"&omacr;"],[2,"&Odblac;"],[0,"&odblac;"],[0,"&OElig;"],[0,"&oelig;"],[0,"&Racute;"],[0,"&racute;"],[0,"&Rcedil;"],[0,"&rcedil;"],[0,"&Rcaron;"],[0,"&rcaron;"],[0,"&Sacute;"],[0,"&sacute;"],[0,"&Scirc;"],[0,"&scirc;"],[0,"&Scedil;"],[0,"&scedil;"],[0,"&Scaron;"],[0,"&scaron;"],[0,"&Tcedil;"],[0,"&tcedil;"],[0,"&Tcaron;"],[0,"&tcaron;"],[0,"&Tstrok;"],[0,"&tstrok;"],[0,"&Utilde;"],[0,"&utilde;"],[0,"&Umacr;"],[0,"&umacr;"],[0,"&Ubreve;"],[0,"&ubreve;"],[0,"&Uring;"],[0,"&uring;"],[0,"&Udblac;"],[0,"&udblac;"],[0,"&Uogon;"],[0,"&uogon;"],[0,"&Wcirc;"],[0,"&wcirc;"],[0,"&Ycirc;"],[0,"&ycirc;"],[0,"&Yuml;"],[0,"&Zacute;"],[0,"&zacute;"],[0,"&Zdot;"],[0,"&zdot;"],[0,"&Zcaron;"],[0,"&zcaron;"],[19,"&fnof;"],[34,"&imped;"],[63,"&gacute;"],[65,"&jmath;"],[142,"&circ;"],[0,"&caron;"],[16,"&breve;"],[0,"&DiacriticalDot;"],[0,"&ring;"],[0,"&ogon;"],[0,"&DiacriticalTilde;"],[0,"&dblac;"],[51,"&DownBreve;"],[127,"&Alpha;"],[0,"&Beta;"],[0,"&Gamma;"],[0,"&Delta;"],[0,"&Epsilon;"],[0,"&Zeta;"],[0,"&Eta;"],[0,"&Theta;"],[0,"&Iota;"],[0,"&Kappa;"],[0,"&Lambda;"],[0,"&Mu;"],[0,"&Nu;"],[0,"&Xi;"],[0,"&Omicron;"],[0,"&Pi;"],[0,"&Rho;"],[1,"&Sigma;"],[0,"&Tau;"],[0,"&Upsilon;"],[0,"&Phi;"],[0,"&Chi;"],[0,"&Psi;"],[0,"&ohm;"],[7,"&alpha;"],[0,"&beta;"],[0,"&gamma;"],[0,"&delta;"],[0,"&epsi;"],[0,"&zeta;"],[0,"&eta;"],[0,"&theta;"],[0,"&iota;"],[0,"&kappa;"],[0,"&lambda;"],[0,"&mu;"],[0,"&nu;"],[0,"&xi;"],[0,"&omicron;"],[0,"&pi;"],[0,"&rho;"],[0,"&sigmaf;"],[0,"&sigma;"],[0,"&tau;"],[0,"&upsi;"],[0,"&phi;"],[0,"&chi;"],[0,"&psi;"],[0,"&omega;"],[7,"&thetasym;"],[0,"&Upsi;"],[2,"&phiv;"],[0,"&piv;"],[5,"&Gammad;"],[0,"&digamma;"],[18,"&kappav;"],[0,"&rhov;"],[3,"&epsiv;"],[0,"&backepsilon;"],[10,"&IOcy;"],[0,"&DJcy;"],[0,"&GJcy;"],[0,"&Jukcy;"],[0,"&DScy;"],[0,"&Iukcy;"],[0,"&YIcy;"],[0,"&Jsercy;"],[0,"&LJcy;"],[0,"&NJcy;"],[0,"&TSHcy;"],[0,"&KJcy;"],[1,"&Ubrcy;"],[0,"&DZcy;"],[0,"&Acy;"],[0,"&Bcy;"],[0,"&Vcy;"],[0,"&Gcy;"],[0,"&Dcy;"],[0,"&IEcy;"],[0,"&ZHcy;"],[0,"&Zcy;"],[0,"&Icy;"],[0,"&Jcy;"],[0,"&Kcy;"],[0,"&Lcy;"],[0,"&Mcy;"],[0,"&Ncy;"],[0,"&Ocy;"],[0,"&Pcy;"],[0,"&Rcy;"],[0,"&Scy;"],[0,"&Tcy;"],[0,"&Ucy;"],[0,"&Fcy;"],[0,"&KHcy;"],[0,"&TScy;"],[0,"&CHcy;"],[0,"&SHcy;"],[0,"&SHCHcy;"],[0,"&HARDcy;"],[0,"&Ycy;"],[0,"&SOFTcy;"],[0,"&Ecy;"],[0,"&YUcy;"],[0,"&YAcy;"],[0,"&acy;"],[0,"&bcy;"],[0,"&vcy;"],[0,"&gcy;"],[0,"&dcy;"],[0,"&iecy;"],[0,"&zhcy;"],[0,"&zcy;"],[0,"&icy;"],[0,"&jcy;"],[0,"&kcy;"],[0,"&lcy;"],[0,"&mcy;"],[0,"&ncy;"],[0,"&ocy;"],[0,"&pcy;"],[0,"&rcy;"],[0,"&scy;"],[0,"&tcy;"],[0,"&ucy;"],[0,"&fcy;"],[0,"&khcy;"],[0,"&tscy;"],[0,"&chcy;"],[0,"&shcy;"],[0,"&shchcy;"],[0,"&hardcy;"],[0,"&ycy;"],[0,"&softcy;"],[0,"&ecy;"],[0,"&yucy;"],[0,"&yacy;"],[1,"&iocy;"],[0,"&djcy;"],[0,"&gjcy;"],[0,"&jukcy;"],[0,"&dscy;"],[0,"&iukcy;"],[0,"&yicy;"],[0,"&jsercy;"],[0,"&ljcy;"],[0,"&njcy;"],[0,"&tshcy;"],[0,"&kjcy;"],[1,"&ubrcy;"],[0,"&dzcy;"],[7074,"&ensp;"],[0,"&emsp;"],[0,"&emsp13;"],[0,"&emsp14;"],[1,"&numsp;"],[0,"&puncsp;"],[0,"&ThinSpace;"],[0,"&hairsp;"],[0,"&NegativeMediumSpace;"],[0,"&zwnj;"],[0,"&zwj;"],[0,"&lrm;"],[0,"&rlm;"],[0,"&dash;"],[2,"&ndash;"],[0,"&mdash;"],[0,"&horbar;"],[0,"&Verbar;"],[1,"&lsquo;"],[0,"&CloseCurlyQuote;"],[0,"&lsquor;"],[1,"&ldquo;"],[0,"&CloseCurlyDoubleQuote;"],[0,"&bdquo;"],[1,"&dagger;"],[0,"&Dagger;"],[0,"&bull;"],[2,"&nldr;"],[0,"&hellip;"],[9,"&permil;"],[0,"&pertenk;"],[0,"&prime;"],[0,"&Prime;"],[0,"&tprime;"],[0,"&backprime;"],[3,"&lsaquo;"],[0,"&rsaquo;"],[3,"&oline;"],[2,"&caret;"],[1,"&hybull;"],[0,"&frasl;"],[10,"&bsemi;"],[7,"&qprime;"],[7,{v:"&MediumSpace;",n:8202,o:"&ThickSpace;"}],[0,"&NoBreak;"],[0,"&af;"],[0,"&InvisibleTimes;"],[0,"&ic;"],[72,"&euro;"],[46,"&tdot;"],[0,"&DotDot;"],[37,"&complexes;"],[2,"&incare;"],[4,"&gscr;"],[0,"&hamilt;"],[0,"&Hfr;"],[0,"&Hopf;"],[0,"&planckh;"],[0,"&hbar;"],[0,"&imagline;"],[0,"&Ifr;"],[0,"&lagran;"],[0,"&ell;"],[1,"&naturals;"],[0,"&numero;"],[0,"&copysr;"],[0,"&weierp;"],[0,"&Popf;"],[0,"&Qopf;"],[0,"&realine;"],[0,"&real;"],[0,"&reals;"],[0,"&rx;"],[3,"&trade;"],[1,"&integers;"],[2,"&mho;"],[0,"&zeetrf;"],[0,"&iiota;"],[2,"&bernou;"],[0,"&Cayleys;"],[1,"&escr;"],[0,"&Escr;"],[0,"&Fouriertrf;"],[1,"&Mellintrf;"],[0,"&order;"],[0,"&alefsym;"],[0,"&beth;"],[0,"&gimel;"],[0,"&daleth;"],[12,"&CapitalDifferentialD;"],[0,"&dd;"],[0,"&ee;"],[0,"&ii;"],[10,"&frac13;"],[0,"&frac23;"],[0,"&frac15;"],[0,"&frac25;"],[0,"&frac35;"],[0,"&frac45;"],[0,"&frac16;"],[0,"&frac56;"],[0,"&frac18;"],[0,"&frac38;"],[0,"&frac58;"],[0,"&frac78;"],[49,"&larr;"],[0,"&ShortUpArrow;"],[0,"&rarr;"],[0,"&darr;"],[0,"&harr;"],[0,"&updownarrow;"],[0,"&nwarr;"],[0,"&nearr;"],[0,"&LowerRightArrow;"],[0,"&LowerLeftArrow;"],[0,"&nlarr;"],[0,"&nrarr;"],[1,{v:"&rarrw;",n:824,o:"&nrarrw;"}],[0,"&Larr;"],[0,"&Uarr;"],[0,"&Rarr;"],[0,"&Darr;"],[0,"&larrtl;"],[0,"&rarrtl;"],[0,"&LeftTeeArrow;"],[0,"&mapstoup;"],[0,"&map;"],[0,"&DownTeeArrow;"],[1,"&hookleftarrow;"],[0,"&hookrightarrow;"],[0,"&larrlp;"],[0,"&looparrowright;"],[0,"&harrw;"],[0,"&nharr;"],[1,"&lsh;"],[0,"&rsh;"],[0,"&ldsh;"],[0,"&rdsh;"],[1,"&crarr;"],[0,"&cularr;"],[0,"&curarr;"],[2,"&circlearrowleft;"],[0,"&circlearrowright;"],[0,"&leftharpoonup;"],[0,"&DownLeftVector;"],[0,"&RightUpVector;"],[0,"&LeftUpVector;"],[0,"&rharu;"],[0,"&DownRightVector;"],[0,"&dharr;"],[0,"&dharl;"],[0,"&RightArrowLeftArrow;"],[0,"&udarr;"],[0,"&LeftArrowRightArrow;"],[0,"&leftleftarrows;"],[0,"&upuparrows;"],[0,"&rightrightarrows;"],[0,"&ddarr;"],[0,"&leftrightharpoons;"],[0,"&Equilibrium;"],[0,"&nlArr;"],[0,"&nhArr;"],[0,"&nrArr;"],[0,"&DoubleLeftArrow;"],[0,"&DoubleUpArrow;"],[0,"&DoubleRightArrow;"],[0,"&dArr;"],[0,"&DoubleLeftRightArrow;"],[0,"&DoubleUpDownArrow;"],[0,"&nwArr;"],[0,"&neArr;"],[0,"&seArr;"],[0,"&swArr;"],[0,"&lAarr;"],[0,"&rAarr;"],[1,"&zigrarr;"],[6,"&larrb;"],[0,"&rarrb;"],[15,"&DownArrowUpArrow;"],[7,"&loarr;"],[0,"&roarr;"],[0,"&hoarr;"],[0,"&forall;"],[0,"&comp;"],[0,{v:"&part;",n:824,o:"&npart;"}],[0,"&exist;"],[0,"&nexist;"],[0,"&empty;"],[1,"&Del;"],[0,"&Element;"],[0,"&NotElement;"],[1,"&ni;"],[0,"&notni;"],[2,"&prod;"],[0,"&coprod;"],[0,"&sum;"],[0,"&minus;"],[0,"&MinusPlus;"],[0,"&dotplus;"],[1,"&Backslash;"],[0,"&lowast;"],[0,"&compfn;"],[1,"&radic;"],[2,"&prop;"],[0,"&infin;"],[0,"&angrt;"],[0,{v:"&ang;",n:8402,o:"&nang;"}],[0,"&angmsd;"],[0,"&angsph;"],[0,"&mid;"],[0,"&nmid;"],[0,"&DoubleVerticalBar;"],[0,"&NotDoubleVerticalBar;"],[0,"&and;"],[0,"&or;"],[0,{v:"&cap;",n:65024,o:"&caps;"}],[0,{v:"&cup;",n:65024,o:"&cups;"}],[0,"&int;"],[0,"&Int;"],[0,"&iiint;"],[0,"&conint;"],[0,"&Conint;"],[0,"&Cconint;"],[0,"&cwint;"],[0,"&ClockwiseContourIntegral;"],[0,"&awconint;"],[0,"&there4;"],[0,"&becaus;"],[0,"&ratio;"],[0,"&Colon;"],[0,"&dotminus;"],[1,"&mDDot;"],[0,"&homtht;"],[0,{v:"&sim;",n:8402,o:"&nvsim;"}],[0,{v:"&backsim;",n:817,o:"&race;"}],[0,{v:"&ac;",n:819,o:"&acE;"}],[0,"&acd;"],[0,"&VerticalTilde;"],[0,"&NotTilde;"],[0,{v:"&eqsim;",n:824,o:"&nesim;"}],[0,"&sime;"],[0,"&NotTildeEqual;"],[0,"&cong;"],[0,"&simne;"],[0,"&ncong;"],[0,"&ap;"],[0,"&nap;"],[0,"&ape;"],[0,{v:"&apid;",n:824,o:"&napid;"}],[0,"&backcong;"],[0,{v:"&asympeq;",n:8402,o:"&nvap;"}],[0,{v:"&bump;",n:824,o:"&nbump;"}],[0,{v:"&bumpe;",n:824,o:"&nbumpe;"}],[0,{v:"&doteq;",n:824,o:"&nedot;"}],[0,"&doteqdot;"],[0,"&efDot;"],[0,"&erDot;"],[0,"&Assign;"],[0,"&ecolon;"],[0,"&ecir;"],[0,"&circeq;"],[1,"&wedgeq;"],[0,"&veeeq;"],[1,"&triangleq;"],[2,"&equest;"],[0,"&ne;"],[0,{v:"&Congruent;",n:8421,o:"&bnequiv;"}],[0,"&nequiv;"],[1,{v:"&le;",n:8402,o:"&nvle;"}],[0,{v:"&ge;",n:8402,o:"&nvge;"}],[0,{v:"&lE;",n:824,o:"&nlE;"}],[0,{v:"&gE;",n:824,o:"&ngE;"}],[0,{v:"&lnE;",n:65024,o:"&lvertneqq;"}],[0,{v:"&gnE;",n:65024,o:"&gvertneqq;"}],[0,{v:"&ll;",n:new Map(BPn([[824,"&nLtv;"],[7577,"&nLt;"]]))}],[0,{v:"&gg;",n:new Map(BPn([[824,"&nGtv;"],[7577,"&nGt;"]]))}],[0,"&between;"],[0,"&NotCupCap;"],[0,"&nless;"],[0,"&ngt;"],[0,"&nle;"],[0,"&nge;"],[0,"&lesssim;"],[0,"&GreaterTilde;"],[0,"&nlsim;"],[0,"&ngsim;"],[0,"&LessGreater;"],[0,"&gl;"],[0,"&NotLessGreater;"],[0,"&NotGreaterLess;"],[0,"&pr;"],[0,"&sc;"],[0,"&prcue;"],[0,"&sccue;"],[0,"&PrecedesTilde;"],[0,{v:"&scsim;",n:824,o:"&NotSucceedsTilde;"}],[0,"&NotPrecedes;"],[0,"&NotSucceeds;"],[0,{v:"&sub;",n:8402,o:"&NotSubset;"}],[0,{v:"&sup;",n:8402,o:"&NotSuperset;"}],[0,"&nsub;"],[0,"&nsup;"],[0,"&sube;"],[0,"&supe;"],[0,"&NotSubsetEqual;"],[0,"&NotSupersetEqual;"],[0,{v:"&subne;",n:65024,o:"&varsubsetneq;"}],[0,{v:"&supne;",n:65024,o:"&varsupsetneq;"}],[1,"&cupdot;"],[0,"&UnionPlus;"],[0,{v:"&sqsub;",n:824,o:"&NotSquareSubset;"}],[0,{v:"&sqsup;",n:824,o:"&NotSquareSuperset;"}],[0,"&sqsube;"],[0,"&sqsupe;"],[0,{v:"&sqcap;",n:65024,o:"&sqcaps;"}],[0,{v:"&sqcup;",n:65024,o:"&sqcups;"}],[0,"&CirclePlus;"],[0,"&CircleMinus;"],[0,"&CircleTimes;"],[0,"&osol;"],[0,"&CircleDot;"],[0,"&circledcirc;"],[0,"&circledast;"],[1,"&circleddash;"],[0,"&boxplus;"],[0,"&boxminus;"],[0,"&boxtimes;"],[0,"&dotsquare;"],[0,"&RightTee;"],[0,"&dashv;"],[0,"&DownTee;"],[0,"&bot;"],[1,"&models;"],[0,"&DoubleRightTee;"],[0,"&Vdash;"],[0,"&Vvdash;"],[0,"&VDash;"],[0,"&nvdash;"],[0,"&nvDash;"],[0,"&nVdash;"],[0,"&nVDash;"],[0,"&prurel;"],[1,"&LeftTriangle;"],[0,"&RightTriangle;"],[0,{v:"&LeftTriangleEqual;",n:8402,o:"&nvltrie;"}],[0,{v:"&RightTriangleEqual;",n:8402,o:"&nvrtrie;"}],[0,"&origof;"],[0,"&imof;"],[0,"&multimap;"],[0,"&hercon;"],[0,"&intcal;"],[0,"&veebar;"],[1,"&barvee;"],[0,"&angrtvb;"],[0,"&lrtri;"],[0,"&bigwedge;"],[0,"&bigvee;"],[0,"&bigcap;"],[0,"&bigcup;"],[0,"&diam;"],[0,"&sdot;"],[0,"&sstarf;"],[0,"&divideontimes;"],[0,"&bowtie;"],[0,"&ltimes;"],[0,"&rtimes;"],[0,"&leftthreetimes;"],[0,"&rightthreetimes;"],[0,"&backsimeq;"],[0,"&curlyvee;"],[0,"&curlywedge;"],[0,"&Sub;"],[0,"&Sup;"],[0,"&Cap;"],[0,"&Cup;"],[0,"&fork;"],[0,"&epar;"],[0,"&lessdot;"],[0,"&gtdot;"],[0,{v:"&Ll;",n:824,o:"&nLl;"}],[0,{v:"&Gg;",n:824,o:"&nGg;"}],[0,{v:"&leg;",n:65024,o:"&lesg;"}],[0,{v:"&gel;",n:65024,o:"&gesl;"}],[2,"&cuepr;"],[0,"&cuesc;"],[0,"&NotPrecedesSlantEqual;"],[0,"&NotSucceedsSlantEqual;"],[0,"&NotSquareSubsetEqual;"],[0,"&NotSquareSupersetEqual;"],[2,"&lnsim;"],[0,"&gnsim;"],[0,"&precnsim;"],[0,"&scnsim;"],[0,"&nltri;"],[0,"&NotRightTriangle;"],[0,"&nltrie;"],[0,"&NotRightTriangleEqual;"],[0,"&vellip;"],[0,"&ctdot;"],[0,"&utdot;"],[0,"&dtdot;"],[0,"&disin;"],[0,"&isinsv;"],[0,"&isins;"],[0,{v:"&isindot;",n:824,o:"&notindot;"}],[0,"&notinvc;"],[0,"&notinvb;"],[1,{v:"&isinE;",n:824,o:"&notinE;"}],[0,"&nisd;"],[0,"&xnis;"],[0,"&nis;"],[0,"&notnivc;"],[0,"&notnivb;"],[6,"&barwed;"],[0,"&Barwed;"],[1,"&lceil;"],[0,"&rceil;"],[0,"&LeftFloor;"],[0,"&rfloor;"],[0,"&drcrop;"],[0,"&dlcrop;"],[0,"&urcrop;"],[0,"&ulcrop;"],[0,"&bnot;"],[1,"&profline;"],[0,"&profsurf;"],[1,"&telrec;"],[0,"&target;"],[5,"&ulcorn;"],[0,"&urcorn;"],[0,"&dlcorn;"],[0,"&drcorn;"],[2,"&frown;"],[0,"&smile;"],[9,"&cylcty;"],[0,"&profalar;"],[7,"&topbot;"],[6,"&ovbar;"],[1,"&solbar;"],[60,"&angzarr;"],[51,"&lmoustache;"],[0,"&rmoustache;"],[2,"&OverBracket;"],[0,"&bbrk;"],[0,"&bbrktbrk;"],[37,"&OverParenthesis;"],[0,"&UnderParenthesis;"],[0,"&OverBrace;"],[0,"&UnderBrace;"],[2,"&trpezium;"],[4,"&elinters;"],[59,"&blank;"],[164,"&circledS;"],[55,"&boxh;"],[1,"&boxv;"],[9,"&boxdr;"],[3,"&boxdl;"],[3,"&boxur;"],[3,"&boxul;"],[3,"&boxvr;"],[7,"&boxvl;"],[7,"&boxhd;"],[7,"&boxhu;"],[7,"&boxvh;"],[19,"&boxH;"],[0,"&boxV;"],[0,"&boxdR;"],[0,"&boxDr;"],[0,"&boxDR;"],[0,"&boxdL;"],[0,"&boxDl;"],[0,"&boxDL;"],[0,"&boxuR;"],[0,"&boxUr;"],[0,"&boxUR;"],[0,"&boxuL;"],[0,"&boxUl;"],[0,"&boxUL;"],[0,"&boxvR;"],[0,"&boxVr;"],[0,"&boxVR;"],[0,"&boxvL;"],[0,"&boxVl;"],[0,"&boxVL;"],[0,"&boxHd;"],[0,"&boxhD;"],[0,"&boxHD;"],[0,"&boxHu;"],[0,"&boxhU;"],[0,"&boxHU;"],[0,"&boxvH;"],[0,"&boxVh;"],[0,"&boxVH;"],[19,"&uhblk;"],[3,"&lhblk;"],[3,"&block;"],[8,"&blk14;"],[0,"&blk12;"],[0,"&blk34;"],[13,"&square;"],[8,"&blacksquare;"],[0,"&EmptyVerySmallSquare;"],[1,"&rect;"],[0,"&marker;"],[2,"&fltns;"],[1,"&bigtriangleup;"],[0,"&blacktriangle;"],[0,"&triangle;"],[2,"&blacktriangleright;"],[0,"&rtri;"],[3,"&bigtriangledown;"],[0,"&blacktriangledown;"],[0,"&dtri;"],[2,"&blacktriangleleft;"],[0,"&ltri;"],[6,"&loz;"],[0,"&cir;"],[32,"&tridot;"],[2,"&bigcirc;"],[8,"&ultri;"],[0,"&urtri;"],[0,"&lltri;"],[0,"&EmptySmallSquare;"],[0,"&FilledSmallSquare;"],[8,"&bigstar;"],[0,"&star;"],[7,"&phone;"],[49,"&female;"],[1,"&male;"],[29,"&spades;"],[2,"&clubs;"],[1,"&hearts;"],[0,"&diamondsuit;"],[3,"&sung;"],[2,"&flat;"],[0,"&natural;"],[0,"&sharp;"],[163,"&check;"],[3,"&cross;"],[8,"&malt;"],[21,"&sext;"],[33,"&VerticalSeparator;"],[25,"&lbbrk;"],[0,"&rbbrk;"],[84,"&bsolhsub;"],[0,"&suphsol;"],[28,"&LeftDoubleBracket;"],[0,"&RightDoubleBracket;"],[0,"&lang;"],[0,"&rang;"],[0,"&Lang;"],[0,"&Rang;"],[0,"&loang;"],[0,"&roang;"],[7,"&longleftarrow;"],[0,"&longrightarrow;"],[0,"&longleftrightarrow;"],[0,"&DoubleLongLeftArrow;"],[0,"&DoubleLongRightArrow;"],[0,"&DoubleLongLeftRightArrow;"],[1,"&longmapsto;"],[2,"&dzigrarr;"],[258,"&nvlArr;"],[0,"&nvrArr;"],[0,"&nvHarr;"],[0,"&Map;"],[6,"&lbarr;"],[0,"&bkarow;"],[0,"&lBarr;"],[0,"&dbkarow;"],[0,"&drbkarow;"],[0,"&DDotrahd;"],[0,"&UpArrowBar;"],[0,"&DownArrowBar;"],[2,"&Rarrtl;"],[2,"&latail;"],[0,"&ratail;"],[0,"&lAtail;"],[0,"&rAtail;"],[0,"&larrfs;"],[0,"&rarrfs;"],[0,"&larrbfs;"],[0,"&rarrbfs;"],[2,"&nwarhk;"],[0,"&nearhk;"],[0,"&hksearow;"],[0,"&hkswarow;"],[0,"&nwnear;"],[0,"&nesear;"],[0,"&seswar;"],[0,"&swnwar;"],[8,{v:"&rarrc;",n:824,o:"&nrarrc;"}],[1,"&cudarrr;"],[0,"&ldca;"],[0,"&rdca;"],[0,"&cudarrl;"],[0,"&larrpl;"],[2,"&curarrm;"],[0,"&cularrp;"],[7,"&rarrpl;"],[2,"&harrcir;"],[0,"&Uarrocir;"],[0,"&lurdshar;"],[0,"&ldrushar;"],[2,"&LeftRightVector;"],[0,"&RightUpDownVector;"],[0,"&DownLeftRightVector;"],[0,"&LeftUpDownVector;"],[0,"&LeftVectorBar;"],[0,"&RightVectorBar;"],[0,"&RightUpVectorBar;"],[0,"&RightDownVectorBar;"],[0,"&DownLeftVectorBar;"],[0,"&DownRightVectorBar;"],[0,"&LeftUpVectorBar;"],[0,"&LeftDownVectorBar;"],[0,"&LeftTeeVector;"],[0,"&RightTeeVector;"],[0,"&RightUpTeeVector;"],[0,"&RightDownTeeVector;"],[0,"&DownLeftTeeVector;"],[0,"&DownRightTeeVector;"],[0,"&LeftUpTeeVector;"],[0,"&LeftDownTeeVector;"],[0,"&lHar;"],[0,"&uHar;"],[0,"&rHar;"],[0,"&dHar;"],[0,"&luruhar;"],[0,"&ldrdhar;"],[0,"&ruluhar;"],[0,"&rdldhar;"],[0,"&lharul;"],[0,"&llhard;"],[0,"&rharul;"],[0,"&lrhard;"],[0,"&udhar;"],[0,"&duhar;"],[0,"&RoundImplies;"],[0,"&erarr;"],[0,"&simrarr;"],[0,"&larrsim;"],[0,"&rarrsim;"],[0,"&rarrap;"],[0,"&ltlarr;"],[1,"&gtrarr;"],[0,"&subrarr;"],[1,"&suplarr;"],[0,"&lfisht;"],[0,"&rfisht;"],[0,"&ufisht;"],[0,"&dfisht;"],[5,"&lopar;"],[0,"&ropar;"],[4,"&lbrke;"],[0,"&rbrke;"],[0,"&lbrkslu;"],[0,"&rbrksld;"],[0,"&lbrksld;"],[0,"&rbrkslu;"],[0,"&langd;"],[0,"&rangd;"],[0,"&lparlt;"],[0,"&rpargt;"],[0,"&gtlPar;"],[0,"&ltrPar;"],[3,"&vzigzag;"],[1,"&vangrt;"],[0,"&angrtvbd;"],[6,"&ange;"],[0,"&range;"],[0,"&dwangle;"],[0,"&uwangle;"],[0,"&angmsdaa;"],[0,"&angmsdab;"],[0,"&angmsdac;"],[0,"&angmsdad;"],[0,"&angmsdae;"],[0,"&angmsdaf;"],[0,"&angmsdag;"],[0,"&angmsdah;"],[0,"&bemptyv;"],[0,"&demptyv;"],[0,"&cemptyv;"],[0,"&raemptyv;"],[0,"&laemptyv;"],[0,"&ohbar;"],[0,"&omid;"],[0,"&opar;"],[1,"&operp;"],[1,"&olcross;"],[0,"&odsold;"],[1,"&olcir;"],[0,"&ofcir;"],[0,"&olt;"],[0,"&ogt;"],[0,"&cirscir;"],[0,"&cirE;"],[0,"&solb;"],[0,"&bsolb;"],[3,"&boxbox;"],[3,"&trisb;"],[0,"&rtriltri;"],[0,{v:"&LeftTriangleBar;",n:824,o:"&NotLeftTriangleBar;"}],[0,{v:"&RightTriangleBar;",n:824,o:"&NotRightTriangleBar;"}],[11,"&iinfin;"],[0,"&infintie;"],[0,"&nvinfin;"],[4,"&eparsl;"],[0,"&smeparsl;"],[0,"&eqvparsl;"],[5,"&blacklozenge;"],[8,"&RuleDelayed;"],[1,"&dsol;"],[9,"&bigodot;"],[0,"&bigoplus;"],[0,"&bigotimes;"],[1,"&biguplus;"],[1,"&bigsqcup;"],[5,"&iiiint;"],[0,"&fpartint;"],[2,"&cirfnint;"],[0,"&awint;"],[0,"&rppolint;"],[0,"&scpolint;"],[0,"&npolint;"],[0,"&pointint;"],[0,"&quatint;"],[0,"&intlarhk;"],[10,"&pluscir;"],[0,"&plusacir;"],[0,"&simplus;"],[0,"&plusdu;"],[0,"&plussim;"],[0,"&plustwo;"],[1,"&mcomma;"],[0,"&minusdu;"],[2,"&loplus;"],[0,"&roplus;"],[0,"&Cross;"],[0,"&timesd;"],[0,"&timesbar;"],[1,"&smashp;"],[0,"&lotimes;"],[0,"&rotimes;"],[0,"&otimesas;"],[0,"&Otimes;"],[0,"&odiv;"],[0,"&triplus;"],[0,"&triminus;"],[0,"&tritime;"],[0,"&intprod;"],[2,"&amalg;"],[0,"&capdot;"],[1,"&ncup;"],[0,"&ncap;"],[0,"&capand;"],[0,"&cupor;"],[0,"&cupcap;"],[0,"&capcup;"],[0,"&cupbrcap;"],[0,"&capbrcup;"],[0,"&cupcup;"],[0,"&capcap;"],[0,"&ccups;"],[0,"&ccaps;"],[2,"&ccupssm;"],[2,"&And;"],[0,"&Or;"],[0,"&andand;"],[0,"&oror;"],[0,"&orslope;"],[0,"&andslope;"],[1,"&andv;"],[0,"&orv;"],[0,"&andd;"],[0,"&ord;"],[1,"&wedbar;"],[6,"&sdote;"],[3,"&simdot;"],[2,{v:"&congdot;",n:824,o:"&ncongdot;"}],[0,"&easter;"],[0,"&apacir;"],[0,{v:"&apE;",n:824,o:"&napE;"}],[0,"&eplus;"],[0,"&pluse;"],[0,"&Esim;"],[0,"&Colone;"],[0,"&Equal;"],[1,"&ddotseq;"],[0,"&equivDD;"],[0,"&ltcir;"],[0,"&gtcir;"],[0,"&ltquest;"],[0,"&gtquest;"],[0,{v:"&leqslant;",n:824,o:"&nleqslant;"}],[0,{v:"&geqslant;",n:824,o:"&ngeqslant;"}],[0,"&lesdot;"],[0,"&gesdot;"],[0,"&lesdoto;"],[0,"&gesdoto;"],[0,"&lesdotor;"],[0,"&gesdotol;"],[0,"&lap;"],[0,"&gap;"],[0,"&lne;"],[0,"&gne;"],[0,"&lnap;"],[0,"&gnap;"],[0,"&lEg;"],[0,"&gEl;"],[0,"&lsime;"],[0,"&gsime;"],[0,"&lsimg;"],[0,"&gsiml;"],[0,"&lgE;"],[0,"&glE;"],[0,"&lesges;"],[0,"&gesles;"],[0,"&els;"],[0,"&egs;"],[0,"&elsdot;"],[0,"&egsdot;"],[0,"&el;"],[0,"&eg;"],[2,"&siml;"],[0,"&simg;"],[0,"&simlE;"],[0,"&simgE;"],[0,{v:"&LessLess;",n:824,o:"&NotNestedLessLess;"}],[0,{v:"&GreaterGreater;",n:824,o:"&NotNestedGreaterGreater;"}],[1,"&glj;"],[0,"&gla;"],[0,"&ltcc;"],[0,"&gtcc;"],[0,"&lescc;"],[0,"&gescc;"],[0,"&smt;"],[0,"&lat;"],[0,{v:"&smte;",n:65024,o:"&smtes;"}],[0,{v:"&late;",n:65024,o:"&lates;"}],[0,"&bumpE;"],[0,{v:"&PrecedesEqual;",n:824,o:"&NotPrecedesEqual;"}],[0,{v:"&sce;",n:824,o:"&NotSucceedsEqual;"}],[2,"&prE;"],[0,"&scE;"],[0,"&precneqq;"],[0,"&scnE;"],[0,"&prap;"],[0,"&scap;"],[0,"&precnapprox;"],[0,"&scnap;"],[0,"&Pr;"],[0,"&Sc;"],[0,"&subdot;"],[0,"&supdot;"],[0,"&subplus;"],[0,"&supplus;"],[0,"&submult;"],[0,"&supmult;"],[0,"&subedot;"],[0,"&supedot;"],[0,{v:"&subE;",n:824,o:"&nsubE;"}],[0,{v:"&supE;",n:824,o:"&nsupE;"}],[0,"&subsim;"],[0,"&supsim;"],[2,{v:"&subnE;",n:65024,o:"&varsubsetneqq;"}],[0,{v:"&supnE;",n:65024,o:"&varsupsetneqq;"}],[2,"&csub;"],[0,"&csup;"],[0,"&csube;"],[0,"&csupe;"],[0,"&subsup;"],[0,"&supsub;"],[0,"&subsub;"],[0,"&supsup;"],[0,"&suphsub;"],[0,"&supdsub;"],[0,"&forkv;"],[0,"&topfork;"],[0,"&mlcp;"],[8,"&Dashv;"],[1,"&Vdashl;"],[0,"&Barv;"],[0,"&vBar;"],[0,"&vBarv;"],[1,"&Vbar;"],[0,"&Not;"],[0,"&bNot;"],[0,"&rnmid;"],[0,"&cirmid;"],[0,"&midcir;"],[0,"&topcir;"],[0,"&nhpar;"],[0,"&parsim;"],[9,{v:"&parsl;",n:8421,o:"&nparsl;"}],[44343,{n:new Map(BPn([[56476,"&Ascr;"],[1,"&Cscr;"],[0,"&Dscr;"],[2,"&Gscr;"],[2,"&Jscr;"],[0,"&Kscr;"],[2,"&Nscr;"],[0,"&Oscr;"],[0,"&Pscr;"],[0,"&Qscr;"],[1,"&Sscr;"],[0,"&Tscr;"],[0,"&Uscr;"],[0,"&Vscr;"],[0,"&Wscr;"],[0,"&Xscr;"],[0,"&Yscr;"],[0,"&Zscr;"],[0,"&ascr;"],[0,"&bscr;"],[0,"&cscr;"],[0,"&dscr;"],[1,"&fscr;"],[1,"&hscr;"],[0,"&iscr;"],[0,"&jscr;"],[0,"&kscr;"],[0,"&lscr;"],[0,"&mscr;"],[0,"&nscr;"],[1,"&pscr;"],[0,"&qscr;"],[0,"&rscr;"],[0,"&sscr;"],[0,"&tscr;"],[0,"&uscr;"],[0,"&vscr;"],[0,"&wscr;"],[0,"&xscr;"],[0,"&yscr;"],[0,"&zscr;"],[52,"&Afr;"],[0,"&Bfr;"],[1,"&Dfr;"],[0,"&Efr;"],[0,"&Ffr;"],[0,"&Gfr;"],[2,"&Jfr;"],[0,"&Kfr;"],[0,"&Lfr;"],[0,"&Mfr;"],[0,"&Nfr;"],[0,"&Ofr;"],[0,"&Pfr;"],[0,"&Qfr;"],[1,"&Sfr;"],[0,"&Tfr;"],[0,"&Ufr;"],[0,"&Vfr;"],[0,"&Wfr;"],[0,"&Xfr;"],[0,"&Yfr;"],[1,"&afr;"],[0,"&bfr;"],[0,"&cfr;"],[0,"&dfr;"],[0,"&efr;"],[0,"&ffr;"],[0,"&gfr;"],[0,"&hfr;"],[0,"&ifr;"],[0,"&jfr;"],[0,"&kfr;"],[0,"&lfr;"],[0,"&mfr;"],[0,"&nfr;"],[0,"&ofr;"],[0,"&pfr;"],[0,"&qfr;"],[0,"&rfr;"],[0,"&sfr;"],[0,"&tfr;"],[0,"&ufr;"],[0,"&vfr;"],[0,"&wfr;"],[0,"&xfr;"],[0,"&yfr;"],[0,"&zfr;"],[0,"&Aopf;"],[0,"&Bopf;"],[1,"&Dopf;"],[0,"&Eopf;"],[0,"&Fopf;"],[0,"&Gopf;"],[1,"&Iopf;"],[0,"&Jopf;"],[0,"&Kopf;"],[0,"&Lopf;"],[0,"&Mopf;"],[1,"&Oopf;"],[3,"&Sopf;"],[0,"&Topf;"],[0,"&Uopf;"],[0,"&Vopf;"],[0,"&Wopf;"],[0,"&Xopf;"],[0,"&Yopf;"],[1,"&aopf;"],[0,"&bopf;"],[0,"&copf;"],[0,"&dopf;"],[0,"&eopf;"],[0,"&fopf;"],[0,"&gopf;"],[0,"&hopf;"],[0,"&iopf;"],[0,"&jopf;"],[0,"&kopf;"],[0,"&lopf;"],[0,"&mopf;"],[0,"&nopf;"],[0,"&oopf;"],[0,"&popf;"],[0,"&qopf;"],[0,"&ropf;"],[0,"&sopf;"],[0,"&topf;"],[0,"&uopf;"],[0,"&vopf;"],[0,"&wopf;"],[0,"&xopf;"],[0,"&yopf;"],[0,"&zopf;"]]))}],[8906,"&fflig;"],[0,"&filig;"],[0,"&fllig;"],[0,"&ffilig;"],[0,"&ffllig;"]]));var oko=/["&'<>$\x80-\uFFFF]/g,wFa=new Map([[34,"&quot;"],[38,"&amp;"],[39,"&apos;"],[60,"&lt;"],[62,"&gt;"]]),PFa=String.prototype.codePointAt!=null?(r,t)=>r.codePointAt(t):(r,t)=>(r.charCodeAt(t)&64512)===55296?(r.charCodeAt(t)-55296)*1024+r.charCodeAt(t+1)-56320+65536:r.charCodeAt(t);function Odt(r){let t="",n=0,i;for(;(i=oko.exec(r))!==null;){let o=i.index,s=r.charCodeAt(o),a=wFa.get(s);a!==void 0?(t+=r.substring(n,o)+a,n=o+1):(t+=`${r.substring(n,o)}&#x${PFa(r,o).toString(16)};`,n=oko.lastIndex+=+((s&64512)===55296))}return t+r.substr(n)}function sko(r,t){return function(i){let o,s=0,a="";for(;o=r.exec(i);)s!==o.index&&(a+=i.substring(s,o.index)),a+=t.get(o[0].charCodeAt(0)),s=o.index+1;return a+i.substring(s)}}var NFa=sko(/[&<>'"]/g,wFa),kPn=sko(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),LPn=sko(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]]));var DFa;(function(r){r[r.XML=0]="XML",r[r.HTML=1]="HTML"})(DFa||(DFa={}));var xFa;(function(r){r[r.UTF8=0]="UTF8",r[r.ASCII=1]="ASCII",r[r.Extensive=2]="Extensive",r[r.Attribute=3]="Attribute",r[r.Text=4]="Text"})(xFa||(xFa={}));var LFa=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(r=>[r.toLowerCase(),r])),qFa=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(r=>[r.toLowerCase(),r]));var lj0=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);function dj0(r){return r.replace(/"/g,"&quot;")}function pj0(r,t){var n;if(!r)return;let i=((n=t.encodeEntities)!==null&&n!==void 0?n:t.decodeEntities)===!1?dj0:t.xmlMode||t.encodeEntities!=="utf8"?Odt:kPn;return Object.keys(r).map(o=>{var s,a;let u=(s=r[o])!==null&&s!==void 0?s:"";return t.xmlMode==="foreign"&&(o=(a=qFa.get(o))!==null&&a!==void 0?a:o),!t.emptyAttrs&&!t.xmlMode&&u===""?o:`${o}="${i(u)}"`}).join(" ")}var zFa=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);function Rdt(r,t={}){let n="length"in r?r:[r],i="";for(let o=0;o<n.length;o++)i+=fj0(n[o],t);return i}function fj0(r,t){switch(r.type){case jza:return Rdt(r.children,t);case $za:case Hza:return mj0(r);case Wza:return Ej0(r);case Jza:return bj0(r);case Vza:case Kza:case Yza:return gj0(r,t);case Gza:return yj0(r,t)}}var Aj0=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),hj0=new Set(["svg","math"]);function gj0(r,t){var n;t.xmlMode==="foreign"&&(r.name=(n=LFa.get(r.name))!==null&&n!==void 0?n:r.name,r.parent&&Aj0.has(r.parent.name)&&(t={...t,xmlMode:!1})),!t.xmlMode&&hj0.has(r.name)&&(t={...t,xmlMode:"foreign"});let i=`<${r.name}`,o=pj0(r.attribs,t);return o&&(i+=` ${o}`),r.children.length===0&&(t.xmlMode?t.selfClosingTags!==!1:t.selfClosingTags&&zFa.has(r.name))?(t.xmlMode||(i+=" "),i+="/>"):(i+=">",r.children.length>0&&(i+=Rdt(r.children,t)),(t.xmlMode||!zFa.has(r.name))&&(i+=`</${r.name}>`)),i}function mj0(r){return`<${r.data}>`}function yj0(r,t){var n;let i=r.data||"";return((n=t.encodeEntities)!==null&&n!==void 0?n:t.decodeEntities)!==!1&&!(!t.xmlMode&&r.parent&&lj0.has(r.parent.name))&&(i=t.xmlMode||t.encodeEntities!=="utf8"?Odt(i):LPn(i)),i}function bj0(r){return`<![CDATA[${r.children[0].data}]]>`}function Ej0(r){return`<!--${r.data}-->`}var FFa;(function(r){r[r.DISCONNECTED=1]="DISCONNECTED",r[r.PRECEDING=2]="PRECEDING",r[r.FOLLOWING=4]="FOLLOWING",r[r.CONTAINS=8]="CONTAINS",r[r.CONTAINED_BY=16]="CONTAINED_BY"})(FFa||(FFa={}));function QFa(r,t){let n=new vPn(void 0,t);return new xPn(n,t).end(r),n.root}var hko=_t(HFa(),1);function gko(r,t,n=()=>{}){if(r===void 0){let i=function(...o){return t(i,...o)};return i}return r>=0?function(...i){return t(gko(r-1,t,n),...i)}:n}function JFa(r,t){let n=0,i=r.length;for(;n<i&&r[n]===t;)++n;for(;i>n&&r[i-1]===t;)--i;return n>0||i<r.length?r.substring(n,i):r}function Bj0(r,t){let n=r.length;for(;n>0&&r[n-1]===t;)--n;return n<r.length?r.substring(0,n):r}function kj0(r){return r.replace(/[\s\S]/g,t=>"\\u"+t.charCodeAt().toString(16).padStart(4,"0"))}function $Fa(r,t){let n=new Map;for(let i=r.length;i-- >0;){let o=r[i],s=t(o);n.set(s,n.has(s)?(0,hko.default)(o,n.get(s),{arrayMerge:Lj0}):o)}return[...n.values()].reverse()}var Lj0=(r,t,n)=>[...t];function D6e(r,t){for(let n of t){if(!r)return;r=r[n]}return r}function WFa(r,t="a",n=26){let i=[];do r-=1,i.push(r%n),r=r/n>>0;while(r>0);let o=t.charCodeAt(0);return i.reverse().map(s=>String.fromCharCode(o+s)).join("")}var cko=["I","X","C","M"],VFa=["V","L","D"];function KFa(r){return[...r+""].map(t=>+t).reverse().map((t,n)=>t%5<4?(t<5?"":VFa[n])+cko[n].repeat(t%5):cko[n]+(t<5?VFa[n]:cko[n+1])).reverse().join("")}var FPn=class{constructor(t,n=void 0){this.lines=[],this.nextLineWords=[],this.maxLineLength=n||t.wordwrap||Number.MAX_VALUE,this.nextLineAvailableChars=this.maxLineLength,this.wrapCharacters=D6e(t,["longWordSplit","wrapCharacters"])||[],this.forceWrapOnLimit=D6e(t,["longWordSplit","forceWrapOnLimit"])||!1,this.stashedSpace=!1,this.wordBreakOpportunity=!1}pushWord(t,n=!1){this.nextLineAvailableChars<=0&&!n&&this.startNewLine();let i=this.nextLineWords.length===0,o=t.length+(i?0:1);if(o<=this.nextLineAvailableChars||n)this.nextLineWords.push(t),this.nextLineAvailableChars-=o;else{let[s,...a]=this.splitLongWord(t);i||this.startNewLine(),this.nextLineWords.push(s),this.nextLineAvailableChars-=s.length;for(let u of a)this.startNewLine(),this.nextLineWords.push(u),this.nextLineAvailableChars-=u.length}}popWord(){let t=this.nextLineWords.pop();if(t!==void 0){let n=this.nextLineWords.length===0,i=t.length+(n?0:1);this.nextLineAvailableChars+=i}return t}concatWord(t,n=!1){if(this.wordBreakOpportunity&&t.length>this.nextLineAvailableChars)this.pushWord(t,n),this.wordBreakOpportunity=!1;else{let i=this.popWord();this.pushWord(i?i.concat(t):t,n)}}startNewLine(t=1){this.lines.push(this.nextLineWords),t>1&&this.lines.push(...Array.from({length:t-1},()=>[])),this.nextLineWords=[],this.nextLineAvailableChars=this.maxLineLength}isEmpty(){return this.lines.length===0&&this.nextLineWords.length===0}clear(){this.lines.length=0,this.nextLineWords.length=0,this.nextLineAvailableChars=this.maxLineLength}toString(){return[...this.lines,this.nextLineWords].map(t=>t.join(" ")).join(`
@@ -2028,10 +2028,10 @@ user has a role but the role grants to environment permissions to a specified en
2028
2028
  `).optional()}).passthrough(),GCf=M.object({userRoles:M.array(Hft)}),HCf=M.object({environmentRole:M.string().describe("The environment role to set"),setDefaultProjectRole:M.string().describe(`If set, if the user has no role for the environment's project, it will be set to this role. If this
2029
2029
  is not set and the user has no role assigned for the environment's project, the response will be an
2030
2030
  HTTP 403 error
2031
- `).optional()}).passthrough(),wWo=M.object({updatedBy:M.string().optional(),updatedAt:M.string().datetime({offset:!0}).optional(),name:M.string(),publisherID:M.string(),description:M.string(),org:M.string(),latestRelease:M.string(),overview:M.string(),featured:M.boolean(),tags:M.array(M.string()),certified:M.boolean(),packageID:M.string(),id:M.string(),platformKind:M.enum(["fabric","snowflake","databricks","bigquery"])}).passthrough(),i8n=M.object({createdAt:M.string().datetime({offset:!0}),createdBy:M.string().optional(),updatedBy:M.string().optional(),updatedAt:M.string().datetime({offset:!0}),version:M.string(),changeLog:M.string(),releaseID:M.string(),storagePath:M.string(),privacy:M.enum(["public","private","unlisted"])}).passthrough(),WCf=M.object({description:M.string(),overview:M.string().max(200),tags:M.array(M.string()),featured:M.boolean(),certified:M.boolean()}).passthrough(),s8n=M.enum(["snowflake","fabric","databricks","bigquery"]),VCf=M.object({changeLog:M.string().min(1),privacy:M.enum(["public","private","unlisted"])}).passthrough(),KCf=M.object({name:M.string(),description:M.string(),overview:M.string().max(200),tags:M.array(M.string()),featured:M.boolean(),certified:M.boolean(),platformKind:M.enum(["snowflake","fabric","databricks","bigquery"])}).passthrough(),YCf=M.object({changeLog:M.string(),version:M.string(),certified:M.boolean().optional()}).passthrough(),qWo=M.lazy(()=>M.object({packageID:M.string().min(1),alias:M.string(),version:M.string(),releaseID:M.string().min(1),macros:M.string(),dependencies:M.record(qWo)}).passthrough()),Ksu=M.object({name:M.string(),version:M.number(),id:M.string(),isDisabled:M.boolean(),metadata:M.object({}).partial().passthrough()}).passthrough(),JCf=M.object({dependencies:M.record(qWo),nodeTypes:M.record(Ksu),macros:M.string()}).passthrough(),$Cf=M.object({release:YCf.describe("Package release information for a create operation."),privacy:M.enum(["public","private","unlisted"]),entities:JCf.describe("Entities that are part of a package release."),packageVariables:M.string(),packageID:M.string().min(1)}).passthrough(),XCf=M.object({packageID:M.string().min(1),releaseID:M.string().min(1),changeLog:M.string().optional(),description:M.string().optional(),privacy:M.enum(["public","private","unlisted"]).optional()}).passthrough(),ZCf=M.object({typesenseKey:M.string().describe("The Typesense access key scoped to a users org."),typesenseHosts:M.array(M.string()).describe("The Typesense host address(es) for our cluster(s).")}).passthrough(),eSf=M.union([M.number(),M.string()]).describe("The starting run ID, runStartTime, or runEndTime (exclusive) for paging the query results.").optional(),tSf=M.union([M.string(),M.array(M.string())]).describe("One or more project IDs to filter the query results.").optional(),u8n=M.enum(["deploy","refresh"]),rSf=M.union([u8n,M.array(u8n)]).describe("One or more run types to filter the query results.").optional(),c8n=M.enum(["canceled","completed","failed","initializing","rendering","running","waitingToRun"]),nSf=M.union([c8n,M.array(c8n)]).describe("One or more status values to filter the query results.").optional(),iSf=M.union([M.string(),M.array(M.string())]).describe("One or more environment IDs to filter the query results.").optional(),oSf=M.enum(["asc","desc"]),sSf=M.enum(["id","runStartTime","runEndTime"]),aSf=M.object({id:M.number().int().describe("The run ID."),reRunID:M.string().describe("If this is a re-run, the ID of the original operation.").optional(),runStartTime:M.string().datetime({offset:!0}).describe("The datetime the run started.").optional(),runEndTime:M.string().datetime({offset:!0}).describe("The datetime the run ended.").optional(),runType:u8n,runStatus:c8n,environmentID:M.string().describe("The environment in which the run operation was applied.").optional(),runFailureReason:M.string().describe("Information about the cause of a run failure.").optional()}).passthrough(),uSf=M.object({canceled:M.boolean().describe("If the run was canceled.").optional(),deployCommit:M.string().describe("The full commit hash."),deployCommitMessage:M.string().describe("The commit message.").optional(),environmentID:M.string().describe("The Environment ID for this run."),parallelism:M.number().int().describe("The parallelism parameter determines how many nodes are processed simultaneously (in parallel) by the Snowflake compute warehouse.").optional(),nodesInRun:M.number().int().describe("The number of Nodes deployed.").optional()}),cSf=M.object({canceled:M.boolean().describe("If the run was canceled.").optional(),environmentID:M.string().describe("The Environment ID for this run."),excludeNodesSelector:M.string().describe("A selector string of nodes to exclude.").optional(),forceIgnoreEnvironmentStatus:M.boolean().optional(),includeNodesSelector:M.string().describe("A selector string of nodes to include.").optional(),jobID:M.number().int().describe("The Job ID.").optional(),parallelism:M.number().int().describe("The parallelism parameter determines how many nodes are processed simultaneously (in parallel) by the Snowflake compute warehouse.").optional(),refreshDescription:M.string().describe("The Job name.").optional(),nodesForRefresh:M.number().int().optional(),nodesInRun:M.number().int().describe("The number of Nodes deployed.").optional(),executor:M.string().optional()}),lSf=M.union([uSf,cSf]),dSf=M.enum(["Basic","Cloud","KeyPair","OAuth"]),pSf=M.object({snowflakeAccount:M.string(),snowflakeAuthType:dSf,snowflakeRole:M.string().optional(),snowflakeUsername:M.string(),snowflakeWarehouse:M.string().optional()}),fSf=M.enum(["Token","Cloud","OAuthU2M","OAuthM2M"]),ASf=M.object({databricksHost:M.string(),databricksAuthType:fSf,databricksPath:M.string()}),hSf=M.literal("oauth"),gSf=M.object({fabricConnectionString:M.string(),fabricAuthType:hSf,platformKind:M.string().optional()}),mSf=M.enum(["ServiceAccount","OAuth"]),ySf=M.object({bigQueryAuthType:mSf}),Ysu=M.object({id:M.number().int(),reRunID:M.string().describe("If this is a re-run, the ID of the original operation.").optional(),runDetails:lSf.describe("Detailed information about a run."),runEndTime:M.string().datetime({offset:!0}).describe("The datetime when the run ended.").optional(),runFailureReason:M.string().describe("The reason the run failed.").optional(),runHistory:M.array(M.number().int()).optional(),runStartTime:M.string().datetime({offset:!0}).describe("The datetime the run started.").optional(),runStatus:c8n,runTimeParameters:M.object({}).partial().passthrough().describe("The default Environment parameters. Parameters changed during deploy will not show here."),runType:u8n,userCredentials:M.union([pSf,ASf,gSf,ySf]).optional(),userID:M.string().optional(),projectID:M.string(),hasTestFailures:M.boolean().describe("Whether the run has test failures.").optional(),version:M.number().int().optional(),renderingProgress:M.object({totalNodes:M.number().int().gte(0).describe("Total number of nodes to render"),completedNodes:M.number().int().gte(0).describe("Number of nodes completed so far")}).passthrough().describe("Progress information for the rendering phase").optional()}),bSf=M.object({limit:M.number().int().describe("The maximum number of runs returned by this query."),next:M.union([M.number(),M.string(),M.null()]).describe("The field value representing the start of the next page of results."),orderByDirection:oSf.describe("The sort order for query results."),orderBy:sSf.describe("The field used to sort query results. Defaults to `id`, but must be explicitly provided when also using `startingFrom`. Make sure to match data type."),data:M.union([M.array(aSf),M.array(Ysu)]).describe("A collection of runs.")}).passthrough(),ESf=M.enum(["API","CLI","UI","fivetranAPI"]),wsu=M.object({endTime:M.string().datetime({offset:!0}).optional(),error:Dsu.optional(),isRunning:M.boolean().describe("If the queried run is still running."),name:M.string().describe("The name of the Stage the query ran on."),queryID:M.string().optional(),rowsDeleted:M.number().int().optional(),rowsInserted:M.number().int().optional(),rowsUpdated:M.number().int().optional(),sql:M.string().describe("The SQL query run during the stage."),startTime:M.string().datetime({offset:!0}).optional(),status:M.string().describe("The query status."),success:M.boolean().describe("If the query results were run successfully."),type:M.enum(["sql","sqlTest"]).optional(),warehouse:M.string().describe("Name of the warehouse.").optional()}),CSf=M.object({isRunning:M.boolean().describe("If the queried run is still running."),name:M.string(),nodeID:M.string(),runState:M.string().optional(),hasTestFailures:M.boolean().optional(),origin:ESf.optional(),queryResults:M.array(wsu).describe("The query result returns the status of different stages such as Delete Table or Rename Table. See the queryResults name for the stage."),renderQueryResult:wsu.optional()}),SSf=M.object({data:M.array(CSf).describe("A collection of run results.")}).passthrough(),NWo=M.object({endTime:M.string().datetime({offset:!0}),error:M.object({errorString:M.string(),errorDetail:M.string()}).passthrough().nullish(),fields:M.array(M.object({name:M.string(),type:M.string()}).passthrough()),isRunning:M.boolean(),name:M.string(),sql:M.string(),startTime:M.string().datetime({offset:!0}),status:M.enum(["Success","Failure","Canceled","Queued","Running","Transaction exceeded data limit, returned a subset of rows"]),success:M.boolean(),type:M.enum(["sql","sqlTest"]),exportedRefs:M.array(M.object({locationName:M.string(),nodeName:M.string()}).passthrough()),invalidExportedRefs:M.array(M.object({locationName:M.string(),nodeName:M.string()}).passthrough())}).passthrough(),_Sf=M.object({name:M.string(),isRunning:M.literal(!0)}),vSf=M.object({name:M.string(),queryResults:M.array(M.union([NWo,_Sf])),isRunning:M.boolean(),renderQueryResults:NWo.optional()}).passthrough(),TSf=M.object({id:M.string().describe("The node ID"),dataResult:M.union([M.record(M.union([M.number(),M.string(),M.boolean()])),NWo]).describe("Data result - can be a record of values or a completed query result").optional(),name:M.string().describe("The name of the node"),queryResultSequence:vSf,runExecutionSequenceID:M.number().int().describe("The execution sequence ID").optional(),hasTestFailures:M.boolean().describe("Whether the run has test failures").optional(),runResultVersion:M.literal(2).describe("Version of the run result format").optional().default(2),runState:M.enum(["waiting","queued","running","complete","error","skipped","canceled"]).describe("The state of the run"),stepRunState:M.enum(["None","Error","Validated","Created","DataLoaded","Skipped"]).describe("The state of the step run"),version:M.literal(2).describe("Version field").default(2),createdAt:M.string().datetime({offset:!0}),updatedAt:M.string().datetime({offset:!0})}).passthrough(),ISf=M.object({data:M.array(TSf).describe("Raw run results from external storage.")}).passthrough(),OSf=M.object({apiKey:M.string(),authDomain:M.string(),projectId:M.string(),storageBucket:M.string(),messagingSenderId:M.string(),appId:M.string(),measurementId:M.string(),emulatorInfo:M.object({auth:M.string(),firestore:M.string(),storage:M.string()}).passthrough().optional()}).passthrough(),RSf=M.object({expressions:M.array(M.object({sql:M.string().describe("The SQL expression or FROM clause to parse"),type:M.enum(["expression","from"]).describe("Type of SQL to parse - either an expression or a FROM clause"),platformKind:s8n}).passthrough()).describe("Array of SQL expressions to parse")}).passthrough(),MSf=M.object({entityType:M.enum(["node","workspace","run","subgraph","job","macro","nodeType","installedPackage"]),writeType:M.enum(["save","delete","merge"]),data:M.object({id:M.union([M.string(),M.number()]),version:M.union([M.string(),M.number()])}).passthrough()}).passthrough(),wSf=M.object({workspaceID:M.number(),requesetID:M.string().optional(),writeInfo:M.array(MSf)}).passthrough(),PSf=M.object({name:M.string(),tags:M.array(M.string()),count:M.number().int()}).passthrough(),NSf=M.object({metrics:M.array(PSf)}).passthrough(),DSf=M.object({parameters:M.object({}).partial().passthrough(),runDetails:M.object({currentWorkspaceDataFilePath:M.string(),desiredWorkspaceDataFilePath:M.string(),disablePresync:M.boolean(),environmentID:M.string(),planID:M.string(),skippedBeforeCollection:M.boolean().optional().default(!1),useRenderCache:M.boolean().optional().default(!1)}).passthrough(),userCredentials:M.object({}).partial().passthrough()}).passthrough(),xSf=M.object({message:M.string(),planID:M.string()}).passthrough(),BSf=M.object({planStorageFilePath:M.string()}).passthrough(),kSf=M.object({status:M.literal("planning")}).passthrough(),LSf=M.object({files:M.array(M.object({path:M.string().describe("File path relative to repository root"),before:M.string().describe("File content before changes"),after:M.string().describe("File content after changes")}).passthrough()).min(1).describe("Array of files being committed with their before/after content")}).passthrough(),_Nb=M.object({message:M.string().max(400).describe("AI generated git commit message (Soft max 200 chars, Hard max 400 chars)")}).passthrough(),qSf=M.object({workspaceID:M.number().describe("The workspace ID."),nodeID:M.string().min(1).describe("The node ID.")}).passthrough(),vNb=M.object({description:M.string().min(1).describe("AI generated description of the node.")}).passthrough(),zSf=M.object({messages:M.array(M.object({role:M.enum(["user","assistant"]).describe("The role of the message sender."),content:M.string().describe("The text content of the message.")}).passthrough()).describe("An array of message objects representing the conversation history."),systemPrompt:M.string().describe("Optional system prompt").optional(),responseSchema:M.object({}).partial().passthrough().describe("Optional schema for structuring the response format").optional(),threadId:M.string().describe("Identifier for the conversation thread")}).passthrough(),FSf=M.object({text:M.string().describe("AI-generated response text"),usage:M.object({inputUsage:M.number(),outputUsage:M.number(),unit:M.enum(["token","char"])}).partial().passthrough().optional()}).passthrough(),QSf=M.object({model:M.string().describe("The model to use for the LLM call"),messages:M.array(M.any()).describe("The messages to send to the LLM"),schema:M.object({}).partial().passthrough().describe("The schema to use for structured output").optional(),tools:M.object({}).partial().passthrough().describe("The tools to use for the LLM call").optional(),toolChoice:M.union([M.enum(["auto","required","none"]),M.object({type:M.literal("tool"),toolName:M.string()}).passthrough()]).describe("Controls which tools the model can use").optional()}).passthrough(),TNb=M.object({}).partial().passthrough(),Jsu=M.string(),Psu=M.object({name:Jsu.min(1).max(100).describe("Name of the subgraph"),steps:M.array(M.string().max(64)).describe("Array of node IDs in the subgraph")}),Nsu=M.object({id:M.string().describe("Unique identifier for the subgraph"),name:Jsu.min(1).max(100).describe("Name of the subgraph"),steps:M.array(M.string().max(64)).describe("Array of node IDs in the subgraph"),version:M.literal(1).describe("Version of the subgraph schema").default(1),createdAt:M.string().datetime({offset:!0}).describe("Date and time the subgraph was created").optional(),updatedAt:M.string().datetime({offset:!0}).describe("Date and time the subgraph was last updated").optional(),createdBy:M.string().describe("ID of the user who created the subgraph").optional(),updatedBy:M.string().describe("ID of the user who last updated the subgraph").optional()}),USf=M.object({id:M.string().describe("The unique identifier of the warehouse"),name:M.string().describe("The name of the warehouse"),odbc_params:M.object({path:M.string().describe("The path for the SQL warehouse")}).passthrough().describe("The connection parameters for the warehouse")}).passthrough(),jSf=M.object({warehouses:M.array(USf)}).passthrough(),GSf=M.object({id:M.string().describe("The project ID"),name:M.string().describe("The project friendly name").optional()}).passthrough(),HSf=M.object({projects:M.array(GSf)}).passthrough(),INb=M.array(M.string());var ONb=M.object({macros:M.string(),dependencies:M.record(qWo),nodeTypes:M.record(Ksu)}).passthrough(),RNb=M.object({id:M.string(),version:M.string()}).passthrough(),MNb=M.object({id:M.string(),releaseID:M.string()}).passthrough(),wNb=M.string(),WSf=a8n.and(M.object({user:hV.describe("Summary information about a user.")}).passthrough()),PNb=M.array(WSf),VSf=LWo.and(M.object({user:hV.describe("Summary information about a user.")}).passthrough()),NNb=M.array(VSf);var DNb=M.object({data:kWo}).passthrough(),KSf=M.object({seconds:M.number(),nanoseconds:M.number()}),YSf=M.object({_seconds:M.number(),_nanoseconds:M.number()}),xNb=M.union([KSf,YSf]),JSf=M.object({transform:M.string().describe("Returns the SQL of any column transformations.")}),BNb=M.union([zsu,JSf]),kNb=ksu.and(M.object({mappingsV1:M.string(),runTimeParameters:M.string(),jobs:M.array(Usu)}).partial().passthrough());var $su=n8n([{method:"get",path:"/api/integrations/fivetran/jobs/:jobId/history/:historyId",alias:"GetFivetranJobHistory",description:"Get Fivetran job history in org.",requestFormat:"json",parameters:[{name:"jobId",type:"Path",schema:M.string().describe("The Fivetran job ID.")},{name:"historyId",type:"Path",schema:M.string().describe("The Fivetran history ID.")}],response:FCf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/integrations/fivetran/jobs/:jobId/run",alias:"PostFivetranJobRefresh",requestFormat:"json",parameters:[{name:"body",description:"Request body for start Fivetran run.",type:"Body",schema:UCf},{name:"jobId",type:"Path",schema:M.string().describe("The Fivetran job ID.")}],response:M.object({data:kWo}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/integrations/fivetran/projects",alias:"GetFivetranProjects",description:"Get fivetran projects in org.",requestFormat:"json",response:BCf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/integrations/fivetran/projects/:projectId",alias:"GetFivetranProject",requestFormat:"json",parameters:[{name:"projectId",type:"Path",schema:M.string().describe("The unique identifier for the project")}],response:kCf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/integrations/fivetran/projects/:projectId/jobs",alias:"GetFivetranJobs",description:"Get Fivetran jobs.",requestFormat:"json",parameters:[{name:"projectId",type:"Path",schema:M.string().describe("The unique identifier for the project")}],response:qCf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/admin/kill-job/:orgId/:runId",alias:"KillJob",description:"Deletes the Kubernetes job.",requestFormat:"json",parameters:[{name:"orgId",type:"Path",schema:M.string().describe("The Organization ID of the organization that will be affected by the API call.")},{name:"runId",type:"Path",schema:M.number().int().describe("The Run ID of the run that will be affected by the API call.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/bulkWrite",alias:"BulkWrite",description:"Updates multiple documents for a workspace.",requestFormat:"json",parameters:[{name:"body",description:"The workspace to update and the data to update with.",type:"Body",schema:wSf}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/customToken",alias:"GenerateCustomToken",description:"Generate a Coalesce token from the provided OpenID Connect ID token",requestFormat:"json",parameters:[{name:"body",description:"The information from the OpenID Connect authorization server required to sign into Coalesce.",type:"Body",schema:tCf}],response:M.object({customToken:M.string().describe("A Coalesce token")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/database",alias:"GetDatabase",description:"Gets the information required to connect to the Coalesce database.",requestFormat:"json",response:OSf},{method:"get",path:"/api/v1/environments",alias:"GetEnvironments",description:"Get a collection of Environment information.",requestFormat:"json",parameters:[{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()},{name:"detail",type:"Query",schema:M.boolean().describe("Include the full detail of the environments.").optional().default(!1)},{name:"limit",type:"Query",schema:M.number().int().gte(1).lte(500).describe("The maximum number of environments to return.").optional().default(100)},{name:"startingFrom",type:"Query",schema:M.string().describe("The cursor point for paging the query results.").optional()},{name:"orderBy",type:"Query",schema:M.literal("id").describe("The field to order the results by.").optional().default("id")}],response:iCf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/environments",alias:"CreateEnvironment",description:"Create a new environment.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:sCf},{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()}],response:PWo,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/environments/:environmentID",alias:"DeleteEnvironment",description:"Delete an environment.",requestFormat:"json",parameters:[{name:"environmentID",type:"Path",schema:M.string().describe("The environment ID.")},{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/environments/:environmentID",alias:"GetEnvironment",description:"Get information about an environment.",requestFormat:"json",parameters:[{name:"environmentID",type:"Path",schema:M.string().describe("The environment ID.")},{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()}],response:PWo,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/environments/:environmentID/jobs/:jobID",alias:"GetJob",description:"Get information about a job in an environment.",requestFormat:"json",parameters:[{name:"environmentID",type:"Path",schema:M.string().describe("The environment ID.")},{name:"jobID",type:"Path",schema:M.string().describe("The job ID.")}],response:M.object({id:M.string().describe("The Job ID."),name:M.string().describe("The Job name."),includeSelector:M.string().describe("A selector string of nodes to include."),excludeSelector:M.string().describe("A selector string of nodes to exclude."),createdAt:M.string().datetime({offset:!0}),updatedAt:M.string().datetime({offset:!0})}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/environments/:environmentID/nodes",alias:"GetNodes",description:"Get a collection of nodes for an environment",requestFormat:"json",parameters:[{name:"environmentID",type:"Path",schema:M.string().describe("The environment ID.")},{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()},{name:"detail",type:"Query",schema:M.boolean().describe("Include the full detail of the nodes.").optional().default(!1)},{name:"limit",type:"Query",schema:M.number().int().gte(1).lte(500).describe("The maximum number of nodes to return.").optional().default(100)},{name:"startingFrom",type:"Query",schema:M.string().describe("The cursor point for paging the query results.").optional()},{name:"orderBy",type:"Query",schema:M.literal("id").describe("The field to order the results by.").optional().default("id")}],response:Osu,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/environments/:environmentID/nodes/:nodeID",alias:"GetNode",description:"Get information about a node in an environment.",requestFormat:"json",parameters:[{name:"environmentID",type:"Path",schema:M.string().describe("The environment ID.")},{name:"nodeID",type:"Path",schema:M.string().describe("The node ID.")},{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()}],response:jLe,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/featureFlags",alias:"GetFeatureFlags",description:"Gets feature flags for the authenticated user.",requestFormat:"json",parameters:[{name:"subdomain",type:"Query",schema:M.string().describe("The customer subdomain.").optional()}],response:M.object({featureFlags:M.record(M.union([M.boolean(),M.string(),M.number(),M.object({}).partial().passthrough(),M.array(M.any())]))}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/featureFlags/config",alias:"GetFeatureFlagsClientConfig",description:"Gets information the client needs to connect to the feature flags service.",requestFormat:"json",response:M.object({launchDarklyClientID:M.string()}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/featureFlags/default",alias:"GetDefaultFeatureFlags",description:"Gets default feature flags for the unauthenticated users.",requestFormat:"json",response:M.object({featureFlags:M.record(M.union([M.boolean(),M.string(),M.number(),M.object({}).partial().passthrough(),M.array(M.any())]))}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/gitAccounts",alias:"ListGitAccounts",description:"Allows for a user to view all the git accounts in their org.",requestFormat:"json",parameters:[{name:"accountOwner",type:"Query",schema:M.string().describe("The owner of the git accounts. If not provided will fallback to the requester's accounts.").optional()}],response:M.object({data:vCf.describe("A list of git accounts")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/gitAccounts",alias:"CreateGitAccount",description:"Users can create git accounts for their org.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:TCf},{name:"accountOwner",type:"Query",schema:M.string().describe("The owner of the git accounts. If not provided will fallback to the requester's accounts.").optional()}],response:M.object({data:o8n.describe("All the fields needed to create a git account")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/gitAccounts/:gitAccountID",alias:"GetGitAccount",description:"Allows for a user to get a git account.",requestFormat:"json",parameters:[{name:"gitAccountID",type:"Path",schema:M.string().describe("The git account ID.")},{name:"accountOwner",type:"Query",schema:M.string().describe("The owner of the git accounts. If not provided will fallback to the requester's accounts.").optional()}],response:M.object({data:o8n.describe("All the fields needed to create a git account")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"patch",path:"/api/v1/gitAccounts/:gitAccountID",alias:"UpdateGitAccount",description:"Allows for a user to update their git account.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Gsu},{name:"gitAccountID",type:"Path",schema:M.string().describe("The git account ID.")},{name:"accountOwner",type:"Query",schema:M.string().describe("The owner of the git accounts. If not provided will fallback to the requester's accounts.").optional()}],response:M.object({data:o8n.describe("All the fields needed to create a git account")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/gitAccounts/:gitAccountID",alias:"DeleteGitAccount",description:"Allows for a user to delete a git account.",requestFormat:"json",parameters:[{name:"gitAccountID",type:"Path",schema:M.string().describe("The git account ID.")},{name:"accountOwner",type:"Query",schema:M.string().describe("The owner of the git accounts. If not provided will fallback to the requester's accounts.").optional()}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/llm/chat",alias:"GetChatMessage",description:"Get the generated AI chat message.",requestFormat:"json",parameters:[{name:"body",description:"The prompt to generate the AI chat message.",type:"Body",schema:zSf}],response:FSf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/llm/git-commit-message",alias:"GetAIGitCommitMessage",description:"Generate an AI commit message based on git diffs",requestFormat:"json",parameters:[{name:"body",description:"Git diff context for commit message generation",type:"Body",schema:LSf}],response:M.object({message:M.string().max(400).describe("AI generated git commit message (Soft max 200 chars, Hard max 400 chars)")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/llm/llm",alias:"GetLlmMessage",description:"Get the generated AI LLM message.",requestFormat:"json",parameters:[{name:"body",description:"The prompt to generate the AI LLM message.",type:"Body",schema:QSf}],response:M.object({}).partial().passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/llm/node-description",alias:"GetAINodeDescription",description:"Retrieve the generated AI descriptions for a node.",requestFormat:"json",parameters:[{name:"body",description:"workspaceID, nodeID of the node for which to generate the AI description.",type:"Body",schema:qSf}],response:M.object({description:M.string().min(1).describe("AI generated description of the node.")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/metrics",alias:"SubmitMetrics",description:"Submit a set of metrics",requestFormat:"json",parameters:[{name:"body",description:"The metrics to submit",type:"Body",schema:NSf}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/multiFactorAuth/:userID",alias:"RemoveMultiFactor",description:"Deletes the MFA for a user in firebase auth",requestFormat:"json",parameters:[{name:"userID",type:"Path",schema:M.string().describe("The user ID.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/packageRegistry/:packageID",alias:"GetRegistryPackage",description:"Get a package on the registry.",requestFormat:"json",parameters:[{name:"packageID",type:"Path",schema:M.string().min(1).describe("The package id.")}],response:wWo,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/packageRegistry/:packageID",alias:"updatePackageV2",description:"Update an existing package&#x27;s information.",requestFormat:"json",parameters:[{name:"body",description:"Updated package details. Does not include package content held in a release.",type:"Body",schema:WCf},{name:"packageID",type:"Path",schema:M.string().min(1).describe("The id of the package.")}],response:M.object({org:M.string(),name:M.string(),description:M.string(),overview:M.string(),tags:M.array(M.string()),featured:M.boolean(),certified:M.boolean(),packageID:M.string(),id:M.string().optional(),publisherID:M.string().optional(),latestRelease:M.string().optional(),platformKind:s8n}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/packageRegistry/:packageID/releases/:releaseID",alias:"updatePackageReleaseV2",description:"Update a package release.",requestFormat:"json",parameters:[{name:"body",description:"The package release info to update with.",type:"Body",schema:VCf},{name:"packageID",type:"Path",schema:M.string().min(1).describe("The package id.")},{name:"releaseID",type:"Path",schema:M.string().min(1).describe("The package release ID.")}],response:i8n,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/packageRegistry/:packageID/releases/:releaseID",alias:"GetRegistryPackageRelease",description:"Get a release from a package in the registry.",requestFormat:"json",parameters:[{name:"packageID",type:"Path",schema:M.string().min(1).describe("The package id.")},{name:"releaseID",type:"Path",schema:M.string().min(1).describe("The package release ID.")}],response:i8n,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/packageRegistry/:packageID/releases/privacy/:privacy",alias:"GetAllRegistryPackageReleases",description:"Get all available releases for a package on the registry.",requestFormat:"json",parameters:[{name:"packageID",type:"Path",schema:M.string().min(1).describe("The package id.")},{name:"privacy",type:"Path",schema:M.enum(["public","private","unlisted","all"]).describe("The privacy level of the packages requested")}],response:M.array(i8n),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/packageRegistry/all",alias:"GetAllRegistryPackages",description:"Get all available packages on the registry.",requestFormat:"json",response:M.array(wWo),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/packageRegistry/createPackage",alias:"createPackage",description:"Create a package without a release.",requestFormat:"json",parameters:[{name:"body",description:"Info describing and defining the package. Does not include package content held in a release",type:"Body",schema:KCf}],response:M.object({org:M.string(),name:M.string(),description:M.string(),overview:M.string(),tags:M.array(M.string()),featured:M.boolean(),certified:M.boolean(),packageID:M.string(),id:M.string().optional(),publisherID:M.string().optional(),latestRelease:M.string().optional(),platformKind:s8n}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/packageRegistry/createRelease",alias:"AddPackageRelease",description:"Add a new package release to an existing package.",requestFormat:"json",parameters:[{name:"body",description:"The package release info.",type:"Body",schema:$Cf}],response:i8n,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/packageRegistry/org",alias:"GetRegistryPackagesForOrg",description:"Get a release from a package in the registry.",requestFormat:"json",response:M.array(wWo),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/packageRegistry/update",alias:"UpdatePackage",description:"Update a package.",requestFormat:"json",parameters:[{name:"body",description:"The package info to create with.",type:"Body",schema:XCf}],response:M.string(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/plan",alias:"createPlan",description:"Create a deployment plan",requestFormat:"json",parameters:[{name:"body",description:"Requirements for plan creation",type:"Body",schema:DSf}],response:xSf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/plan/:environmentID/:planID",alias:"getPlan",description:"Get an existing deployment plan",requestFormat:"json",parameters:[{name:"environmentID",type:"Path",schema:M.string().describe("The environment ID")},{name:"planID",type:"Path",schema:M.string().describe("The plan ID")}],response:M.union([BSf,kSf]),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/projects",alias:"GetProjectsInOrg",description:"Get projects in org.",requestFormat:"json",parameters:[{name:"includeWorkspaces",type:"Query",schema:M.boolean().describe("Whether or not to include nested workspace data for all projects.").optional()},{name:"includeJobs",type:"Query",schema:M.boolean().describe("Whether or not to include nested job data for all workspaces in the projects.").optional()}],response:wCf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/projects",alias:"CreateProject",description:"Create a new project.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:PCf}],response:BWo,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/projects/:projectID",alias:"GetProjectInOrg",description:"Get a project.",requestFormat:"json",parameters:[{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")},{name:"includeWorkspaces",type:"Query",schema:M.boolean().describe("Whether or not to include nested workspace data for all projects.").optional()},{name:"includeJobs",type:"Query",schema:M.boolean().describe("Whether or not to include nested job data for all workspaces in the projects.").optional()}],response:Msu,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"patch",path:"/api/v1/projects/:projectID",alias:"UpdateProject",description:"Update a project",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:NCf},{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")},{name:"includeWorkspaces",type:"Query",schema:M.boolean().describe("Whether or not to include nested workspace data for all projects.").optional()},{name:"includeJobs",type:"Query",schema:M.boolean().describe("Whether or not to include nested job data for all workspaces in the projects.").optional()}],response:Msu,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/projects/:projectID",alias:"DeleteProject",description:"Delete a project.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:DCf.optional()},{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")},{name:"includeWorkspaces",type:"Query",schema:M.boolean().describe("Whether or not to include nested workspace data for all projects.").optional()},{name:"includeJobs",type:"Query",schema:M.boolean().describe("Whether or not to include nested job data for all workspaces in the projects.").optional()}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/projects/:projectID/gitAccounts",alias:"ListProjectGitAccounts",description:"List git accounts for a project",requestFormat:"json",parameters:[{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")}],response:xCf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/projects/:projectID/gitAccounts/:userID",alias:"GetProjectGitAccount",description:"Get a user&#x27;s git account for a project",requestFormat:"json",parameters:[{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")},{name:"userID",type:"Path",schema:M.string().describe("The user ID.")}],response:Hsu,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/projects/:projectID/gitAccounts/:userID",alias:"SetProjectGitAccount",description:"Set a user&#x27;s git account for a project",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:M.object({gitAccountID:M.string()}).passthrough()},{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")},{name:"userID",type:"Path",schema:M.string().describe("The user ID.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/projects/:projectID/gitAccounts/:userID",alias:"DeleteProjectGitAccount",description:"Un-set a user&#x27;s git account for a project",requestFormat:"json",parameters:[{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")},{name:"userID",type:"Path",schema:M.string().describe("The user ID.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/runs",alias:"GetRuns",description:"Get a collection of information about runs.",requestFormat:"json",parameters:[{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()},{name:"limit",type:"Query",schema:M.number().int().gte(0).lte(1e3).describe("The maximum number of runs to return.").optional().default(25)},{name:"startingFrom",type:"Query",schema:eSf},{name:"orderBy",type:"Query",schema:M.enum(["id","runStartTime","runEndTime"]).describe("The field used to sort query results. Defaults to `id`, but must be explicitly provided when also using `startingFrom`. Make sure to match data type.").optional()},{name:"orderByDirection",type:"Query",schema:M.enum(["asc","desc"]).describe("The sort order for query results.").optional().default("desc")},{name:"projectID",type:"Query",schema:tSf},{name:"runType",type:"Query",schema:rSf},{name:"runStatus",type:"Query",schema:nSf},{name:"environmentID",type:"Query",schema:iSf},{name:"detail",type:"Query",schema:M.boolean().describe("Include the full detail of the run.").optional().default(!1)}],response:bSf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/runs/:runID",alias:"GetRun",description:"Gets a single run.",requestFormat:"json",parameters:[{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()},{name:"runID",type:"Path",schema:M.number().int().describe("The run ID.")}],response:Ysu,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/runs/:runID/results",alias:"GetRunResults",description:"Get a collection of the results of a deploy or refresh run",requestFormat:"json",parameters:[{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()},{name:"runID",type:"Path",schema:M.number().int().describe("The run ID.")}],response:SSf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/runs/:runID/stored-run-results/:chunkID",alias:"GetStoredRunResults",description:"Get raw run results from external storage",requestFormat:"json",parameters:[{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()},{name:"runID",type:"Path",schema:M.string().describe("The run ID.")},{name:"chunkID",type:"Path",schema:M.string().describe("The chunk ID")}],response:ISf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/secrets/:secretType/:context",alias:"SecretExists",description:"Determines whether or not a git token value exists for a given project ID.",requestFormat:"json",parameters:[{name:"secretType",type:"Path",schema:M.string().describe("The name of the secret type.")},{name:"context",type:"Path",schema:M.string().describe("Contextual information required to identify a particular secret.")}],response:M.boolean(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/secrets/:secretType/:context",alias:"UpgradeSecret",description:"Upgrades a secret from secretType its upgrade target.",requestFormat:"json",parameters:[{name:"secretType",type:"Path",schema:M.string().describe("The name of the secret type.")},{name:"context",type:"Path",schema:M.string().describe("Contextual information required to identify a particular secret.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/secrets/:secretType/:context",alias:"SetSecret",description:"Sets the value of a secret.",requestFormat:"json",parameters:[{name:"body",description:"The new value of the secret.",type:"Body",schema:M.object({secretValue:M.unknown()}).passthrough()},{name:"secretType",type:"Path",schema:M.string().describe("The name of the secret type.")},{name:"context",type:"Path",schema:M.string().describe("Contextual information required to identify a particular secret.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/secrets/:secretType/:context",alias:"DeleteSecret",description:"Deletes a secret.",requestFormat:"json",parameters:[{name:"secretType",type:"Path",schema:M.string().describe("The name of the secret type.")},{name:"context",type:"Path",schema:M.string().describe("Contextual information required to identify a particular secret.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/sql/parse",alias:"ParseSql",description:"Parse multiple SQL expressions or FROM clauses using the Strumenta parser.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:RSf}],response:M.object({results:M.array(M.object({originalSql:M.string().describe("The original SQL expression that was parsed"),type:M.enum(["expression","from"]).describe("The type of SQL that was parsed"),platformKind:s8n,success:M.boolean().describe("Whether the parsing was successful"),result:M.union([M.object({validReferences:M.array(M.array(M.string()).min(2).max(2)).describe("Array of valid table.column references as tuples [tableName, columnName]"),invalidReferences:M.array(M.string()).describe("Array of column names that could not be resolved to a table")}).passthrough(),M.record(M.object({node:M.string().describe("Optional node identifier"),column:M.union([M.string(),M.object({}).partial().passthrough()]).describe("Column name or symbol")}).partial().passthrough())]).describe("The parsing result (only present if successful). For 'expression' type, contains table and column references. For 'from' type, contains a lookup table of aliases.").optional(),error:M.string().describe("Error message (only present if failed)").optional()}).passthrough())}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/typesense/orgs/:orgID/typesense-config",alias:"getTypesenseConfigForOrg",description:"Returns Typesense configuration data for a given org.",requestFormat:"json",parameters:[{name:"orgID",type:"Path",schema:M.string().describe("The organization ID.")}],response:ZCf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/userRoles",alias:"GetUserRoles",description:"Get all user roles in the organization, filtered by information available based on the current user&#x27;s roles and sorted alphabetically by last name, then by first name.",requestFormat:"json",parameters:[{name:"excludeOrgRoles",type:"Query",schema:M.boolean().describe("Exclude organization level roles from the results.").optional()},{name:"projectID",type:"Query",schema:M.string().describe("Return only user roles pertaining to the specified project.").optional()},{name:"environmentID",type:"Query",schema:M.string().describe("Return only user roles pertaining to the specified environment.").optional()}],response:M.array(Vsu),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/userRoles/:userID/organizationRoles",alias:"UpsertUserOrganizationRoles",description:"Creates or updates all of a user&#x27;s organization roles. Only org admins may use this API.",requestFormat:"json",parameters:[{name:"body",description:"The user&#x27;s organization roles.",type:"Body",schema:M.array(M.string())},{name:"userID",type:"Path",schema:M.string().describe("The user ID.")}],response:M.object({organizationRoles:M.array(M.string()).describe("The organization roles assigned to the user."),projects:M.record(LWo).describe("A dictionary of project role assignments keyed by project ID.")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/userRoles/:userID/projects/:projectID",alias:"DeleteUserProjectRoles",description:"Deletes all of a user&#x27;s project roles. Only org and project admins may user this API.",requestFormat:"json",parameters:[{name:"userID",type:"Path",schema:M.string().describe("The user ID.")},{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/userRoles/:userID/projects/:projectID",alias:"UpsertUserProjectRoles",description:"Creates or updates all of a user&#x27;s project roles. Only org and project admins may user this API.",requestFormat:"json",parameters:[{name:"body",description:"The user project roles.",type:"Body",schema:M.object({projectRoles:M.array(M.string()),environments:M.record(a8n).describe("A dictionary of environment role assignments keyed by environment ID.")}).passthrough()},{name:"userID",type:"Path",schema:M.string().describe("The user ID.")},{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")}],response:M.object({projectRoles:M.array(M.string()),environments:M.record(a8n).describe("A dictionary of environment role assignments keyed by environment ID.")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/userRoles/:userID/projects/:projectID/environments/:environmentID",alias:"DeleteUserEnvironmentRoles",description:"Deletes all of a user&#x27;s environment roles.",requestFormat:"json",parameters:[{name:"userID",type:"Path",schema:M.string().describe("The user ID.")},{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")},{name:"environmentID",type:"Path",schema:M.string().describe("The environment ID.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/userRoles/:userID/projects/:projectID/environments/:environmentID",alias:"UpsertUserEnvironmentRoles",description:"Creates or updates all of a user&#x27;s environment roles.",requestFormat:"json",parameters:[{name:"body",description:"The user environment roles.",type:"Body",schema:M.object({environmentRoles:M.array(M.string()).describe("The environment roles assigned to the user.")}).passthrough()},{name:"userID",type:"Path",schema:M.string().describe("The user ID.")},{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")},{name:"environmentID",type:"Path",schema:M.string().describe("The environment ID.")}],response:M.object({environmentRoles:M.array(M.string()).describe("The environment roles assigned to the user.")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/users",alias:"ListOrgUsers",description:"Get all users in the current org",requestFormat:"json",parameters:[{name:"limit",type:"Query",schema:M.number().int().gte(1).lte(500).describe("The maximum number of users to return.").optional().default(50)},{name:"startingFrom",type:"Query",schema:M.string().describe("The cursor point for paging the query results.").optional()},{name:"orderBy",type:"Query",schema:M.literal("id").describe("The field to order the results by.").optional().default("id")}],response:M.object({total:M.number().int().describe("The size of the result set."),startingFrom:M.string().describe("The cursor value used in the request.").optional(),limit:M.number().int().describe("The requested page size."),next:M.union([M.string(),M.null()]).describe("The field value representing the start of the next page of results."),data:M.array(M.object({firstName:M.string(),lastName:M.string(),email:M.string(),id:M.string(),authDisabled:M.boolean(),deleted:M.boolean()}).partial().passthrough())}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/users/:userId",alias:"DeleteUser",description:"Delete a user by ID.",requestFormat:"json",parameters:[{name:"userId",type:"Path",schema:M.string().describe("The user ID.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge}]},{method:"post",path:"/api/v1/validHostname",alias:"ValidateHostname",description:"Validates the passed hostname and returns an authorized version.",requestFormat:"json",parameters:[{name:"body",description:"The hostname that needs to be validated.",type:"Body",schema:M.object({hostname:M.string()}).passthrough()}],response:M.string(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/workspaces/:workspaceID/bigquery/projects",alias:"GetBigQueryProjects",description:"Retrieves BigQuery projects accessible by the workspace&#x27;s configured account.",requestFormat:"json",parameters:[{name:"workspaceID",type:"Path",schema:M.string().describe("The workspace ID.")}],response:HSf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/workspaces/:workspaceID/bigquery/projects/:projectID/datasets",alias:"GetBigQueryDatasets",description:`Retrieves BigQuery datasets (schemas) for a given project.
2031
+ `).optional()}).passthrough(),wWo=M.object({updatedBy:M.string().optional(),updatedAt:M.string().datetime({offset:!0}).optional(),name:M.string(),publisherID:M.string(),description:M.string(),org:M.string(),latestRelease:M.string(),overview:M.string(),featured:M.boolean(),tags:M.array(M.string()),certified:M.boolean(),packageID:M.string(),id:M.string(),platformKind:M.enum(["fabric","snowflake","databricks","bigquery"])}).passthrough(),i8n=M.object({createdAt:M.string().datetime({offset:!0}),createdBy:M.string().optional(),updatedBy:M.string().optional(),updatedAt:M.string().datetime({offset:!0}),version:M.string(),changeLog:M.string(),releaseID:M.string(),storagePath:M.string(),privacy:M.enum(["public","private","unlisted"])}).passthrough(),WCf=M.object({description:M.string(),overview:M.string().max(200),tags:M.array(M.string()),featured:M.boolean(),certified:M.boolean()}).passthrough(),s8n=M.enum(["snowflake","fabric","databricks","bigquery"]),VCf=M.object({changeLog:M.string().min(1),privacy:M.enum(["public","private","unlisted"])}).passthrough(),KCf=M.object({name:M.string(),description:M.string(),overview:M.string().max(200),tags:M.array(M.string()),featured:M.boolean(),certified:M.boolean(),platformKind:M.enum(["snowflake","fabric","databricks","bigquery"])}).passthrough(),YCf=M.object({changeLog:M.string(),version:M.string(),certified:M.boolean().optional()}).passthrough(),qWo=M.lazy(()=>M.object({packageID:M.string().min(1),alias:M.string(),version:M.string(),releaseID:M.string().min(1),macros:M.string(),dependencies:M.record(qWo)}).passthrough()),Ksu=M.object({name:M.string(),version:M.number(),id:M.string(),isDisabled:M.boolean(),metadata:M.object({}).partial().passthrough()}).passthrough(),JCf=M.object({dependencies:M.record(qWo),nodeTypes:M.record(Ksu),macros:M.string()}).passthrough(),$Cf=M.object({release:YCf.describe("Package release information for a create operation."),privacy:M.enum(["public","private","unlisted"]),entities:JCf.describe("Entities that are part of a package release."),packageVariables:M.string(),packageID:M.string().min(1)}).passthrough(),XCf=M.object({packageID:M.string().min(1),releaseID:M.string().min(1),changeLog:M.string().optional(),description:M.string().optional(),privacy:M.enum(["public","private","unlisted"]).optional()}).passthrough(),ZCf=M.object({typesenseKey:M.string().describe("The Typesense access key scoped to a users org."),typesenseHosts:M.array(M.string()).describe("The Typesense host address(es) for our cluster(s).")}).passthrough(),eSf=M.union([M.number(),M.string()]).describe("The starting run ID, runStartTime, or runEndTime (exclusive) for paging the query results.").optional(),tSf=M.union([M.string(),M.array(M.string())]).describe("One or more project IDs to filter the query results.").optional(),u8n=M.enum(["deploy","refresh"]),rSf=M.union([u8n,M.array(u8n)]).describe("One or more run types to filter the query results.").optional(),c8n=M.enum(["canceled","completed","failed","initializing","rendering","running","waitingToRun"]),nSf=M.union([c8n,M.array(c8n)]).describe("One or more status values to filter the query results.").optional(),iSf=M.union([M.string(),M.array(M.string())]).describe("One or more environment IDs to filter the query results.").optional(),oSf=M.enum(["asc","desc"]),sSf=M.enum(["id","runStartTime","runEndTime"]),aSf=M.object({id:M.number().int().describe("The run ID."),reRunID:M.string().describe("If this is a re-run, the ID of the original operation.").optional(),runStartTime:M.string().datetime({offset:!0}).describe("The datetime the run started.").optional(),runEndTime:M.string().datetime({offset:!0}).describe("The datetime the run ended.").optional(),runType:u8n,runStatus:c8n,environmentID:M.string().describe("The environment in which the run operation was applied.").optional(),runFailureReason:M.string().describe("Information about the cause of a run failure.").optional()}).passthrough(),uSf=M.object({canceled:M.boolean().describe("If the run was canceled.").optional(),deployCommit:M.string().describe("The full commit hash."),deployCommitMessage:M.string().describe("The commit message.").optional(),environmentID:M.string().describe("The Environment ID for this run."),parallelism:M.number().int().describe("The parallelism parameter determines how many nodes are processed simultaneously (in parallel) by the Snowflake compute warehouse.").optional(),nodesInRun:M.number().int().describe("The number of Nodes deployed.").optional()}),cSf=M.object({canceled:M.boolean().describe("If the run was canceled.").optional(),environmentID:M.string().describe("The Environment ID for this run."),excludeNodesSelector:M.string().describe("A selector string of nodes to exclude.").optional(),forceIgnoreEnvironmentStatus:M.boolean().optional(),includeNodesSelector:M.string().describe("A selector string of nodes to include.").optional(),jobID:M.number().int().describe("The Job ID.").optional(),parallelism:M.number().int().describe("The parallelism parameter determines how many nodes are processed simultaneously (in parallel) by the Snowflake compute warehouse.").optional(),refreshDescription:M.string().describe("The Job name.").optional(),nodesForRefresh:M.number().int().optional(),nodesInRun:M.number().int().describe("The number of Nodes deployed.").optional(),executor:M.string().optional()}),lSf=M.union([uSf,cSf]),dSf=M.enum(["Basic","Cloud","KeyPair","OAuth"]),pSf=M.object({snowflakeAccount:M.string(),snowflakeAuthType:dSf,snowflakeRole:M.string().optional(),snowflakeUsername:M.string(),snowflakeWarehouse:M.string().optional()}),fSf=M.enum(["Token","Cloud","OAuthU2M","OAuthM2M"]),ASf=M.object({databricksHost:M.string(),databricksAuthType:fSf,databricksPath:M.string()}),hSf=M.literal("oauth"),gSf=M.object({fabricConnectionString:M.string(),fabricAuthType:hSf,platformKind:M.string().optional()}),mSf=M.enum(["ServiceAccount","OAuth"]),ySf=M.object({bigQueryAuthType:mSf}),Ysu=M.object({id:M.number().int(),reRunID:M.string().describe("If this is a re-run, the ID of the original operation.").optional(),runDetails:lSf.describe("Detailed information about a run."),runEndTime:M.string().datetime({offset:!0}).describe("The datetime when the run ended.").optional(),runFailureReason:M.string().describe("The reason the run failed.").optional(),runHistory:M.array(M.number().int()).optional(),runStartTime:M.string().datetime({offset:!0}).describe("The datetime the run started.").optional(),runStatus:c8n,runTimeParameters:M.object({}).partial().passthrough().describe("The default Environment parameters. Parameters changed during deploy will not show here."),runType:u8n,userCredentials:M.union([pSf,ASf,gSf,ySf]).optional(),userID:M.string().optional(),projectID:M.string(),hasTestFailures:M.boolean().describe("Whether the run has test failures.").optional(),version:M.number().int().optional(),renderingProgress:M.object({totalNodes:M.number().int().gte(0).describe("Total number of nodes to render"),completedNodes:M.number().int().gte(0).describe("Number of nodes completed so far")}).passthrough().describe("Progress information for the rendering phase").optional()}),bSf=M.object({limit:M.number().int().describe("The maximum number of runs returned by this query."),next:M.union([M.number(),M.string(),M.null()]).describe("The field value representing the start of the next page of results."),orderByDirection:oSf.describe("The sort order for query results."),orderBy:sSf.describe("The field used to sort query results. Defaults to `id`, but must be explicitly provided when also using `startingFrom`. Make sure to match data type."),data:M.union([M.array(aSf),M.array(Ysu)]).describe("A collection of runs.")}).passthrough(),ESf=M.enum(["API","CLI","UI","fivetranAPI"]),wsu=M.object({endTime:M.string().datetime({offset:!0}).optional(),error:Dsu.optional(),isRunning:M.boolean().describe("If the queried run is still running."),name:M.string().describe("The name of the Stage the query ran on."),queryID:M.string().optional(),rowsDeleted:M.number().int().optional(),rowsInserted:M.number().int().optional(),rowsUpdated:M.number().int().optional(),sql:M.string().describe("The SQL query run during the stage."),startTime:M.string().datetime({offset:!0}).optional(),status:M.string().describe("The query status."),success:M.boolean().describe("If the query results were run successfully."),type:M.enum(["sql","sqlTest"]).optional(),warehouse:M.string().describe("Name of the warehouse.").optional()}),CSf=M.object({isRunning:M.boolean().describe("If the queried run is still running."),name:M.string(),nodeID:M.string(),runState:M.string().optional(),hasTestFailures:M.boolean().optional(),origin:ESf.optional(),queryResults:M.array(wsu).describe("The query result returns the status of different stages such as Delete Table or Rename Table. See the queryResults name for the stage."),renderQueryResult:wsu.optional()}),SSf=M.object({data:M.array(CSf).describe("A collection of run results.")}).passthrough(),NWo=M.object({endTime:M.string().datetime({offset:!0}),error:M.object({errorString:M.string(),errorDetail:M.string()}).passthrough().nullish(),fields:M.array(M.object({name:M.string(),type:M.string()}).passthrough()),isRunning:M.boolean(),name:M.string(),sql:M.string(),startTime:M.string().datetime({offset:!0}),status:M.enum(["Success","Failure","Canceled","Queued","Running","Transaction exceeded data limit, returned a subset of rows"]),success:M.boolean(),type:M.enum(["sql","sqlTest"]),exportedRefs:M.array(M.object({locationName:M.string(),nodeName:M.string()}).passthrough()),invalidExportedRefs:M.array(M.object({locationName:M.string(),nodeName:M.string()}).passthrough())}).passthrough(),_Sf=M.object({name:M.string(),isRunning:M.literal(!0)}),vSf=M.object({name:M.string(),queryResults:M.array(M.union([NWo,_Sf])),isRunning:M.boolean(),renderQueryResults:NWo.optional()}).passthrough(),TSf=M.object({id:M.string().describe("The node ID"),dataResult:M.union([M.record(M.union([M.number(),M.string(),M.boolean()])),NWo]).describe("Data result - can be a record of values or a completed query result").optional(),name:M.string().describe("The name of the node"),queryResultSequence:vSf,runExecutionSequenceID:M.number().int().describe("The execution sequence ID").optional(),hasTestFailures:M.boolean().describe("Whether the run has test failures").optional(),runResultVersion:M.literal(2).describe("Version of the run result format").optional().default(2),runState:M.enum(["waiting","queued","running","complete","error","skipped","canceled"]).describe("The state of the run"),stepRunState:M.enum(["None","Error","Validated","Created","DataLoaded","Skipped"]).describe("The state of the step run"),version:M.literal(2).describe("Version field").default(2),createdAt:M.string().datetime({offset:!0}),updatedAt:M.string().datetime({offset:!0})}).passthrough(),ISf=M.object({data:M.array(TSf).describe("Raw run results from external storage.")}).passthrough(),OSf=M.object({apiKey:M.string(),authDomain:M.string(),projectId:M.string(),storageBucket:M.string(),messagingSenderId:M.string(),appId:M.string(),measurementId:M.string(),emulatorInfo:M.object({auth:M.string(),firestore:M.string(),storage:M.string()}).passthrough().optional()}).passthrough(),RSf=M.object({expressions:M.array(M.object({sql:M.string().describe("The SQL expression or FROM clause to parse"),type:M.enum(["expression","from"]).describe("Type of SQL to parse - either an expression or a FROM clause"),platformKind:s8n}).passthrough()).describe("Array of SQL expressions to parse")}).passthrough(),MSf=M.object({entityType:M.enum(["node","workspace","run","subgraph","job","macro","nodeType","installedPackage"]),writeType:M.enum(["save","delete","merge"]),data:M.object({id:M.union([M.string(),M.number()]),version:M.union([M.string(),M.number()])}).passthrough()}).passthrough(),wSf=M.object({workspaceID:M.number(),requesetID:M.string().optional(),writeInfo:M.array(MSf)}).passthrough(),PSf=M.object({name:M.string(),tags:M.array(M.string()),count:M.number().int()}).passthrough(),NSf=M.object({metrics:M.array(PSf)}).passthrough(),DSf=M.object({parameters:M.object({}).partial().passthrough(),runDetails:M.object({currentWorkspaceDataFilePath:M.string(),desiredWorkspaceDataFilePath:M.string(),disablePresync:M.boolean(),environmentID:M.string(),planID:M.string(),skippedBeforeCollection:M.boolean().optional().default(!1),useRenderCache:M.boolean().optional().default(!1)}).passthrough(),userCredentials:M.object({}).partial().passthrough()}).passthrough(),xSf=M.object({message:M.string(),planID:M.string()}).passthrough(),BSf=M.object({planStorageFilePath:M.string()}).passthrough(),kSf=M.object({status:M.literal("planning")}).passthrough(),LSf=M.object({files:M.array(M.object({path:M.string().describe("File path relative to repository root"),before:M.string().describe("File content before changes"),after:M.string().describe("File content after changes")}).passthrough()).min(1).describe("Array of files being committed with their before/after content")}).passthrough(),_Nb=M.object({message:M.string().max(400).describe("AI generated git commit message (Soft max 200 chars, Hard max 400 chars)")}).passthrough(),qSf=M.object({workspaceID:M.number().describe("The workspace ID."),nodeID:M.string().min(1).describe("The node ID.")}).passthrough(),vNb=M.object({description:M.string().min(1).describe("AI generated description of the node.")}).passthrough(),zSf=M.object({messages:M.array(M.object({role:M.enum(["user","assistant"]).describe("The role of the message sender."),content:M.string().describe("The text content of the message.")}).passthrough()).describe("An array of message objects representing the conversation history."),systemPrompt:M.string().describe("Optional system prompt").optional(),responseSchema:M.object({}).partial().passthrough().describe("Optional schema for structuring the response format").optional(),threadId:M.string().describe("Identifier for the conversation thread")}).passthrough(),FSf=M.object({text:M.string().describe("AI-generated response text"),usage:M.object({inputUsage:M.number(),outputUsage:M.number(),unit:M.enum(["token","char"])}).partial().passthrough().optional()}).passthrough(),QSf=M.object({model:M.string().describe("The model to use for the LLM call"),messages:M.array(M.any()).describe("The messages to send to the LLM"),schema:M.object({}).partial().passthrough().describe("The schema to use for structured output").optional(),tools:M.object({}).partial().passthrough().describe("The tools to use for the LLM call").optional(),toolChoice:M.union([M.enum(["auto","required","none"]),M.object({type:M.literal("tool"),toolName:M.string()}).passthrough()]).describe("Controls which tools the model can use").optional()}).passthrough(),TNb=M.object({}).partial().passthrough(),Jsu=M.string(),Psu=M.object({name:Jsu.min(1).max(100).describe("Name of the subgraph"),steps:M.array(M.string().max(64)).describe("Array of node IDs in the subgraph")}),Nsu=M.object({id:M.string().describe("Unique identifier for the subgraph"),name:Jsu.min(1).max(100).describe("Name of the subgraph"),steps:M.array(M.string().max(64)).describe("Array of node IDs in the subgraph"),version:M.literal(1).describe("Version of the subgraph schema").default(1),createdAt:M.string().datetime({offset:!0}).describe("Date and time the subgraph was created").optional(),updatedAt:M.string().datetime({offset:!0}).describe("Date and time the subgraph was last updated").optional(),createdBy:M.string().describe("ID of the user who created the subgraph").optional(),updatedBy:M.string().describe("ID of the user who last updated the subgraph").optional()}),USf=M.object({id:M.string().describe("The unique identifier of the warehouse"),name:M.string().describe("The name of the warehouse"),odbc_params:M.object({path:M.string().describe("The path for the SQL warehouse")}).passthrough().describe("The connection parameters for the warehouse")}).passthrough(),jSf=M.object({warehouses:M.array(USf)}).passthrough(),GSf=M.object({id:M.string().describe("The project ID"),name:M.string().describe("The project friendly name").optional()}).passthrough(),HSf=M.object({projects:M.array(GSf)}).passthrough(),INb=M.array(M.string());var ONb=M.object({macros:M.string(),dependencies:M.record(qWo),nodeTypes:M.record(Ksu)}).passthrough(),RNb=M.object({id:M.string(),version:M.string()}).passthrough(),MNb=M.object({id:M.string(),releaseID:M.string()}).passthrough(),wNb=M.string(),WSf=a8n.and(M.object({user:hV.describe("Summary information about a user.")}).passthrough()),PNb=M.array(WSf),VSf=LWo.and(M.object({user:hV.describe("Summary information about a user.")}).passthrough()),NNb=M.array(VSf);var DNb=M.object({data:kWo}).passthrough(),KSf=M.object({seconds:M.number(),nanoseconds:M.number()}),YSf=M.object({_seconds:M.number(),_nanoseconds:M.number()}),xNb=M.union([KSf,YSf]),JSf=M.object({transform:M.string().describe("Returns the SQL of any column transformations.")}),BNb=M.union([zsu,JSf]),kNb=ksu.and(M.object({mappingsV1:M.string(),runTimeParameters:M.string(),jobs:M.array(Usu)}).partial().passthrough());var $su=n8n([{method:"get",path:"/api/integrations/fivetran/jobs/:jobId/history/:historyId",alias:"GetFivetranJobHistory",description:"Get Fivetran job history in org.",requestFormat:"json",parameters:[{name:"jobId",type:"Path",schema:M.string().describe("The Fivetran job ID.")},{name:"historyId",type:"Path",schema:M.string().describe("The Fivetran history ID.")}],response:FCf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/integrations/fivetran/jobs/:jobId/run",alias:"PostFivetranJobRefresh",requestFormat:"json",parameters:[{name:"body",description:"Request body for start Fivetran run.",type:"Body",schema:UCf},{name:"jobId",type:"Path",schema:M.string().describe("The Fivetran job ID.")}],response:M.object({data:kWo}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/integrations/fivetran/projects",alias:"GetFivetranProjects",description:"Get fivetran projects in org.",requestFormat:"json",response:BCf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/integrations/fivetran/projects/:projectId",alias:"GetFivetranProject",requestFormat:"json",parameters:[{name:"projectId",type:"Path",schema:M.string().describe("The unique identifier for the project")}],response:kCf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/integrations/fivetran/projects/:projectId/jobs",alias:"GetFivetranJobs",description:"Get Fivetran jobs.",requestFormat:"json",parameters:[{name:"projectId",type:"Path",schema:M.string().describe("The unique identifier for the project")}],response:qCf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/admin/kill-job/:orgId/:runId",alias:"KillJob",description:"Deletes the Kubernetes job.",requestFormat:"json",parameters:[{name:"orgId",type:"Path",schema:M.string().describe("The Organization ID of the organization that will be affected by the API call.")},{name:"runId",type:"Path",schema:M.number().int().describe("The Run ID of the run that will be affected by the API call.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/bulkWrite",alias:"BulkWrite",description:"Updates multiple documents for a workspace.",requestFormat:"json",parameters:[{name:"body",description:"The workspace to update and the data to update with.",type:"Body",schema:wSf}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/customToken",alias:"GenerateCustomToken",description:"Generate a Coalesce token from the provided OpenID Connect ID token",requestFormat:"json",parameters:[{name:"body",description:"The information from the OpenID Connect authorization server required to sign into Coalesce.",type:"Body",schema:tCf}],response:M.object({customToken:M.string().describe("A Coalesce token")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/database",alias:"GetDatabase",description:"Gets the information required to connect to the Coalesce database.",requestFormat:"json",response:OSf},{method:"get",path:"/api/v1/environments",alias:"GetEnvironments",description:"Get a collection of Environment information.",requestFormat:"json",parameters:[{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()},{name:"detail",type:"Query",schema:M.boolean().describe("Include the full detail of the environments.").optional().default(!1)},{name:"limit",type:"Query",schema:M.number().int().gte(1).lte(500).describe("The maximum number of environments to return.").optional().default(100)},{name:"startingFrom",type:"Query",schema:M.string().describe("The cursor point for paging the query results.").optional()},{name:"orderBy",type:"Query",schema:M.literal("id").describe("The field to order the results by.").optional().default("id")}],response:iCf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/environments",alias:"CreateEnvironment",description:"Create a new environment.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:sCf},{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()}],response:PWo,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/environments/:environmentID",alias:"DeleteEnvironment",description:"Delete an environment.",requestFormat:"json",parameters:[{name:"environmentID",type:"Path",schema:M.string().describe("The environment ID.")},{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/environments/:environmentID",alias:"GetEnvironment",description:"Get information about an environment.",requestFormat:"json",parameters:[{name:"environmentID",type:"Path",schema:M.string().describe("The environment ID.")},{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()}],response:PWo,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/environments/:environmentID/jobs/:jobID",alias:"GetJob",description:"Get information about a job in an environment.",requestFormat:"json",parameters:[{name:"environmentID",type:"Path",schema:M.string().describe("The environment ID.")},{name:"jobID",type:"Path",schema:M.string().describe("The job ID.")}],response:M.object({id:M.string().describe("The Job ID."),name:M.string().describe("The Job name."),includeSelector:M.string().describe("A selector string of nodes to include."),excludeSelector:M.string().describe("A selector string of nodes to exclude."),createdAt:M.string().datetime({offset:!0}),updatedAt:M.string().datetime({offset:!0})}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/environments/:environmentID/nodes",alias:"GetNodes",description:"Get a collection of nodes for an environment",requestFormat:"json",parameters:[{name:"environmentID",type:"Path",schema:M.string().describe("The environment ID.")},{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()},{name:"detail",type:"Query",schema:M.boolean().describe("Include the full detail of the nodes.").optional().default(!1)},{name:"limit",type:"Query",schema:M.number().int().gte(1).lte(500).describe("The maximum number of nodes to return.").optional().default(100)},{name:"startingFrom",type:"Query",schema:M.string().describe("The cursor point for paging the query results.").optional()},{name:"orderBy",type:"Query",schema:M.literal("id").describe("The field to order the results by.").optional().default("id")},{name:"skipParsing",type:"Query",schema:M.boolean().describe("Skip parsing column references and updating sources for the nodes.").optional().default(!1)}],response:Osu,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/environments/:environmentID/nodes/:nodeID",alias:"GetNode",description:"Get information about a node in an environment.",requestFormat:"json",parameters:[{name:"environmentID",type:"Path",schema:M.string().describe("The environment ID.")},{name:"nodeID",type:"Path",schema:M.string().describe("The node ID.")},{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()},{name:"skipParsing",type:"Query",schema:M.boolean().describe("Skip parsing column references and updating sources for the nodes.").optional().default(!1)}],response:jLe,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/featureFlags",alias:"GetFeatureFlags",description:"Gets feature flags for the authenticated user.",requestFormat:"json",parameters:[{name:"subdomain",type:"Query",schema:M.string().describe("The customer subdomain.").optional()}],response:M.object({featureFlags:M.record(M.union([M.boolean(),M.string(),M.number(),M.object({}).partial().passthrough(),M.array(M.any())]))}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/featureFlags/config",alias:"GetFeatureFlagsClientConfig",description:"Gets information the client needs to connect to the feature flags service.",requestFormat:"json",response:M.object({launchDarklyClientID:M.string()}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/featureFlags/default",alias:"GetDefaultFeatureFlags",description:"Gets default feature flags for the unauthenticated users.",requestFormat:"json",response:M.object({featureFlags:M.record(M.union([M.boolean(),M.string(),M.number(),M.object({}).partial().passthrough(),M.array(M.any())]))}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/gitAccounts",alias:"ListGitAccounts",description:"Allows for a user to view all the git accounts in their org.",requestFormat:"json",parameters:[{name:"accountOwner",type:"Query",schema:M.string().describe("The owner of the git accounts. If not provided will fallback to the requester's accounts.").optional()}],response:M.object({data:vCf.describe("A list of git accounts")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/gitAccounts",alias:"CreateGitAccount",description:"Users can create git accounts for their org.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:TCf},{name:"accountOwner",type:"Query",schema:M.string().describe("The owner of the git accounts. If not provided will fallback to the requester's accounts.").optional()}],response:M.object({data:o8n.describe("All the fields needed to create a git account")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/gitAccounts/:gitAccountID",alias:"GetGitAccount",description:"Allows for a user to get a git account.",requestFormat:"json",parameters:[{name:"gitAccountID",type:"Path",schema:M.string().describe("The git account ID.")},{name:"accountOwner",type:"Query",schema:M.string().describe("The owner of the git accounts. If not provided will fallback to the requester's accounts.").optional()}],response:M.object({data:o8n.describe("All the fields needed to create a git account")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"patch",path:"/api/v1/gitAccounts/:gitAccountID",alias:"UpdateGitAccount",description:"Allows for a user to update their git account.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Gsu},{name:"gitAccountID",type:"Path",schema:M.string().describe("The git account ID.")},{name:"accountOwner",type:"Query",schema:M.string().describe("The owner of the git accounts. If not provided will fallback to the requester's accounts.").optional()}],response:M.object({data:o8n.describe("All the fields needed to create a git account")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/gitAccounts/:gitAccountID",alias:"DeleteGitAccount",description:"Allows for a user to delete a git account.",requestFormat:"json",parameters:[{name:"gitAccountID",type:"Path",schema:M.string().describe("The git account ID.")},{name:"accountOwner",type:"Query",schema:M.string().describe("The owner of the git accounts. If not provided will fallback to the requester's accounts.").optional()}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/llm/chat",alias:"GetChatMessage",description:"Get the generated AI chat message.",requestFormat:"json",parameters:[{name:"body",description:"The prompt to generate the AI chat message.",type:"Body",schema:zSf}],response:FSf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/llm/git-commit-message",alias:"GetAIGitCommitMessage",description:"Generate an AI commit message based on git diffs",requestFormat:"json",parameters:[{name:"body",description:"Git diff context for commit message generation",type:"Body",schema:LSf}],response:M.object({message:M.string().max(400).describe("AI generated git commit message (Soft max 200 chars, Hard max 400 chars)")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/llm/llm",alias:"GetLlmMessage",description:"Get the generated AI LLM message.",requestFormat:"json",parameters:[{name:"body",description:"The prompt to generate the AI LLM message.",type:"Body",schema:QSf}],response:M.object({}).partial().passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/llm/node-description",alias:"GetAINodeDescription",description:"Retrieve the generated AI descriptions for a node.",requestFormat:"json",parameters:[{name:"body",description:"workspaceID, nodeID of the node for which to generate the AI description.",type:"Body",schema:qSf}],response:M.object({description:M.string().min(1).describe("AI generated description of the node.")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/metrics",alias:"SubmitMetrics",description:"Submit a set of metrics",requestFormat:"json",parameters:[{name:"body",description:"The metrics to submit",type:"Body",schema:NSf}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/multiFactorAuth/:userID",alias:"RemoveMultiFactor",description:"Deletes the MFA for a user in firebase auth",requestFormat:"json",parameters:[{name:"userID",type:"Path",schema:M.string().describe("The user ID.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/packageRegistry/:packageID",alias:"GetRegistryPackage",description:"Get a package on the registry.",requestFormat:"json",parameters:[{name:"packageID",type:"Path",schema:M.string().min(1).describe("The package id.")}],response:wWo,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/packageRegistry/:packageID",alias:"updatePackageV2",description:"Update an existing package&#x27;s information.",requestFormat:"json",parameters:[{name:"body",description:"Updated package details. Does not include package content held in a release.",type:"Body",schema:WCf},{name:"packageID",type:"Path",schema:M.string().min(1).describe("The id of the package.")}],response:M.object({org:M.string(),name:M.string(),description:M.string(),overview:M.string(),tags:M.array(M.string()),featured:M.boolean(),certified:M.boolean(),packageID:M.string(),id:M.string().optional(),publisherID:M.string().optional(),latestRelease:M.string().optional(),platformKind:s8n}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/packageRegistry/:packageID/releases/:releaseID",alias:"updatePackageReleaseV2",description:"Update a package release.",requestFormat:"json",parameters:[{name:"body",description:"The package release info to update with.",type:"Body",schema:VCf},{name:"packageID",type:"Path",schema:M.string().min(1).describe("The package id.")},{name:"releaseID",type:"Path",schema:M.string().min(1).describe("The package release ID.")}],response:i8n,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/packageRegistry/:packageID/releases/:releaseID",alias:"GetRegistryPackageRelease",description:"Get a release from a package in the registry.",requestFormat:"json",parameters:[{name:"packageID",type:"Path",schema:M.string().min(1).describe("The package id.")},{name:"releaseID",type:"Path",schema:M.string().min(1).describe("The package release ID.")}],response:i8n,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/packageRegistry/:packageID/releases/privacy/:privacy",alias:"GetAllRegistryPackageReleases",description:"Get all available releases for a package on the registry.",requestFormat:"json",parameters:[{name:"packageID",type:"Path",schema:M.string().min(1).describe("The package id.")},{name:"privacy",type:"Path",schema:M.enum(["public","private","unlisted","all"]).describe("The privacy level of the packages requested")}],response:M.array(i8n),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/packageRegistry/all",alias:"GetAllRegistryPackages",description:"Get all available packages on the registry.",requestFormat:"json",response:M.array(wWo),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/packageRegistry/createPackage",alias:"createPackage",description:"Create a package without a release.",requestFormat:"json",parameters:[{name:"body",description:"Info describing and defining the package. Does not include package content held in a release",type:"Body",schema:KCf}],response:M.object({org:M.string(),name:M.string(),description:M.string(),overview:M.string(),tags:M.array(M.string()),featured:M.boolean(),certified:M.boolean(),packageID:M.string(),id:M.string().optional(),publisherID:M.string().optional(),latestRelease:M.string().optional(),platformKind:s8n}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/packageRegistry/createRelease",alias:"AddPackageRelease",description:"Add a new package release to an existing package.",requestFormat:"json",parameters:[{name:"body",description:"The package release info.",type:"Body",schema:$Cf}],response:i8n,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/packageRegistry/org",alias:"GetRegistryPackagesForOrg",description:"Get a release from a package in the registry.",requestFormat:"json",response:M.array(wWo),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/packageRegistry/update",alias:"UpdatePackage",description:"Update a package.",requestFormat:"json",parameters:[{name:"body",description:"The package info to create with.",type:"Body",schema:XCf}],response:M.string(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/plan",alias:"createPlan",description:"Create a deployment plan",requestFormat:"json",parameters:[{name:"body",description:"Requirements for plan creation",type:"Body",schema:DSf}],response:xSf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/plan/:environmentID/:planID",alias:"getPlan",description:"Get an existing deployment plan",requestFormat:"json",parameters:[{name:"environmentID",type:"Path",schema:M.string().describe("The environment ID")},{name:"planID",type:"Path",schema:M.string().describe("The plan ID")}],response:M.union([BSf,kSf]),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/projects",alias:"GetProjectsInOrg",description:"Get projects in org.",requestFormat:"json",parameters:[{name:"includeWorkspaces",type:"Query",schema:M.boolean().describe("Whether or not to include nested workspace data for all projects.").optional()},{name:"includeJobs",type:"Query",schema:M.boolean().describe("Whether or not to include nested job data for all workspaces in the projects.").optional()}],response:wCf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/projects",alias:"CreateProject",description:"Create a new project.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:PCf}],response:BWo,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/projects/:projectID",alias:"GetProjectInOrg",description:"Get a project.",requestFormat:"json",parameters:[{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")},{name:"includeWorkspaces",type:"Query",schema:M.boolean().describe("Whether or not to include nested workspace data for all projects.").optional()},{name:"includeJobs",type:"Query",schema:M.boolean().describe("Whether or not to include nested job data for all workspaces in the projects.").optional()}],response:Msu,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"patch",path:"/api/v1/projects/:projectID",alias:"UpdateProject",description:"Update a project",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:NCf},{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")},{name:"includeWorkspaces",type:"Query",schema:M.boolean().describe("Whether or not to include nested workspace data for all projects.").optional()},{name:"includeJobs",type:"Query",schema:M.boolean().describe("Whether or not to include nested job data for all workspaces in the projects.").optional()}],response:Msu,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/projects/:projectID",alias:"DeleteProject",description:"Delete a project.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:DCf.optional()},{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")},{name:"includeWorkspaces",type:"Query",schema:M.boolean().describe("Whether or not to include nested workspace data for all projects.").optional()},{name:"includeJobs",type:"Query",schema:M.boolean().describe("Whether or not to include nested job data for all workspaces in the projects.").optional()}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/projects/:projectID/gitAccounts",alias:"ListProjectGitAccounts",description:"List git accounts for a project",requestFormat:"json",parameters:[{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")}],response:xCf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/projects/:projectID/gitAccounts/:userID",alias:"GetProjectGitAccount",description:"Get a user&#x27;s git account for a project",requestFormat:"json",parameters:[{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")},{name:"userID",type:"Path",schema:M.string().describe("The user ID.")}],response:Hsu,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/projects/:projectID/gitAccounts/:userID",alias:"SetProjectGitAccount",description:"Set a user&#x27;s git account for a project",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:M.object({gitAccountID:M.string()}).passthrough()},{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")},{name:"userID",type:"Path",schema:M.string().describe("The user ID.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/projects/:projectID/gitAccounts/:userID",alias:"DeleteProjectGitAccount",description:"Un-set a user&#x27;s git account for a project",requestFormat:"json",parameters:[{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")},{name:"userID",type:"Path",schema:M.string().describe("The user ID.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/runs",alias:"GetRuns",description:"Get a collection of information about runs.",requestFormat:"json",parameters:[{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()},{name:"limit",type:"Query",schema:M.number().int().gte(0).lte(1e3).describe("The maximum number of runs to return.").optional().default(25)},{name:"startingFrom",type:"Query",schema:eSf},{name:"orderBy",type:"Query",schema:M.enum(["id","runStartTime","runEndTime"]).describe("The field used to sort query results. Defaults to `id`, but must be explicitly provided when also using `startingFrom`. Make sure to match data type.").optional()},{name:"orderByDirection",type:"Query",schema:M.enum(["asc","desc"]).describe("The sort order for query results.").optional().default("desc")},{name:"projectID",type:"Query",schema:tSf},{name:"runType",type:"Query",schema:rSf},{name:"runStatus",type:"Query",schema:nSf},{name:"environmentID",type:"Query",schema:iSf},{name:"detail",type:"Query",schema:M.boolean().describe("Include the full detail of the run.").optional().default(!1)}],response:bSf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/runs/:runID",alias:"GetRun",description:"Gets a single run.",requestFormat:"json",parameters:[{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()},{name:"runID",type:"Path",schema:M.number().int().describe("The run ID.")}],response:Ysu,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/runs/:runID/results",alias:"GetRunResults",description:"Get a collection of the results of a deploy or refresh run",requestFormat:"json",parameters:[{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()},{name:"runID",type:"Path",schema:M.number().int().describe("The run ID.")}],response:SSf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/runs/:runID/stored-run-results/:chunkID",alias:"GetStoredRunResults",description:"Get raw run results from external storage",requestFormat:"json",parameters:[{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()},{name:"runID",type:"Path",schema:M.string().describe("The run ID.")},{name:"chunkID",type:"Path",schema:M.string().describe("The chunk ID")}],response:ISf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/secrets/:secretType/:context",alias:"SecretExists",description:"Determines whether or not a git token value exists for a given project ID.",requestFormat:"json",parameters:[{name:"secretType",type:"Path",schema:M.string().describe("The name of the secret type.")},{name:"context",type:"Path",schema:M.string().describe("Contextual information required to identify a particular secret.")}],response:M.boolean(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/secrets/:secretType/:context",alias:"UpgradeSecret",description:"Upgrades a secret from secretType its upgrade target.",requestFormat:"json",parameters:[{name:"secretType",type:"Path",schema:M.string().describe("The name of the secret type.")},{name:"context",type:"Path",schema:M.string().describe("Contextual information required to identify a particular secret.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/secrets/:secretType/:context",alias:"SetSecret",description:"Sets the value of a secret.",requestFormat:"json",parameters:[{name:"body",description:"The new value of the secret.",type:"Body",schema:M.object({secretValue:M.unknown()}).passthrough()},{name:"secretType",type:"Path",schema:M.string().describe("The name of the secret type.")},{name:"context",type:"Path",schema:M.string().describe("Contextual information required to identify a particular secret.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/secrets/:secretType/:context",alias:"DeleteSecret",description:"Deletes a secret.",requestFormat:"json",parameters:[{name:"secretType",type:"Path",schema:M.string().describe("The name of the secret type.")},{name:"context",type:"Path",schema:M.string().describe("Contextual information required to identify a particular secret.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/sql/parse",alias:"ParseSql",description:"Parse multiple SQL expressions or FROM clauses using the Strumenta parser.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:RSf}],response:M.object({results:M.array(M.object({originalSql:M.string().describe("The original SQL expression that was parsed"),type:M.enum(["expression","from"]).describe("The type of SQL that was parsed"),platformKind:s8n,success:M.boolean().describe("Whether the parsing was successful"),result:M.union([M.object({validReferences:M.array(M.array(M.string()).min(2).max(2)).describe("Array of valid table.column references as tuples [tableName, columnName]"),invalidReferences:M.array(M.string()).describe("Array of column names that could not be resolved to a table")}).passthrough(),M.record(M.object({node:M.string().describe("Optional node identifier"),column:M.union([M.string(),M.object({}).partial().passthrough()]).describe("Column name or symbol")}).partial().passthrough())]).describe("The parsing result (only present if successful). For 'expression' type, contains table and column references. For 'from' type, contains a lookup table of aliases.").optional(),error:M.string().describe("Error message (only present if failed)").optional()}).passthrough())}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/typesense/orgs/:orgID/typesense-config",alias:"getTypesenseConfigForOrg",description:"Returns Typesense configuration data for a given org.",requestFormat:"json",parameters:[{name:"orgID",type:"Path",schema:M.string().describe("The organization ID.")}],response:ZCf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/userRoles",alias:"GetUserRoles",description:"Get all user roles in the organization, filtered by information available based on the current user&#x27;s roles and sorted alphabetically by last name, then by first name.",requestFormat:"json",parameters:[{name:"excludeOrgRoles",type:"Query",schema:M.boolean().describe("Exclude organization level roles from the results.").optional()},{name:"projectID",type:"Query",schema:M.string().describe("Return only user roles pertaining to the specified project.").optional()},{name:"environmentID",type:"Query",schema:M.string().describe("Return only user roles pertaining to the specified environment.").optional()}],response:M.array(Vsu),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/userRoles/:userID/organizationRoles",alias:"UpsertUserOrganizationRoles",description:"Creates or updates all of a user&#x27;s organization roles. Only org admins may use this API.",requestFormat:"json",parameters:[{name:"body",description:"The user&#x27;s organization roles.",type:"Body",schema:M.array(M.string())},{name:"userID",type:"Path",schema:M.string().describe("The user ID.")}],response:M.object({organizationRoles:M.array(M.string()).describe("The organization roles assigned to the user."),projects:M.record(LWo).describe("A dictionary of project role assignments keyed by project ID.")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/userRoles/:userID/projects/:projectID",alias:"DeleteUserProjectRoles",description:"Deletes all of a user&#x27;s project roles. Only org and project admins may user this API.",requestFormat:"json",parameters:[{name:"userID",type:"Path",schema:M.string().describe("The user ID.")},{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/userRoles/:userID/projects/:projectID",alias:"UpsertUserProjectRoles",description:"Creates or updates all of a user&#x27;s project roles. Only org and project admins may user this API.",requestFormat:"json",parameters:[{name:"body",description:"The user project roles.",type:"Body",schema:M.object({projectRoles:M.array(M.string()),environments:M.record(a8n).describe("A dictionary of environment role assignments keyed by environment ID.")}).passthrough()},{name:"userID",type:"Path",schema:M.string().describe("The user ID.")},{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")}],response:M.object({projectRoles:M.array(M.string()),environments:M.record(a8n).describe("A dictionary of environment role assignments keyed by environment ID.")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/userRoles/:userID/projects/:projectID/environments/:environmentID",alias:"DeleteUserEnvironmentRoles",description:"Deletes all of a user&#x27;s environment roles.",requestFormat:"json",parameters:[{name:"userID",type:"Path",schema:M.string().describe("The user ID.")},{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")},{name:"environmentID",type:"Path",schema:M.string().describe("The environment ID.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/userRoles/:userID/projects/:projectID/environments/:environmentID",alias:"UpsertUserEnvironmentRoles",description:"Creates or updates all of a user&#x27;s environment roles.",requestFormat:"json",parameters:[{name:"body",description:"The user environment roles.",type:"Body",schema:M.object({environmentRoles:M.array(M.string()).describe("The environment roles assigned to the user.")}).passthrough()},{name:"userID",type:"Path",schema:M.string().describe("The user ID.")},{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")},{name:"environmentID",type:"Path",schema:M.string().describe("The environment ID.")}],response:M.object({environmentRoles:M.array(M.string()).describe("The environment roles assigned to the user.")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/users",alias:"ListOrgUsers",description:"Get all users in the current org",requestFormat:"json",parameters:[{name:"limit",type:"Query",schema:M.number().int().gte(1).lte(500).describe("The maximum number of users to return.").optional().default(50)},{name:"startingFrom",type:"Query",schema:M.string().describe("The cursor point for paging the query results.").optional()},{name:"orderBy",type:"Query",schema:M.literal("id").describe("The field to order the results by.").optional().default("id")}],response:M.object({total:M.number().int().describe("The size of the result set."),startingFrom:M.string().describe("The cursor value used in the request.").optional(),limit:M.number().int().describe("The requested page size."),next:M.union([M.string(),M.null()]).describe("The field value representing the start of the next page of results."),data:M.array(M.object({firstName:M.string(),lastName:M.string(),email:M.string(),id:M.string(),authDisabled:M.boolean(),deleted:M.boolean()}).partial().passthrough())}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/users/:userId",alias:"DeleteUser",description:"Delete a user by ID.",requestFormat:"json",parameters:[{name:"userId",type:"Path",schema:M.string().describe("The user ID.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge}]},{method:"post",path:"/api/v1/validHostname",alias:"ValidateHostname",description:"Validates the passed hostname and returns an authorized version.",requestFormat:"json",parameters:[{name:"body",description:"The hostname that needs to be validated.",type:"Body",schema:M.object({hostname:M.string()}).passthrough()}],response:M.string(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/workspaces/:workspaceID/bigquery/projects",alias:"GetBigQueryProjects",description:"Retrieves BigQuery projects accessible by the workspace&#x27;s configured account.",requestFormat:"json",parameters:[{name:"workspaceID",type:"Path",schema:M.string().describe("The workspace ID.")}],response:HSf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/workspaces/:workspaceID/bigquery/projects/:projectID/datasets",alias:"GetBigQueryDatasets",description:`Retrieves BigQuery datasets (schemas) for a given project.
2032
2032
  Uses the BigQuery datasets.list API which returns only existing datasets,
2033
2033
  unlike INFORMATION_SCHEMA.SCHEMATA which includes deleted entries.
2034
- `,requestFormat:"json",parameters:[{name:"workspaceID",type:"Path",schema:M.string().describe("The workspace ID.")},{name:"projectID",type:"Path",schema:M.string().describe("The BigQuery project ID to list datasets for.")}],response:M.array(M.string()),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/workspaces/:workspaceID/databricks/warehouse",alias:"GetDatabricksWarehouse",description:"Retrieves a list of all SQL warehouses that a user has manager permissions on.",requestFormat:"json",parameters:[{name:"workspaceID",type:"Path",schema:M.string().describe("The ID of the workspace")},{name:"x-databricks-browser-token",type:"Header",schema:M.string().describe("Token from browser storage, only used when connection type is browser storage token.").optional()}],response:jSf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/workspaces/:workspaceID/jobs",alias:"CreateJob",description:"Create a new job in a workspace.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Rsu},{name:"workspaceID",type:"Path",schema:M.string().describe("The workspace ID.")}],response:M.object({id:M.string().describe("The Job ID."),name:M.string().describe("The Job name."),includeSelector:M.string().describe("A selector string of nodes to include."),excludeSelector:M.string().describe("A selector string of nodes to exclude."),createdAt:M.string().datetime({offset:!0}),updatedAt:M.string().datetime({offset:!0})}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/workspaces/:workspaceID/jobs/:jobID",alias:"UpdateJob",description:"Update all fields of an existing job in a workspace.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Rsu},{name:"workspaceID",type:"Path",schema:M.string().describe("The workspace ID.")},{name:"jobID",type:"Path",schema:M.string().describe("The job ID.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/workspaces/:workspaceID/jobs/:jobID",alias:"DeleteJob",description:"Delete a job from a workspace.",requestFormat:"json",parameters:[{name:"workspaceID",type:"Path",schema:M.string().describe("The workspace ID.")},{name:"jobID",type:"Path",schema:M.string().describe("The job ID.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/workspaces/:workspaceID/nodes",alias:"GetWorkspaceNodes",description:"Get a collection of nodes for a workspace.",requestFormat:"json",parameters:[{name:"workspaceID",type:"Path",schema:M.string().describe("The workspace ID.")},{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()},{name:"detail",type:"Query",schema:M.boolean().describe("Include the full detail of the nodes.").optional().default(!1)},{name:"limit",type:"Query",schema:M.number().int().gte(1).lte(500).describe("The maximum number of nodes to return.").optional().default(100)},{name:"startingFrom",type:"Query",schema:M.string().describe("The cursor point for paging the query results.").optional()},{name:"orderBy",type:"Query",schema:M.literal("id").describe("The field to order the results by.").optional().default("id")}],response:Osu,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/workspaces/:workspaceID/nodes",alias:"CreateNode",description:"Create a new node in a workspace.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:ICf},{name:"workspaceID",type:"Path",schema:M.string().describe("The workspace ID.")},{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()}],response:jLe,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/workspaces/:workspaceID/nodes/:nodeID",alias:"GetWorkspaceNode",description:"Get information about a node in a workspace.",requestFormat:"json",parameters:[{name:"workspaceID",type:"Path",schema:M.string().describe("The environment ID.")},{name:"nodeID",type:"Path",schema:M.string().describe("The node ID.")},{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()}],response:jLe,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/workspaces/:workspaceID/nodes/:nodeID",alias:"SetWorkspaceNode",description:"Replace all fields of a node in a workspace.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:jLe},{name:"workspaceID",type:"Path",schema:M.string().describe("The environment ID.")},{name:"nodeID",type:"Path",schema:M.string().describe("The node ID.")},{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()}],response:jLe,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/workspaces/:workspaceID/nodes/:nodeID",alias:"DeleteWorkspaceNode",description:"Delete a node in a workspace.",requestFormat:"json",parameters:[{name:"workspaceID",type:"Path",schema:M.string().describe("The environment ID.")},{name:"nodeID",type:"Path",schema:M.string().describe("The node ID.")},{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/workspaces/:workspaceID/subgraphs",alias:"CreateSubgraph",description:"Create a new subgraph for organizing and managing a collection of nodes.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Psu},{name:"workspaceID",type:"Path",schema:M.string().describe("ID of the workspace containing the subgraph")}],response:M.object({data:Nsu.describe("A partial collection of nodes from the node graph, allowing easier viewing and editing of a portion of a large graph.")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/workspaces/:workspaceID/subgraphs/:subgraphID",alias:"UpdateSubgraph",description:"Update a subgraph.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Psu},{name:"subgraphID",type:"Path",schema:M.string().describe("ID of the subgraph being fetched")},{name:"workspaceID",type:"Path",schema:M.string().describe("ID of the workspace containing the subgraph")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/workspaces/:workspaceID/subgraphs/:subgraphID",alias:"DeleteSubgraph",description:"Delete a subgraph.",requestFormat:"json",parameters:[{name:"subgraphID",type:"Path",schema:M.string().describe("ID of the subgraph being fetched")},{name:"workspaceID",type:"Path",schema:M.string().describe("ID of the workspace containing the subgraph")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/workspaces/:workspaceID/subgraphs/:subgraphID",alias:"GetSubgraph",description:"Get a subgraph.",requestFormat:"json",parameters:[{name:"subgraphID",type:"Path",schema:M.string().describe("ID of the subgraph being fetched")},{name:"workspaceID",type:"Path",schema:M.string().describe("ID of the workspace containing the subgraph")}],response:M.object({data:Nsu.describe("A partial collection of nodes from the node graph, allowing easier viewing and editing of a portion of a large graph.")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v2/userRoles",alias:"GetUserRolesV2",description:"Get all user roles in the organization, filtered by information available based on the current user&#x27;s roles",requestFormat:"json",parameters:[{name:"projectID",type:"Query",schema:M.string().describe("Return only user roles pertaining to the specified project.").optional()},{name:"environmentID",type:"Query",schema:M.string().describe("Return only user roles pertaining to the specified environment.").optional()}],response:GCf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v2/userRoles/:userID",alias:"GetSingleUserRolesV2",description:"Get a single user&#x27;s roles.",requestFormat:"json",parameters:[{name:"userID",type:"Path",schema:M.string().describe("The user ID.")},{name:"projectID",type:"Query",schema:M.string().describe("The project ID.").optional()},{name:"environmentID",type:"Query",schema:M.string().describe("The environment ID.").optional()}],response:Hft,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v2/userRoles/:userID/environments/:environmentID",alias:"DeleteUserEnvironmentRoleV2",description:"Deletes all of a user&#x27;s environment roles.",requestFormat:"json",parameters:[{name:"userID",type:"Path",schema:M.string().describe("The user ID.")},{name:"environmentID",type:"Path",schema:M.string().describe("The environment ID.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v2/userRoles/:userID/environments/:environmentID",alias:"UpsertUserEnvironmentRoleV2",description:"Creates or updates a user&#x27;s environment role.",requestFormat:"json",parameters:[{name:"body",description:"The user environment role.",type:"Body",schema:HCf},{name:"userID",type:"Path",schema:M.string().describe("The user ID.")},{name:"environmentID",type:"Path",schema:M.string().describe("The environment ID.")}],response:Hft,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v2/userRoles/:userID/organizationRole",alias:"UpsertUserOrganizationRoleV2",description:"Creates or updates a user&#x27;s organization role. Only org admins may use this API.",requestFormat:"json",parameters:[{name:"body",description:"The user&#x27;s organization role.",type:"Body",schema:M.object({organizationRole:M.string()}).passthrough()},{name:"userID",type:"Path",schema:M.string().describe("The user ID.")}],response:Hft,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v2/userRoles/:userID/projects/:projectID",alias:"DeleteUserProjectRoleV2",description:"Deletes all of a user&#x27;s project roles. Only org and project admins may user this API.",requestFormat:"json",parameters:[{name:"userID",type:"Path",schema:M.string().describe("The user ID.")},{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v2/userRoles/:userID/projects/:projectID",alias:"UpsertUserProjectRoleV2",description:"Creates or updates a user&#x27;s project role. Only org and project admins may user this API.",requestFormat:"json",parameters:[{name:"body",description:"The user project role",type:"Body",schema:M.object({projectRole:M.string()}).passthrough()},{name:"userID",type:"Path",schema:M.string().describe("The user ID.")},{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")}],response:Hft,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/scheduler/secret/:secretType/:context",alias:"SecretExistsV0",description:"Determines whether or not a git token value exists for a given project ID.",requestFormat:"json",parameters:[{name:"secretType",type:"Path",schema:M.string().describe("The name of the secret type.")},{name:"context",type:"Path",schema:M.string().describe("Contextual information required to identify a particular secret.")}],response:M.boolean(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/scheduler/secret/:secretType/:context",alias:"SetSecretV0",description:"Sets the value of a secret.",requestFormat:"json",parameters:[{name:"body",description:"The new value of the secret.",type:"Body",schema:M.object({secretValue:M.unknown()}).passthrough()},{name:"secretType",type:"Path",schema:M.string().describe("The name of the secret type.")},{name:"context",type:"Path",schema:M.string().describe("Contextual information required to identify a particular secret.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/scheduler/secret/:secretType/:context",alias:"DeleteSecretV0",description:"Deletes a secret.",requestFormat:"json",parameters:[{name:"secretType",type:"Path",schema:M.string().describe("The name of the secret type.")},{name:"context",type:"Path",schema:M.string().describe("Contextual information required to identify a particular secret.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]}]),LNb=new ULe($su);function zWo(r,t){return new ULe(r,$su,t)}var $le=(()=>{let r=o=>{if(typeof window<"u"){let s=window[o];if(typeof s=="string"&&s)return s}return process.env[o]},t=r("FIREBASE_AUTH_EMULATOR_HOST"),n=r("FIRESTORE_EMULATOR_HOST"),i=r("FIREBASE_STORAGE_EMULATOR_HOST");if(!!t!=!!n||!!t!=!!i||!!n!=!!i)throw new Error(`Inconsistent Firebase emulator use! All three emulators must be used, or none! auth=${t} firestore=${n} storage=${i}`);return t&&n&&i?qf().isTest?{auth:"http://"+t,firestore:n,storage:i}:{auth:t,firestore:n,storage:i}:null})();var $Sf=hm({auth:Kl(),firestore:Kl(),storage:Kl()}),Xsu=fr("FirebaseEmulatorInfo",$Sf);var Wft=We("FIREBASE"),XSf=(r,t)=>{let n;if($le)n=$le;else if("emulatorInfo"in r.options)n=Xsu.assert(r.options.emulatorInfo);else return!1;qf().isTest&&(t=!1),Wft.info(`Using Firebase Auth emulator at ${n.auth}`),typeof window<"u"?ove(BDn(r),n.auth):r.auth().useEmulator(n.auth),Wft.info(`Using Firestore emulator at ${n.firestore} over ${t?"https":"http"}`);let[i,o]=n.firestore.split(":");r.firestore().useEmulator(i,parseInt(o)),t&&r.firestore()._delegate._setSettings({...r.firestore()._delegate._getSettings(),ssl:!0}),Wft.info(`Using Firebase Storage emulator at ${n.storage} over ${t?"https":"http"}`);let[s,a]=n.storage.split(":");return r.storage().useEmulator(s,parseInt(a)),t&&(r.storage()._delegate._protocol="https"),!0},ZSf="[DEFAULT]";var Zsu=async(r,t)=>{X0.apps.find(n=>n.name===(t??ZSf))||await e_f(r,t)};async function e_f(r,t){let n=X0.initializeApp(r,t);if(!XSf(n,!0)&&!uT()&&fSe(!1,"proxyFirestore")){let i=await eau(r);Wft.info(`Using Firestore proxy host: ${i}`),n.firestore().settings({host:i})}}var eau=r=>{if(r.emulatorInfo)return`http://${r.emulatorInfo.firestore}`;let t=new URL(OBe());return ed(t.protocol==="https:"&&(t.port==="443"||t.port==="")&&t.pathname==="/",`Unable to specify a firestore proxy host for backend URL ${t}. Only HTTPS with no port and no path is supported.`,"FIREBASE"),`${t.hostname}/firestore`};var t_f=X0;var tau=()=>t_f;var rau=r=>IBe()?Promise.resolve():r.delete().catch(t=>{Wft.error(`Error deleting firebase instance: ${t}`)});var kT=[];for(let r=0;r<256;++r)kT.push((r+256).toString(16).slice(1));function nau(r,t=0){return(kT[r[t+0]]+kT[r[t+1]]+kT[r[t+2]]+kT[r[t+3]]+"-"+kT[r[t+4]]+kT[r[t+5]]+"-"+kT[r[t+6]]+kT[r[t+7]]+"-"+kT[r[t+8]]+kT[r[t+9]]+"-"+kT[r[t+10]]+kT[r[t+11]]+kT[r[t+12]]+kT[r[t+13]]+kT[r[t+14]]+kT[r[t+15]]).toLowerCase()}var iau=require("crypto"),p8n=new Uint8Array(256),d8n=p8n.length;function FWo(){return d8n>p8n.length-16&&((0,iau.randomFillSync)(p8n),d8n=0),p8n.slice(d8n,d8n+=16)}var oau=require("crypto"),QWo={randomUUID:oau.randomUUID};function n_f(r,t,n){if(QWo.randomUUID&&!t&&!r)return QWo.randomUUID();r=r||{};let i=r.random??r.rng?.()??FWo();if(i.length<16)throw new Error("Random bytes length must be >= 16");if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){if(n=n||0,n<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[n+o]=i[o];return t}return nau(i)}var Za=n_f;var Iz={None:null,sysCreateDate:"isSystemCreateDate",sysUpdateDate:"isSystemUpdateDate",sysStartDate:"isSystemStartDate",sysEndDate:"isSystemEndDate",sysVersion:"isSystemVersion",sysCurrentFlag:"isSystemCurrentFlag"},UWo={isChangeTracking:"isChangeTracking",isSurrogateKey:"isSurrogateKey",isBusinessKey:"isBusinessKey",none:"None"},f8n={isBusinessKey:"primaryBusinessKey",isSurrogateKey:"surrogateKey"},jWo=r=>!!(typeof r=="object"&&r!==null&&"items"in r&&Array.isArray(r.items)),GWo={[Iz.sysCreateDate]:"sysCreateDate",[Iz.sysUpdateDate]:"sysUpdateDate",[Iz.sysStartDate]:"sysStartDate",[Iz.sysEndDate]:"sysEndDate",[Iz.sysVersion]:"sysVersion",[Iz.sysCurrentFlag]:"sysCurrentFlag"};var o_f=We("TIMING_UTILS"),fre=r=>new Promise(t=>setTimeout(t,r)),hp=async(r,t,n,i,o="debug",...s)=>{let a=We(n);a.logContextAtLevel(o,t,r,"starting");let u=performance.now();try{return await i()}catch(l){let{error:{errorString:c,errorDetail:d}}=Ga(l);throw a.errorContext(t,r,`
2034
+ `,requestFormat:"json",parameters:[{name:"workspaceID",type:"Path",schema:M.string().describe("The workspace ID.")},{name:"projectID",type:"Path",schema:M.string().describe("The BigQuery project ID to list datasets for.")}],response:M.array(M.string()),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/workspaces/:workspaceID/databricks/warehouse",alias:"GetDatabricksWarehouse",description:"Retrieves a list of all SQL warehouses that a user has manager permissions on.",requestFormat:"json",parameters:[{name:"workspaceID",type:"Path",schema:M.string().describe("The ID of the workspace")},{name:"x-databricks-browser-token",type:"Header",schema:M.string().describe("Token from browser storage, only used when connection type is browser storage token.").optional()}],response:jSf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/workspaces/:workspaceID/jobs",alias:"CreateJob",description:"Create a new job in a workspace.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Rsu},{name:"workspaceID",type:"Path",schema:M.string().describe("The workspace ID.")}],response:M.object({id:M.string().describe("The Job ID."),name:M.string().describe("The Job name."),includeSelector:M.string().describe("A selector string of nodes to include."),excludeSelector:M.string().describe("A selector string of nodes to exclude."),createdAt:M.string().datetime({offset:!0}),updatedAt:M.string().datetime({offset:!0})}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/workspaces/:workspaceID/jobs/:jobID",alias:"UpdateJob",description:"Update all fields of an existing job in a workspace.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Rsu},{name:"workspaceID",type:"Path",schema:M.string().describe("The workspace ID.")},{name:"jobID",type:"Path",schema:M.string().describe("The job ID.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/workspaces/:workspaceID/jobs/:jobID",alias:"DeleteJob",description:"Delete a job from a workspace.",requestFormat:"json",parameters:[{name:"workspaceID",type:"Path",schema:M.string().describe("The workspace ID.")},{name:"jobID",type:"Path",schema:M.string().describe("The job ID.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/workspaces/:workspaceID/nodes",alias:"GetWorkspaceNodes",description:"Get a collection of nodes for a workspace.",requestFormat:"json",parameters:[{name:"workspaceID",type:"Path",schema:M.string().describe("The workspace ID.")},{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()},{name:"detail",type:"Query",schema:M.boolean().describe("Include the full detail of the nodes.").optional().default(!1)},{name:"limit",type:"Query",schema:M.number().int().gte(1).lte(500).describe("The maximum number of nodes to return.").optional().default(100)},{name:"startingFrom",type:"Query",schema:M.string().describe("The cursor point for paging the query results.").optional()},{name:"orderBy",type:"Query",schema:M.literal("id").describe("The field to order the results by.").optional().default("id")},{name:"skipParsing",type:"Query",schema:M.boolean().describe("Skip parsing column references and updating sources for the nodes.").optional().default(!1)}],response:Osu,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/workspaces/:workspaceID/nodes",alias:"CreateNode",description:"Create a new node in a workspace.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:ICf},{name:"workspaceID",type:"Path",schema:M.string().describe("The workspace ID.")},{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()}],response:jLe,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/workspaces/:workspaceID/nodes/:nodeID",alias:"GetWorkspaceNode",description:"Get information about a node in a workspace.",requestFormat:"json",parameters:[{name:"workspaceID",type:"Path",schema:M.string().describe("The environment ID.")},{name:"nodeID",type:"Path",schema:M.string().describe("The node ID.")},{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()},{name:"skipParsing",type:"Query",schema:M.boolean().describe("Skip parsing column references and updating sources for the nodes.").optional().default(!1)}],response:jLe,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/workspaces/:workspaceID/nodes/:nodeID",alias:"SetWorkspaceNode",description:"Replace all fields of a node in a workspace.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:jLe},{name:"workspaceID",type:"Path",schema:M.string().describe("The environment ID.")},{name:"nodeID",type:"Path",schema:M.string().describe("The node ID.")},{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()}],response:jLe,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/workspaces/:workspaceID/nodes/:nodeID",alias:"DeleteWorkspaceNode",description:"Delete a node in a workspace.",requestFormat:"json",parameters:[{name:"workspaceID",type:"Path",schema:M.string().describe("The environment ID.")},{name:"nodeID",type:"Path",schema:M.string().describe("The node ID.")},{name:"overrideOrgID",type:"Query",schema:M.string().describe("Runs an operation against the specified org. (Super-users only.)").optional()}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/api/v1/workspaces/:workspaceID/subgraphs",alias:"CreateSubgraph",description:"Create a new subgraph for organizing and managing a collection of nodes.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Psu},{name:"workspaceID",type:"Path",schema:M.string().describe("ID of the workspace containing the subgraph")}],response:M.object({data:Nsu.describe("A partial collection of nodes from the node graph, allowing easier viewing and editing of a portion of a large graph.")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v1/workspaces/:workspaceID/subgraphs/:subgraphID",alias:"UpdateSubgraph",description:"Update a subgraph.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:Psu},{name:"subgraphID",type:"Path",schema:M.string().describe("ID of the subgraph being fetched")},{name:"workspaceID",type:"Path",schema:M.string().describe("ID of the workspace containing the subgraph")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v1/workspaces/:workspaceID/subgraphs/:subgraphID",alias:"DeleteSubgraph",description:"Delete a subgraph.",requestFormat:"json",parameters:[{name:"subgraphID",type:"Path",schema:M.string().describe("ID of the subgraph being fetched")},{name:"workspaceID",type:"Path",schema:M.string().describe("ID of the workspace containing the subgraph")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v1/workspaces/:workspaceID/subgraphs/:subgraphID",alias:"GetSubgraph",description:"Get a subgraph.",requestFormat:"json",parameters:[{name:"subgraphID",type:"Path",schema:M.string().describe("ID of the subgraph being fetched")},{name:"workspaceID",type:"Path",schema:M.string().describe("ID of the workspace containing the subgraph")}],response:M.object({data:Nsu.describe("A partial collection of nodes from the node graph, allowing easier viewing and editing of a portion of a large graph.")}).passthrough(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v2/userRoles",alias:"GetUserRolesV2",description:"Get all user roles in the organization, filtered by information available based on the current user&#x27;s roles",requestFormat:"json",parameters:[{name:"projectID",type:"Query",schema:M.string().describe("Return only user roles pertaining to the specified project.").optional()},{name:"environmentID",type:"Query",schema:M.string().describe("Return only user roles pertaining to the specified environment.").optional()}],response:GCf,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/api/v2/userRoles/:userID",alias:"GetSingleUserRolesV2",description:"Get a single user&#x27;s roles.",requestFormat:"json",parameters:[{name:"userID",type:"Path",schema:M.string().describe("The user ID.")},{name:"projectID",type:"Query",schema:M.string().describe("The project ID.").optional()},{name:"environmentID",type:"Query",schema:M.string().describe("The environment ID.").optional()}],response:Hft,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v2/userRoles/:userID/environments/:environmentID",alias:"DeleteUserEnvironmentRoleV2",description:"Deletes all of a user&#x27;s environment roles.",requestFormat:"json",parameters:[{name:"userID",type:"Path",schema:M.string().describe("The user ID.")},{name:"environmentID",type:"Path",schema:M.string().describe("The environment ID.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v2/userRoles/:userID/environments/:environmentID",alias:"UpsertUserEnvironmentRoleV2",description:"Creates or updates a user&#x27;s environment role.",requestFormat:"json",parameters:[{name:"body",description:"The user environment role.",type:"Body",schema:HCf},{name:"userID",type:"Path",schema:M.string().describe("The user ID.")},{name:"environmentID",type:"Path",schema:M.string().describe("The environment ID.")}],response:Hft,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v2/userRoles/:userID/organizationRole",alias:"UpsertUserOrganizationRoleV2",description:"Creates or updates a user&#x27;s organization role. Only org admins may use this API.",requestFormat:"json",parameters:[{name:"body",description:"The user&#x27;s organization role.",type:"Body",schema:M.object({organizationRole:M.string()}).passthrough()},{name:"userID",type:"Path",schema:M.string().describe("The user ID.")}],response:Hft,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/api/v2/userRoles/:userID/projects/:projectID",alias:"DeleteUserProjectRoleV2",description:"Deletes all of a user&#x27;s project roles. Only org and project admins may user this API.",requestFormat:"json",parameters:[{name:"userID",type:"Path",schema:M.string().describe("The user ID.")},{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"put",path:"/api/v2/userRoles/:userID/projects/:projectID",alias:"UpsertUserProjectRoleV2",description:"Creates or updates a user&#x27;s project role. Only org and project admins may user this API.",requestFormat:"json",parameters:[{name:"body",description:"The user project role",type:"Body",schema:M.object({projectRole:M.string()}).passthrough()},{name:"userID",type:"Path",schema:M.string().describe("The user ID.")},{name:"projectID",type:"Path",schema:M.string().describe("The project ID.")}],response:Hft,errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:409,description:"The requested resource already exists.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"get",path:"/scheduler/secret/:secretType/:context",alias:"SecretExistsV0",description:"Determines whether or not a git token value exists for a given project ID.",requestFormat:"json",parameters:[{name:"secretType",type:"Path",schema:M.string().describe("The name of the secret type.")},{name:"context",type:"Path",schema:M.string().describe("Contextual information required to identify a particular secret.")}],response:M.boolean(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"post",path:"/scheduler/secret/:secretType/:context",alias:"SetSecretV0",description:"Sets the value of a secret.",requestFormat:"json",parameters:[{name:"body",description:"The new value of the secret.",type:"Body",schema:M.object({secretValue:M.unknown()}).passthrough()},{name:"secretType",type:"Path",schema:M.string().describe("The name of the secret type.")},{name:"context",type:"Path",schema:M.string().describe("Contextual information required to identify a particular secret.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]},{method:"delete",path:"/scheduler/secret/:secretType/:context",alias:"DeleteSecretV0",description:"Deletes a secret.",requestFormat:"json",parameters:[{name:"secretType",type:"Path",schema:M.string().describe("The name of the secret type.")},{name:"context",type:"Path",schema:M.string().describe("Contextual information required to identify a particular secret.")}],response:M.void(),errors:[{status:400,description:"The request was invalid.",schema:ge},{status:401,description:"User lacks authorization to perform this action.",schema:ge},{status:403,description:"The client is not permitted to perform the requested operation.",schema:ge},{status:404,description:"The requested resource could not be found.",schema:ge},{status:500,description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",schema:ge},{status:502,description:"The server received an error from an upstream system.",schema:ge},{status:503,description:"The service is currently unavailable.",schema:ge},{status:504,description:"The server did not receive a response in time from an upstream system.",schema:ge}]}]),LNb=new ULe($su);function zWo(r,t){return new ULe(r,$su,t)}var $le=(()=>{let r=o=>{if(typeof window<"u"){let s=window[o];if(typeof s=="string"&&s)return s}return process.env[o]},t=r("FIREBASE_AUTH_EMULATOR_HOST"),n=r("FIRESTORE_EMULATOR_HOST"),i=r("FIREBASE_STORAGE_EMULATOR_HOST");if(!!t!=!!n||!!t!=!!i||!!n!=!!i)throw new Error(`Inconsistent Firebase emulator use! All three emulators must be used, or none! auth=${t} firestore=${n} storage=${i}`);return t&&n&&i?qf().isTest?{auth:"http://"+t,firestore:n,storage:i}:{auth:t,firestore:n,storage:i}:null})();var $Sf=hm({auth:Kl(),firestore:Kl(),storage:Kl()}),Xsu=fr("FirebaseEmulatorInfo",$Sf);var Wft=We("FIREBASE"),XSf=(r,t)=>{let n;if($le)n=$le;else if("emulatorInfo"in r.options)n=Xsu.assert(r.options.emulatorInfo);else return!1;qf().isTest&&(t=!1),Wft.info(`Using Firebase Auth emulator at ${n.auth}`),typeof window<"u"?ove(BDn(r),n.auth):r.auth().useEmulator(n.auth),Wft.info(`Using Firestore emulator at ${n.firestore} over ${t?"https":"http"}`);let[i,o]=n.firestore.split(":");r.firestore().useEmulator(i,parseInt(o)),t&&r.firestore()._delegate._setSettings({...r.firestore()._delegate._getSettings(),ssl:!0}),Wft.info(`Using Firebase Storage emulator at ${n.storage} over ${t?"https":"http"}`);let[s,a]=n.storage.split(":");return r.storage().useEmulator(s,parseInt(a)),t&&(r.storage()._delegate._protocol="https"),!0},ZSf="[DEFAULT]";var Zsu=async(r,t)=>{X0.apps.find(n=>n.name===(t??ZSf))||await e_f(r,t)};async function e_f(r,t){let n=X0.initializeApp(r,t);if(!XSf(n,!0)&&!uT()&&fSe(!1,"proxyFirestore")){let i=await eau(r);Wft.info(`Using Firestore proxy host: ${i}`),n.firestore().settings({host:i})}}var eau=r=>{if(r.emulatorInfo)return`http://${r.emulatorInfo.firestore}`;let t=new URL(OBe());return ed(t.protocol==="https:"&&(t.port==="443"||t.port==="")&&t.pathname==="/",`Unable to specify a firestore proxy host for backend URL ${t}. Only HTTPS with no port and no path is supported.`,"FIREBASE"),`${t.hostname}/firestore`};var t_f=X0;var tau=()=>t_f;var rau=r=>IBe()?Promise.resolve():r.delete().catch(t=>{Wft.error(`Error deleting firebase instance: ${t}`)});var kT=[];for(let r=0;r<256;++r)kT.push((r+256).toString(16).slice(1));function nau(r,t=0){return(kT[r[t+0]]+kT[r[t+1]]+kT[r[t+2]]+kT[r[t+3]]+"-"+kT[r[t+4]]+kT[r[t+5]]+"-"+kT[r[t+6]]+kT[r[t+7]]+"-"+kT[r[t+8]]+kT[r[t+9]]+"-"+kT[r[t+10]]+kT[r[t+11]]+kT[r[t+12]]+kT[r[t+13]]+kT[r[t+14]]+kT[r[t+15]]).toLowerCase()}var iau=require("crypto"),p8n=new Uint8Array(256),d8n=p8n.length;function FWo(){return d8n>p8n.length-16&&((0,iau.randomFillSync)(p8n),d8n=0),p8n.slice(d8n,d8n+=16)}var oau=require("crypto"),QWo={randomUUID:oau.randomUUID};function n_f(r,t,n){if(QWo.randomUUID&&!t&&!r)return QWo.randomUUID();r=r||{};let i=r.random??r.rng?.()??FWo();if(i.length<16)throw new Error("Random bytes length must be >= 16");if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){if(n=n||0,n<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[n+o]=i[o];return t}return nau(i)}var Za=n_f;var Iz={None:null,sysCreateDate:"isSystemCreateDate",sysUpdateDate:"isSystemUpdateDate",sysStartDate:"isSystemStartDate",sysEndDate:"isSystemEndDate",sysVersion:"isSystemVersion",sysCurrentFlag:"isSystemCurrentFlag"},UWo={isChangeTracking:"isChangeTracking",isSurrogateKey:"isSurrogateKey",isBusinessKey:"isBusinessKey",none:"None"},f8n={isBusinessKey:"primaryBusinessKey",isSurrogateKey:"surrogateKey"},jWo=r=>!!(typeof r=="object"&&r!==null&&"items"in r&&Array.isArray(r.items)),GWo={[Iz.sysCreateDate]:"sysCreateDate",[Iz.sysUpdateDate]:"sysUpdateDate",[Iz.sysStartDate]:"sysStartDate",[Iz.sysEndDate]:"sysEndDate",[Iz.sysVersion]:"sysVersion",[Iz.sysCurrentFlag]:"sysCurrentFlag"};var o_f=We("TIMING_UTILS"),fre=r=>new Promise(t=>setTimeout(t,r)),hp=async(r,t,n,i,o="debug",...s)=>{let a=We(n);a.logContextAtLevel(o,t,r,"starting");let u=performance.now();try{return await i()}catch(l){let{error:{errorString:c,errorDetail:d}}=Ga(l);throw a.errorContext(t,r,`
2035
2035
  rejected with an error: `,c,d),l}finally{let c=performance.now()-u;a.logContextAtLevel(o,t,r,`
2036
2036
  completed in ${c}ms`,{name:r,"time-ms":c,params:s})}};var sau=async(r,t,n)=>{let i=`Back-end: ${r}`;try{return await hp(i,n,"PERFORMANCE",()=>t(r))}catch(o){let s=o;throw o.message==="Cannot read property 'currentSecretID' of undefined"&&(s=new Error("Missing password or client secret - please update your environment settings")),s}},aau=r=>r.hasOwnProperty("seconds")&&r.hasOwnProperty("nanoseconds"),s_f=r=>typeof r=="string"?new Date(r).getTime():!r||typeof r!="object"?(o_f.assert("invalid time in GetMsFromQueryResultTime: ",r,"typeof time:",typeof r),0):aau(r)?r.seconds*1e3+r.nanoseconds/1e6:r.getTime();var A8n=r=>{if(aau(r)){let t=s_f(r);return new Date(t)}else return typeof r.toDate=="function"?r.toDate():r};var uau=r=>{let t=new Date().getTime()-r.getTime();return Math.round(t/(24*60*60*1e3))};var HWo=r=>+((performance.now()-r)/1e3).toFixed(3),P1=(r,t)=>{let n="[performanceSummary]",i=[],o=performance.now(),s=(c,d)=>`${c}: ${HWo(d)} seconds`,a=(c,d)=>i.push(`
2037
2037
  ${s(c,d)};`);return{measure:async(c,d,p=!1)=>{let f=performance.now();try{let A=await d();return a(p?`${c} (${A})`:c,f),A}catch(A){throw a(`${c} (FAILED)`,f),A}},printSummary:()=>{let c=`(${s("total runtime",o)})`;We("PERFORMANCE").infoContext(t,n,r,c,...i)}}};var Cau=require("node:os");var gV=class extends et{constructor(n,i){var t=(...CDb)=>(super(...CDb),this.requestId=i,this);i?t(n,`Request ID: ${i}`):t(n)}};var Sb=We("RENDERER"),cau=r=>{let t=r;return t.state="in use",t},a_f=r=>{let t=r;return t.state="unused",t},lau=r=>{let t=r;return t.state="terminated",t},u_f=r=>{let t=r;return t.state="error",t},VWo=class extends et{constructor(n=null){let i="Cannot render on shutdown pool!"+(n===null?"":`, requestID=${n}`);super(i);this.requestID=n}},h8n=class extends et{constructor(n=null){let i="Exiting terminated pool"+(n===null?"":`, requestID=${n}`);super(i);this.requestID=n}},g8n=class{constructor(t,n){this.size=t;this.renderFactory=n;if(this.initializeNewRenderer(),!this.renderers[0])throw new gV("A render pool must have a size greater than 0")}renderers=[];queued=[];terminated=!1;stopped=!1;initFailureTracker=new Map;renderFailureTracker=new Map;allSlotsTerminal=()=>this.renderers.every(t=>t.state==="error"||t.state==="terminated");getInitFailureCount=t=>this.initFailureTracker.get(t.id)||0;getRenderFailureCount=t=>this.renderFailureTracker.get(t.id)||0;IsAcceptingRequests=()=>!(this.terminated||this.stopped);IsInitialized=()=>Promise.any(this.renderers.map(t=>t.renderer.IsInitialized())).catch(()=>this.renderers[0].renderer.IsInitialized());handleNextQueued=async t=>{let n=this.queued.pop();if(n===void 0){Sb.debug("render pool queue empty, freeing slot"),a_f(t);return}Sb.debug("Rendering request",n.request.id),await this.renderWithRetries(t,n)};handleError=(t,n)=>{if(this.terminated){lau(t);return}Sb.error("Got a critical renderer error, terminating and creating a new renderer:",n),t.renderer.terminate(.1).catch(()=>{}),t.renderer=this.renderFactory()};awaitInitializationWithRetries=async t=>{t.id>0&&await this.renderers[0].renderer.IsInitialized();let n=3;do try{await t.renderer.IsInitialized();break}catch(i){if(this.terminated)return;this.initFailureTracker.set(t.id,this.getInitFailureCount(t)+1),this.handleError(t,i)}while(this.getInitFailureCount(t)<n-1);try{await t.renderer.IsInitialized()}catch(i){if(this.terminated)return;if(u_f(t),Sb.error("Fatal error: Renderer never initialized:",i),this.allSlotsTerminal()&&!this.terminated)try{await this.terminate()}catch(o){Sb.alert("During termination due to fatal renderer error, got an error!",o)}return}Sb.debug("Initialized a renderer at slot",t.id),this.handleNextQueued(cau(t)).catch(i=>{Sb.debug("Got an error in queue after awaiting initialization with retries",i)})};initializeNewRenderer=()=>{if(this.renderers.length<this.size){let t=this.renderFactory(),n=this.renderers.length,i={id:n,state:"initializing",renderer:t};this.renderers.push(i),Sb.debug("Initializing a renderer at slot",n),this.awaitInitializationWithRetries(i).catch(o=>{Sb.alert("Got an unexpected uncaught error in initializing new renderer",o)})}else Sb.debug("All renderer slots populated, size:",this.size,"and renderers:",this.renderers.length)};availableRenderer=()=>{for(let t of this.renderers)if(t.state==="unused"){let n=cau(t);return this.initializeNewRenderer(),n}return this.initializeNewRenderer(),null};renderOnSlot=(t,n)=>t.renderer.render(n).then(o=>(Sb.debug("Render promise for request",n.id,"completed on slot",t.id),this.renderFailureTracker.set(t.id,0),this.handleNextQueued(t).catch(s=>{Sb.debug("Got an error in queue in renderOnSlot",s)}),o),o=>{throw this.renderFailureTracker.set(t.id,this.getRenderFailureCount(t)+1),this.handleError(t,o),o});stop=async()=>{if(this.stopped=!0,Sb.info("Shutting down renderer pool, queue has",this.queued.length,"items in it"),await hM(this.queued.map(t=>t.promise)),Sb.info("Terminating renderer threads"),await hM(this.renderers.map(t=>t.renderer.terminate())).catch(t=>Sb.error("Renderer terminate() failed",t)),this.queued.length>0){let n="Request IDs:",i=this.queued.map(o=>o.request.id);this.queued.length>10&&(n="First 10 "+n,i=i.slice(0,10)),Sb.alert("Unexpectedly, after stop() completed there were still queue entries in the renderer pool!",n,i)}else Sb.info("Renderer pool shut down")};async terminate(t=5){this.terminated=!0;let n=this.renderers.filter(a=>a.state!=="terminated").map(a=>(lau(a),a.renderer.terminate(t))),i=this.queued;this.queued=[],i.forEach(a=>{Sb.info("Rejecting queued request",a.request.id),a.reject(new h8n(a.request.id))});let s=(await TT(t*1e3,"Terminate timed out",Promise.allSettled(n))).map(a=>a.status==="rejected"?a.reason:null).filter(a=>a!==null);s.length>0&&Sb.alert("Got",s.length,"errors when terminating",n.length,"renderers. First failure:",s[0])}renderWithRetries=async(t,n)=>{let{resolve:i,promise:o,reject:s,request:a}=n,u=3,l=null,c=null,d=async()=>{try{do try{c=await this.renderOnSlot(t,a),this.renderFailureTracker.set(t.id,0),i(c);return}catch(p){l=p}while(l&&this.getRenderFailureCount(t)<u);typeof l=="object"&&l instanceof Error&&(l.stack=`${n.stack}
@@ -9471,7 +9471,7 @@ globstar while`,t,p,n,f,A),this.matchOne(t.slice(p),n.slice(f),i))return this.de
9471
9471
  >>> no match, partial?`,t,p,n,f),p===u))}let g;if(typeof c=="string"?(g=d===c,this.debug("string match",c,d,g)):(g=c.test(d),this.debug("pattern match",c,d,g)),!g)return!1}if(s===u&&a===l)return!0;if(s===u)return i;if(a===l)return s===u-1&&t[s]==="";throw new Error("wtf?")}braceExpand(){return thc(this.pattern,this.options)}parse(t,n){KKn(t);let i=this.options;if(t==="**")if(i.noglobstar)t="*";else return hL;if(t==="")return"";let o,s=null;n!==WKn&&((o=t.match(Yxh))?s=i.dot?$xh:Jxh:(o=t.match(zxh))?s=(i.nocase?i.dot?jxh:Uxh:i.dot?Qxh:Fxh)(o[1]):(o=t.match(Xxh))?s=(i.nocase?i.dot?eBh:Zxh:i.dot?tBh:rBh)(o):(o=t.match(Gxh))?s=i.dot?Wxh:Hxh:(o=t.match(Vxh))&&(s=Kxh));let a="",u=!1,l=!1,c=[],d=[],p=!1,f=!1,A=-1,g=-1,b,_,v,O=t.charAt(0)===".",R=i.dot||O,w=()=>O?"":R?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",P=G=>G.charAt(0)==="."?"":i.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",z=()=>{if(p){switch(p){case"*":a+=O1s,u=!0;break;case"?":a+=M1s,u=!0;break;default:a+="\\"+p;break}this.debug("clearStateChar %j %j",p,a),p=!1}};for(let G=0,H;G<t.length&&(H=t.charAt(G));G++){if(this.debug("%s %s %s %j",t,G,a,H),l){if(H==="/")return!1;JAc[H]&&(a+="\\"),a+=H,l=!1;continue}switch(H){case"/":return!1;case"\\":if(f&&t.charAt(G+1)==="-"){a+=H;continue}z(),l=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",t,G,a,H),f){this.debug(" in class"),H==="!"&&G===g+1&&(H="^"),a+=H;continue}this.debug("call clearStateChar %j",p),z(),p=H,i.noext&&z();continue;case"(":{if(f){a+="(";continue}if(!p){a+="\\(";continue}let L={type:p,start:G-1,reStart:a.length,open:YAc[p].open,close:YAc[p].close};this.debug(this.pattern," ",L),c.push(L),a+=L.open,L.start===0&&L.type!=="!"&&(O=!0,a+=P(t.slice(G+1))),this.debug("plType %j %j",p,a),p=!1;continue}case")":{let L=c[c.length-1];if(f||!L){a+="\\)";continue}c.pop(),z(),u=!0,_=L,a+=_.close,_.type==="!"&&d.push(Object.assign(_,{reEnd:a.length}));continue}case"|":{let L=c[c.length-1];if(f||!L){a+="\\|";continue}z(),a+="|",L.start===0&&L.type!=="!"&&(O=!0,a+=P(t.slice(G+1)));continue}case"[":if(z(),f){a+="\\"+H;continue}f=!0,g=G,A=a.length,a+=H;continue;case"]":if(G===g+1||!f){a+="\\"+H;continue}b=t.substring(g+1,G);try{RegExp("["+hBh(fBh(b))+"]"),a+=H}catch{a=a.substring(0,A)+"(?:$.)"}u=!0,f=!1;continue;default:z(),JAc[H]&&!(H==="^"&&f)&&(a+="\\"),a+=H;break}}for(f&&(b=t.slice(g+1),v=this.parse(b,WKn),a=a.substring(0,A)+"\\["+v[0],u=u||v[1]),_=c.pop();_;_=c.pop()){let G;G=a.slice(_.reStart+_.open.length),this.debug(this.pattern,"setting tail",a,_),G=G.replace(/((?:\\{2}){0,64})(\\?)\|/g,(L,W,V)=>(V||(V="\\"),W+W+V+"|")),this.debug(`tail=%j
9472
9472
  %s`,G,G,_,a);let H=_.type==="*"?O1s:_.type==="?"?M1s:"\\"+_.type;u=!0,a=a.slice(0,_.reStart)+H+"\\("+G}z(),l&&(a+="\\\\");let j=aBh[a.charAt(0)];for(let G=d.length-1;G>-1;G--){let H=d[G],L=a.slice(0,H.reStart),W=a.slice(H.reStart,H.reEnd-8),V=a.slice(H.reEnd),q=a.slice(H.reEnd-8,H.reEnd)+V,Y=L.split(")").length,J=L.split("(").length-Y,re=V;for(let X=0;X<J;X++)re=re.replace(/\)[+*?]?/,"");V=re;let ne=V===""&&n!==WKn?"(?:$|\\/)":"";a=L+W+V+ne+q}if(a!==""&&u&&(a="(?=.)"+a),j&&(a=w()+a),n===WKn)return[a,u];if(i.nocase&&!u&&!i.nocaseMagicOnly&&(u=t.toUpperCase()!==t.toLowerCase()),!u)return pBh(t);let U=i.nocase?"i":"";try{let G=s?{_glob:t,_src:a,test:s}:{_glob:t,_src:a};return Object.assign(new RegExp("^"+a+"$",U),G)}catch(G){return this.debug("invalid regexp",G),new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,i=n.noglobstar?O1s:n.dot?oBh:sBh,o=n.nocase?"i":"",s=t.map(a=>{let u=a.map(l=>typeof l=="string"?ABh(l):l===hL?hL:l._src);return u.forEach((l,c)=>{let d=u[c+1],p=u[c-1];l!==hL||p===hL||(p===void 0?d!==void 0&&d!==hL?u[c+1]="(?:\\/|"+i+"\\/)?"+d:u[c]=i:d===void 0?u[c-1]=p+"(?:\\/|"+i+")?":d!==hL&&(u[c-1]=p+"(?:\\/|\\/"+i+"\\/)"+d,u[c+1]=hL))}),u.filter(l=>l!==hL).join("/")}).join("|");s="^(?:"+s+")$",this.negate&&(s="^(?!"+s+").*$");try{this.regexp=new RegExp(s,o)}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):VKn&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,n=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;let i=this.options;R1s.sep!=="/"&&(t=t.split(R1s.sep).join("/"));let o=this.slashSplit(t);this.debug(this.pattern,"split",o);let s=this.set;this.debug(this.pattern,"set",s);let a=o[o.length-1];if(!a)for(let u=o.length-2;!a&&u>=0;u--)a=o[u];for(let u=0;u<s.length;u++){let l=s[u],c=o;if(i.matchBase&&l.length===1&&(c=[a]),this.matchOne(c,l,n))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(t){return gL.defaults(t).Minimatch}};gL.Minimatch=RQe;var yBh=We("STEPS");var P1s=(r,t,n)=>{let i={},o=new Set([t]),s=0,a=new Set,u=new Set([t]);try{for(;u.size>0;){s=s+1,a=u,u=new Set;for(let l of a){o.add(l);let c=n==="predecessors"?r.predecessors(l):r.successors(l);if(c)for(let d of c)i[s]||(i[s]=new Set),!o.has(d)&&(i[s].add(d),u.add(d))}}}catch(l){throw yBh.error(`getSuccessorsOrPredecessorsWithLevels threw an error when getting ${n} for step: ${t}. error:
9473
9473
 
9474
- `,l),l}return i};var MQe=We("SEARCH"),qE2=M.object({include:M.string(),exclude:M.string(),enabled:M.boolean()}),bBh=new RegExp(/([\+]?){([\s\S]+)}([\+](?![\+]))?\s*/g),EBh=new RegExp(/((\w+):\s*((?:["])((([^\"\+\r\n\[/\\]+))(?:["]))|(([^\"\ \+\r\n\[/\\]+))))/g),CBh=new RegExp(/((?:[^\+\ \r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+)\s*/g),Pyt=(r,t)=>!!w1s(r,t).length,rhc={name:{MatchFunction:Pyt,MatchList:r=>[r.operation.name]},location:{MatchFunction:Pyt,MatchList:r=>[r.operation.locationName]},nodeType:{MatchFunction:Pyt,MatchList:r=>[r.operation.sqlType]},subgraph:{MatchFunction:Pyt,MatchList:r=>[r?.id?.toString(),r.name]},nodeID:{MatchFunction:Pyt,MatchList:r=>[r]}},nhc=r=>{let t=[];return r.forEach((n,i)=>{if(n==="+{"||n==="{"||n==="}"||n==="}+")return;let o=n,s=n.split(""),a=s[s.length-1],u=s[0];a!=="}"&&a!=="+"&&(o=o+r[i+1]),u!=="{"&&u!=="+"&&(o=r[i-1]+o),t.push(o)}),t},SBh=2,_Bh=1,vBh=3,TBh=2,IBh=5,OBh=8,ihc=(r,t,n)=>{let{steps:i,graphInformation:o,allSubgraphs:s,allStepTypesYAML:a}=n,u={},l=uT()?Date.now():performance.now(),c=r;c||(c=t);let d=c.split(/(\}\+?)\s*(or|OR|\|\|)\s*(\+?\{)/).filter(A=>!(A==="OR"||A==="or"||A==="||")),p=nhc(d);p.length||(p=[t]),MQe.debug("got unions",p,"searchStringTouse",c,"defaultSearchString",t,"steps",i),p.forEach(A=>{let g=A.split(/(\}\+?)\s*(and|AND|\,)\s*(\+?\{)/).filter(R=>!(R==="AND"||R==="and"||R===",")),b=nhc(g),_=[];b.forEach(R=>{let w={};MQe.debug("Got intersection:",R);let P=[...R.matchAll(bBh)];if(MQe.debug("Got matches:",R,P),!P[0])return;let z=P[0][SBh],j={prefix:P[0][_Bh]||"",postfix:P[0][vBh]||""};if(z.indexOf(":")>-1)[...z.trim().matchAll(EBh)].forEach(L=>{let W=L[TBh],V=L[IBh]||L[OBh];j[W]=V});else{let L=[...z.trim().matchAll(CBh)][0];L&&(j.name=L[0])}B3(j);let U=j;MQe.debug("Got groups ",R,U);let G=new Set;if(U.subgraph?Object.values(s).forEach(H=>{let L=rhc.subgraph,W=L.MatchList(H);if(L.MatchFunction(W,U.subgraph)){let{steps:q}=H;q.forEach(Y=>{G.add(Y.toString())})}else return}):G=new Set(Object.keys(i)),U.nodeType){let{nodeType:H}=U;if(!a[H]){let L=H;Object.entries(a).forEach(([W,V])=>{V.name===H&&(L=W)}),U.nodeType=L}}Object.keys(i).forEach(H=>{if(!U){MQe.emerg("got an unexpected undefined value for match",c,U,R);return}let L=G.has(H);if(Object.entries(U).forEach(([W,V])=>{let q=i[H];if(W==="nodeID"&&(q=H),W==="subgraph"){L=G.has(H);return}let Y=rhc[W];if(Y){let J=Y.MatchList(q).filter(re=>re!=null);L=L&&Y.MatchFunction(J,V)}}),L){if(w[H]=!0,U.prefix&&o){let W=P1s(o,H,"predecessors");Object.values(W).forEach(V=>[...V.keys()].forEach(q=>w[q]=!0))}if(U.postfix&&o){let W=P1s(o,H,"successors");Object.values(W).forEach(V=>[...V.keys()].forEach(q=>w[q]=!0))}}}),_.push(w)}),_.length||_.push({});let v={};Object.keys(i).forEach(R=>{v[R]=!0});let O=_.reduce((R,w)=>Object.fromEntries(AQa(R,w).map(P=>[P,!0])),v);u={...u,...O}});let f=uT()?Date.now():performance.now();return MQe.debug("Time that search took: ",f-l),u};var ohc=(r,t,n)=>{let i=ihc(`${r}`,"{ * }",n),o=ihc(`${t}`,"!*",n),s=i;return Object.keys(o).forEach(a=>{delete s[a]}),{stepsResult:s}};var shc=(r,t,n,i)=>{let o=[];return t.forEach(s=>{let a=i[s];if(a){let{name:u}=a,l=`{ subgraph: "${u}" }`;o.push(l)}}),r.forEach(s=>{let a=n[s];if(a){let{locationName:u,name:l}=a.operation,c=`{ location: ${u} name: ${l} }`;o.push(c)}}),o};var RBh=We("JOBS");var ahc=r=>!r?.hasOwnProperty("includeSelector")||!r?.hasOwnProperty("version"),N1s=(r,t,n)=>{let{steps:i,subgraphs:o,...s}=r,a={...s};if(a.hasOwnProperty("version")||(a.version=R0e),a.hasOwnProperty("includeSelector"))return a;a.includeSelector="",a.excludeSelector="";let u=new Set(i),l=new Set(o),p=shc([...u],[...l].map(f=>`${f}`),n,t).map(f=>`+${f}`).join(" OR ");return a.includeSelector=p,RBh.info("Upgrading job v1 to v2",r,a),a};var uhc=(r,t)=>{let{jobs:n,folders:i,steps:o}=r,s=n[t];return N1s(s,i,o)};var VE2=We("PACKAGES_BACKEND");var chc=(r,t,n)=>{let i=a1s(t)??"",o=r?.config?.entities?.nodeTypes[i];return o||(n.error(`No config found for node type ${t}`),{isDisabled:!1,defaultStorageLocation:null})};var YKn=(r,t={})=>Object.values(r).map(n=>MBh(n)).reduce((n,i)=>{for(let[o,s]of Object.entries(i))n[o]=s;return n},t),MBh=r=>Object.fromEntries(Object.entries(r?.contents?.nodeTypes??{}).map(([t,n])=>{let{id:i,nodeType:o}=wBh(r.alias,t,r,n);return[i,o]})),wBh=(r,t,n,i)=>{let o=MKn(r,t),{isDisabled:s,defaultStorageLocation:a}=chc(n,o,We("PACKAGES")),u={...Vc(i),id:o,isDisabled:s};return u.metadata.defaultStorageLocation=a,{id:o,nodeType:u}};var bo=_t(e8());var PBh=bo.Record({type:bo.Unknown,name:bo.String}),lhc=bo.Record({locationName:bo.String,nodeName:bo.String}),dhc=bo.Record({sql:bo.String,success:bo.Boolean,rows:bo.Array(bo.Unknown),fields:bo.Array(PBh),error:bo.Union(bo.Null,VPn).optional(),startTime:bo.Unknown,endTime:bo.Unknown,status:bo.String,name:bo.String,isRunning:bo.Boolean,exportedRefs:bo.Array(lhc),invalidExportedRefs:bo.Array(lhc),queryResultSequence:bo.Optional(bo.Unknown),type:bo.Union(bo.Literal("sql"),bo.Literal("sqlTest")).optional(),warehouse:bo.String.nullable().optional(),queryID:bo.String.nullable().optional()}),D1s=bo.Record({name:bo.String,queryResults:bo.Array(dhc),isRunning:bo.Boolean,renderQueryResults:bo.Optional(dhc)}),iC2=bo.Record({runExecutionSequenceID:bo.Number,runResultVersion:bo.Number,name:bo.String,queryResultSequence:D1s,runState:bo.String}),NBh=bo.Record({dataResult:bo.Unknown,name:bo.String,queryResultSequence:D1s,runExecutionSequenceID:bo.Number,runResultVersion:bo.Number,runState:bo.String,stepRunState:MFe(efs)}),phc=P4("RunResultFirestoreValidator",NBh),DBh=bo.Record({nodeID:bo.String,queryResultSequence:D1s,runState:bo.String,hasTestFailures:bo.Boolean.optional()}),xBh=bo.Record({runResults:bo.Record({runStartTime:bo.Unknown,runEndTime:bo.Unknown,runFailureReason:bo.Optional(bo.String),runType:bo.String,runStatus:bo.String,runResults:bo.Array(DBh),runID:bo.Number,environmentID:bo.String,snowflakeAccount:bo.String.optional(),snowflakeWarehouse:bo.String.optional(),jobID:bo.Number.optional(),hasFailedTest:bo.Boolean.optional(),runTimeParameters:bo.Unknown.nullable(),includeNodesSelector:bo.String.optional(),excludeNodesSelector:bo.String.optional()})}),JKn=P4("TRunOutput",xBh);var aC2=MFe(Z0s);var kBh=["deploy","refresh","rerun","plan"],uC2=[...kBh,"devRun"];var y3e=class{constructor(t,n,i,o){this.allNodes=t;this.renderResults=n;this.extraRefs=i;this.logContext=o;this.phasedRefUsage=n.map("phased ref usage",s=>s.map(a=>a.runDetails.ref_usage))}phasedRefUsage;buildPhase(t,n){let i="[DependencyBuilder.buildPhase()]",o=n.keys(),s=Object.keys(this.extraRefs),a=[...new Set([...o,...s])];if(We("PIPELINE").appContext(this.logContext,i,"Nodes present in both current-phase data AND extra non-phased (views & advanced deploy) data:",$Li([...o],s)),this.noDependenciesPhases.includes(t))return Object.fromEntries(a.map(u=>[u,[]]));{let u=this.getNodeRefsInPhase(t,a),l=new vne(ub(this.allNodes,a));return OC(u,(c,d)=>{let{nodeIDsToAdd:p}=OKn(c,l);return[...new Set(p)].filter(f=>f!==d)})}}build(){return Object.fromEntries([...this.phasedRefUsage.entries()].map(([t,n])=>[t,this.buildPhase(t,n)]))}};var mC2=We("DEBUG");var $Kn=r=>{typeof r.stepCounter=="number"&&(r.stepCounter=`${r.stepCounter}`),typeof r.columnCounter=="number"&&(r.columnCounter=`${r.columnCounter}`)};var ofe=new Date("1980-01-01T00:00:00.000Z"),Os=(r,t,n)=>{let i=`${r}Entity`;return n||(n=Xs(t)),{standard:fr(i,n),strict:fr(`${i} (strict)`,t)}};var fhc=r=>{if(Array.isArray(r))for(let t=r.length-1;t>=0;t--)r[t]===void 0&&r.splice(t,1);if(r&&typeof r=="object")for(let t in r)r.hasOwnProperty(t)&&r[t]===void 0&&delete r[t];return[r,!1]},LBh=(r,t)=>{if(r&&typeof r=="object"){let n=r;if(n.toDate&&(!isNaN(n.seconds)&&!isNaN(n.nanoseconds)||!isNaN(n._seconds)&&!isNaN(n._nanoseconds))){let i=n.toDate();return i.getTime()===yV.SENTINEL_DATE&&Tc().emerg(`Repository server timestamp sentinel value found in stored data at path ${t}`),[i,!0]}}return[r,!1]},Ahc=(r,t)=>r instanceof nTe?[t.getDeleteSentinel(),!0]:r instanceof Date&&r.getTime()===yV.SENTINEL_DATE?[t.getServerTimestampSentinel(),!0]:[r,!1],b3e=(r,t,n)=>{let[i,o]=t(n,r);if(!o&&typeof i=="object"){if(Array.isArray(i))return i.map(s=>b3e(r,t,s));for(let s in i)i.hasOwnProperty(s)&&(i[s]=b3e(r,t,i[s]))}return i},Nyt=class{fromStorage(t,n,i,o,s){try{return this.transformFromStorage(t,n,i,o,s)}catch(a){if(s?.onDataTransformError&&s.onDataTransformError(n,a),!s?.ignoreDataTransformErrors)throw Tc().debug(`Error transforming repository entity ${n} from storage: ${a}`),a}return i}toStorage(t,n,i,o,s){try{return this.transformToStorage(t,n,i,o,s)}catch(a){if(s?.onDataTransformError&&s.onDataTransformError(n,a),!s?.ignoreDataTransformErrors)throw Tc().debug(`Error transforming repository entity ${n} to storage ${a}`),a}return i}mergeToStorage(t,n,i,o,s){try{return this.mergeTransformToStorage(t,n,i,o,s)}catch(a){if(s?.onDataTransformError&&s.onDataTransformError(n,a),!s?.ignoreDataTransformErrors)throw Tc().debug(`Error merge transforming repository entity ${n} to storage ${a}`),a}return i}},x1s=class extends Nyt{constructor(n=!1){super();this.preserveID=n}transformFromStorage(n,i,o){return"id"in o?o.id!=n&&(Tc().error(`'id' property does not match doc id on doc at path ${i}; doc id: ${n}, value.id: ${o.id}`),o.id=n):o.id=n,"createdAt"in o||(o.createdAt=ofe),"updatedAt"in o||(o.updatedAt=ofe),b3e(i,LBh,o)}transformToStorage(n,i,o,s){return this.preserveID||delete o.id,b3e(i,a=>{let[u,l]=Ahc(a,s);return l?[u,!0]:fhc(u)},o)}mergeTransformToStorage(n,i,o,s){return this.preserveID||delete o.id,b3e(i,a=>{let[u,l]=Ahc(a,s);return l?[u,!0]:fhc(u)},o)}},B1s=class extends Nyt{constructor(n){super();this.validators=n}transformFromStorage(n,i,o,s,a){let u=this.getValidatorOptions(n,a?.validatorOptions);return a?.enableStrictValidation?this.validators.strict.assert(o,u):this.validators.standard.assert(o,u)}transformToStorage(n,i,o,s,a){let u=this.getValidatorOptions(n,a?.validatorOptions);return a?.enableStrictValidation?this.validators.strict.assert(o,u):this.validators.standard.assert(o,u)}mergeTransformToStorage(n,i,o,s,a){return o}getValidatorOptions(n,i,o=500){let s={...i,statusCode:o};return s.errorMessage||(s.errorMessage=a=>`Found ${a.failures.length} validation failure(s) for ${this.validators.standard.name} ${n}`),s}},Au=(r,t,n)=>{let i=[new x1s(n),new B1s(r)];return t&&i.unshift(t),new k1s(...i)},k1s=class{transforms;constructor(...t){this.transforms=t}fromStorage(t,n,i,o,s){return this.transforms.reduce((a,u)=>u.fromStorage(t,n,a,o,s),i)}toStorage(t,n,i,o,s){return this.transforms.reduceRight((a,u)=>u.toStorage(t,n,a,o,s),i)}mergeToStorage(t,n,i,o,s){return this.transforms.reduceRight((a,u)=>u.mergeToStorage(t,n,a,o,s),i)}},Q_=class extends Nyt{transformToStorage(t,n,i){return i}mergeTransformToStorage(t,n,i){return i}};var hhc=r=>!!r&&typeof r=="object"&&!Array.isArray(r),wQe=r=>hhc(r)&&!(r instanceof Date)&&!(r instanceof RegExp),sF=r=>{if(typeof r=="string")return r;if(hhc(r)&&r.constructor&&typeof r.constructor.name=="string")return`[class ${r.constructor.name}]`;if(r instanceof Date)return`[date ${r.toISOString()}]`;if(r instanceof RegExp)return`[regexp ${r.toString()}]`;if(typeof r=="function")return`[function ${r.name}]`;try{return JSON.stringify(r)}catch{return"Error: could not stringify unknown value"}},L1s=r=>r==null,Dyt=(r,t,n,i)=>{t.filter((o,s)=>wQe(o)?!0:(n.logError(`Invalid ${r} item detected at index ${s}: ${sF(o)}`),n.logPatch(`Removed invalid ${r} item at index ${s}`),!1)).forEach(i)},mL=(r,t,n)=>{r[t]=n},sfe=(r,t)=>{delete r[t]},z1s=(r,t,n)=>{let i=new q1s(r,We("FIREBASE"),t),{logError:o,logPatch:s,report:a}=i,u=()=>(a(),n);if(!wQe(n))return u();let l=n;if([["locationName",!l.locationName&&typeof l.locationName!="string"||typeof l.locationName!="string"],["description",typeof l.description!="string"]].forEach(([c,d])=>{d&&(s(`Set non-string property ${c} from ${sF(l[c])} to ""`),mL(l,c,""))}),["dependencies","isDataVault","locationID"].forEach(c=>{c in l&&(s(`Removed deprecated field ${c}`),sfe(l,c))}),l.type==="sql")s("-- data.type is sql --"),qBh(r,l,i);else if(l.type==="sourceInput")s("-- data.type is sourceInput --"),zBh(r,l,i);else return o(`Data type is of invalid type ${sF(l.type)}`),u();return l.version!==Ane&&(s(`Set version ${sF(l.version)} to ${Ane}`),mL(l,"version",Ane)),u()},qBh=(r,t,n)=>{let{logError:i,logPatch:o}=n;if(t.isMultisource===void 0&&(o("Set missing isMultisource to false"),mL(t,"isMultisource",!1)),wQe(t.metadata)){let s=t.metadata;if(s.appliedNodeTests===null&&(o("Set metadata.appliedNodeTests from null to []"),mL(s,"appliedNodeTests",[])),!Array.isArray(s.sourceMapping)||!s.sourceMapping.length){o("Set non-array or empty metadata.sourceMapping to [ basicMapping ]");let a;typeof t.name=="string"?a=t.name:(o("Data has no name value, setting sourceMapping.name to empty string"),a=""),mL(s,"sourceMapping",[{name:a,join:{joinCondition:""},dependencies:[],noLinkRefs:[],aliases:{}}])}else Dyt("sourceMapping",s.sourceMapping,n,(a,u)=>{let l=a;if(typeof l.join=="string"){let c={joinCondition:""};o(`Setting invalid string value metadata.sourceMapping[${u}].join to object: ${sF(c)}`),mL(l,"join",c)}if(l.name===void 0){let c=l.join?.name??"";o(`Set missing metadata.sourceMapping[${u}].name to "${c}"`),mL(l,"name",c),c||i(`metadata.sourceMapping[${u}].name is an empty string`)}Array.isArray(l.dependencies)&&Dyt("sourceMapping dependency",l.dependencies,n,(c,d)=>{let p=c;for(let f of["locationName","nodeName"])L1s(p[f])&&(o(`Set metadata.sourceMapping[${u}].dependencies[${d}].${f} from ${sF(p[f])} to ""`),mL(p,f,""))})});ghc(r,s.columns,n)}if(t.config&&typeof t.config=="object")for(let[s,a]of Object.entries(t.config))a===null&&(o(`Removing null config property "${s}"`),sfe(t.config,s))},zBh=(r,t,n)=>{let{logPatch:i,logError:o}=n;if(t.dataset!==void 0&&(i("Removed deprecated v0 property dataset"),sfe(t,"dataset")),t.table!==void 0&&(t.table!==t.name&&o(`source data properties 'table' and 'name' are different for source node ${r}, table: ${t.table}, name: ${t.name}`),i("Removed deprecated v0 property table"),sfe(t,"table")),wQe(t.metadata)){let s=t.metadata;Array.isArray(s.columns)&&(s.columns.length&&ghc(r,s.columns,n),Object.keys(s).length>1&&(i(`Removed deprecated metadata properties, keeping only columns. Was: ${sF(s)}`),mL(t,"metadata",{columns:s.columns})))}},ghc=(r,t,n)=>{let{logPatch:i}=n;Array.isArray(t)&&Dyt("column",t,n,(o,s)=>{let a=o;if(["ghostRecordValue","descendedFrom","hashColumns","columnsForHash"].forEach(c=>{a.hasOwnProperty(c)&&(i(`Removed deprecated property '${c}' from metadata.columns[${s}]`),sfe(a,c))}),wQe(a.hashDetails)){let c=a.hashDetails;c.hashType&&(i(`Removed deprecated property 'hashType' from metadata.columns[${s}].hashDetails`),sfe(c,"hashType")),c.hubHashes&&(i(`Removed deprecated property 'hubHashes' from metadata.columns[${s}].hashDetails`),sfe(c,"hubHashes"))}[["appliedColumnTests",a.appliedColumnTests===null],["config",a.config===null],["hashDetails",typeof a.hashDetails=="string"]].forEach(([c,d])=>{d&&(i(`Deleted metadata.columns[${s}].${c} with invalid value ${sF(a[c])}`),sfe(a,c))}),[["dataType",typeof a.dataType!="string"],["transform",a.transform===null]].forEach(([c,d])=>{d&&(i(`Set ${c} from ${sF(a[c])} to "" in metadata.columns[${s}]`),mL(a,c,""))});let u=a.hashedColumns;if(Array.isArray(u))for(let c of u)$Kn(c);let l=a.columnReference;if(wQe(l)){$Kn(l);let c=l;L1s(c.stepCounter)&&(i(`Set metadata.columns[${s}].columnReference.stepCounter from ${sF(c.stepCounter)} to ${r}`),mL(c,"stepCounter",r))}Array.isArray(a.sourceColumnReferences)&&Dyt("sourceColumnReference",a.sourceColumnReferences,n,(c,d)=>{let p=c;Array.isArray(p.columnReferences)&&Dyt("columnReference",p.columnReferences,n,(f,A)=>{$Kn(f);let g=f;L1s(g.stepCounter)&&(i(`Set invalid metadata.columns[${s}].sourceColumnReferences[${d}].columnReferences[${A}].stepCounter to "" from ${sF(r)}`),mL(g,"stepCounter",""))})})})},q1s=class{constructor(t,n,i){this.id=t;this.logger=n;this.path=i}patchMessages=[];errorMessages=[];logPatch=t=>{this.patchMessages.push(t)};logError=t=>{this.errorMessages.push(t)};reportErrors=()=>{this.errorMessages.length&&this.logger.error(`Error patching node data with id ${this.id} at path ${this.path}`,this.errorMessages)};reportPatches=()=>{this.patchMessages.length&&this.logger.debug(`Patched node data with id ${this.id} at path ${this.path}`,this.patchMessages)};report=()=>{this.reportErrors(),this.reportPatches()}},XKn=class extends Q_{transformFromStorage(t,n,i){return z1s(t,n,i)}};var oS2=We("FIREBASE");var sS2=We("STEPS"),aS2=We("METADATA_OPERATIONS");var mhc=(r,t)=>t[r].runState==="running";var yhc=r=>(SA("STEPS",!!r,`Error converting API refs: argument apiRefLinks is ${r}.`),r.map(t=>({locationName:t.location_name,nodeName:t.node_name})));var bhc=r=>r?.deployEnabled??!0;var afe=class extends y3e{noDependenciesPhases=["deletedTable"];getNodeRefsInPhase(t,n){return Object.fromEntries(n.map(i=>{let o,s=this.extraRefs[i];s?o=[s]:o=this.phasedRefUsage.get(t,i);let a=o.map(({ref:u,ref_no_link:l})=>yhc([...u,...l]));return[i,[].concat(...a)]}))}};var PQe=class extends y3e{noDependenciesPhases=[];getNodeRefsInPhase(t,n){let i=ub(this.allNodes,...n);return OC(i,o=>{if(vQe(o.operation))return[];let{sourceMapping:s}=o.operation.metadata;if(!s?.length)return[];let a=s.map(({dependencies:u})=>u);return[].concat(...a)})}};var xyt=async(r,t)=>{let{attempts:n,tags:i,waitSeconds:o}=t,s=Tc().child({retryOptions:{maxAttempts:n,waitSeconds:o},tags:["[withRetries]",...i]});gm(n>=2,`Retry attempts value must be at least '2', but was '${n}'`,s);try{let a=await r();return s.info("Operation succeeded without retrying"),a}catch(a){s.error(`Operation initial attempt failed; retrying. Error: ${a}`);let u,l=n-1;do{l--,await new Promise(c=>setTimeout(c,o*(n-l)*1e3));try{let c=await r();return s.info(`Operation succeeded on retry (attempt ${n-l})`),c}catch(c){s.error(`Operation failed on retry (attempt ${n-l}). Error: ${c}`),u=c}}while(l);throw s.error("Exhausted all retry attempts; exiting"),u}};var DB=_t(e8()),jBh=DB.String,GBh=DB.Record({locationName:DB.String,database:DB.String,schema:DB.String}),IS2=DB.Dictionary(GBh,jBh);var OS2=DB.Record({seconds:DB.Number,nanoseconds:DB.Number});var HBh="Making metadata updates",Ehc="Deleting metadata for source input";function NQe(r,t){let n=[];for(let i of r){let o=i.compiledSQL?BKn(i.compiledSQL):[];if(o.length===0)t&&n.push({name:t,sql:"",type:"sql",continueOnFailure:!1,parsedStage:null});else for(let s of o)n.push({name:s.name,sql:s.code,type:s.type,continueOnFailure:s.continueOnFailure,parsedStage:s})}return n}function ZKn(r,t){return r==="deletedTable"&&t?Ehc:HBh}var Mne=class extends et{constructor(n,i){super(i,`Failed node ${n}: ${i}`);this.nodeID=n}};var qK=class extends et{constructor(n){super(`Run ${n} canceled by user`);this.runID=n}},DQe=class extends et{constructor(n){super('Test failed with "continue on failure" set to false');this.result=n}};var Chc=(r,t,n)=>{switch(r){case"skipped":return"Skipped";case"error":return"Error";case"complete":switch(n){case"create":return t?"Validated":"Created";case"run":return t?"Validated":"DataLoaded";default:return"None"}case"waiting":case"queued":case"running":case"canceled":default:return"None"}},Shc=r=>typeof r=="object"&&r instanceof DQe,xQe=r=>typeof r=="object"&&(r instanceof Qh||r instanceof qK),BQe=r=>typeof r=="object"&&r instanceof AL&&r.isCancel(),kQe=r=>typeof r=="object"&&r instanceof LK&&r.isCancel();var _hc=5e5,vhc=500,LQe=class r{constructor(t,n,i,o,s){this.state=t;this.repository=n;this.logContext=i;this.operationType=o;this.analyticsCollector=s}stepsInitialized=null;runResults={};wasCanceled=!1;nodeStageIndexTracker=new Map;aggregateIndex=0;analyticsCollector;get teamID(){return this.logContext.orgID}get runID(){return this.logContext.runID}get envID(){return this.logContext.workspaceID}GetLogContext=t=>({...this.logContext,nodeID:t});async runIsCanceled(){if(!this.repository)return!1;if(this.wasCanceled)return!0;try{let t=!!(await this.getRepositoryForRun().fetch({pendingWritesTimeoutMs:100})).runDetails.canceled;return t&&(this.wasCanceled=!0),t}catch(t){if(y1(t)){if(t instanceof R_e)return!1;if(t instanceof Ya)return!1}throw t}}async throwIfRunCanceled(){if(await this.runIsCanceled())throw new qK(this.runID)}updateNodeLocalRunResult({stepID:t,isPreview:n,runExecutionSequenceID:i},o){let s=this.runResults[t];s?(s.runState=o,s.queryResultSequence.isRunning=o==="running",s.stepRunState=this.getStepRunState(o,n),i!==void 0&&(s.runExecutionSequenceID=i),(o==="canceled"||o==="skipped"||o==="error")&&s.queryResultSequence.queryResults.forEach(a=>{!a.isRunning&&a.status==="Queued"&&(a.status="Canceled")})):this.Logger.errorContext(this.GetLogContext(t),"EventHandler updateNodeLocalRunResult: missing expected local run result for node",t)}getBulkSkipHandler=()=>async t=>{if(!this.repository)return;let n=this.repository.batch(),i=this.getRepositoryForRun().runResults;for(let[o,s]of Object.entries(t))if(this.runResults[o]){let a=i.get(o);this.updateNodeLocalRunResult({stepID:o,isPreview:!1,runExecutionSequenceID:s},"skipped");let u={...r.truncateRunResult(this.runResults[o]),version:2};await n.save(a,u)}await n.commit()};async repositoryUpdateRunStatus({expectedStatus:t,newStatus:n}){if(!this.repository)return;let i=this.getRepositoryForRun();try{let o=await i.fetch();Dp("RUNNER_BACKEND",t===o.runStatus,this.logContext,`EventHandler.repositoryUpdateRunStatus found unexpected run status - expected: ${t} / actual: ${o.runStatus}`)}catch(o){this.Logger.alertContext(this.logContext,"Error fetching runInfo",o)}await i.merge({runStatus:n})}async repositoryUpdateRenderingProgress(t){if(this.repository)try{await this.getRepositoryForRun().merge({renderingProgress:{totalNodes:t.totalNodes,completedNodes:t.completedNodes}})}catch(n){this.Logger.errorContext(this.logContext,"[EventHandler.repositoryUpdateRenderingProgress] Error updating rendering progress. Cannot update run document renderingProgress.",n)}}async repositoryUpdateCurrentQueryResult(t){let n="[EventHandler.repositoryUpdateCurrentQueryResult()]";if(!this.repository)return;let{queryResultSequence:{queryResults:i}}=eA(t,this.runResults,n),o=this.getCurrentStageIndex(t),s=i[o];if(!s)throw new et(`${n} Attempted to update query result at index ${o} for node '${t}', which was unexpectedly ${s}. Existing query results: ${JSON.stringify(i.map(u=>u.name))}`);if(s.isRunning)throw new et(`${n} Got an unexpected still-running query result`);let a={...r.truncateQueryResult(s),queryResultExecutionIndex:this.aggregateIndex++,version:1};await this.getRepositoryForRun().runResults.get(t).queryResults.createEntity(a)}getRepositoryRunsCollection(){if(!this.repository)throw new et("No repository to get runs collection for!");let t=this.repository.orgs.get(this.logContext.orgID);return this.runLevel==="orgRuns"?t.runs:t.devRuns}getRepositoryForRun(){return this.getRepositoryRunsCollection().get(this.runID)}formatError=(t,n=null,i=null,o=!1)=>{let s=Ga(t.error).error,a="";return t.error&&typeof t.error=="object"&&!(t.error instanceof Error)&&"runDetails"in t.error&&typeof t.error.runDetails=="object"&&(a=t.error?.runDetails?.compiledSQL??""),t.templateString&&(a=t.templateString),{success:!1,error:{errorString:s.errorString??"",errorDetail:s.errorDetail??""},rows:[],fields:[],name:"",exportedRefs:[],invalidExportedRefs:[],status:o?"Canceled":"Failure",sql:a??"",startTime:t.startTime,endTime:new Date,isRunning:!1,type:"sql",queryID:n,warehouse:i}};populateRunResults(t,n){let i="[EventHandler.populateRunResults()]",o=t.length+1;for(let s of t){let u=eA(s,this.state.nodes,`${i} state.nodes`).operation.name;this.runResults[s]={name:u,runExecutionSequenceID:o,dataResult:null,runState:n,stepRunState:"None",queryResultSequence:{name:u,queryResults:[],isRunning:!1},runResultVersion:2}}}async bulkSetRunResults(t){if(!this.repository)return;let n=this.repository.batch(),i=this.getRepositoryForRun().runResults;for(let o of t){let s=this.runResults[o];if(!s)throw new et(`Run result for node ${o} does not exist for run ${this.runID}`);let a={...s,name:s.queryResultSequence.name,runExecutionSequenceID:s.runExecutionSequenceID,version:2},u=i.get(o);await n.save(u,a)}await n.commit()}async initializeRunResults(t,n="queued"){this.stepsInitialized=[...t],this.populateRunResults(t,n),await this.bulkSetRunResults(t)}async populatePlaceholderStages(t,n){let i=new Set,o=new Set(t.keys());for(let s of n){if(!o.has(s))continue;let a=t.getPhaseItems(s);for(let[u,l]of a.entries()){let c=eA(u,this.runResults,"populateQueuedStages: this.runResults"),d=this.state.nodes[u],p=d?wB(d,void 0):!1,f=NQe(l,this.getNameForStageWithoutSQL(s,p));for(let A of f)c.queryResultSequence.queryResults.push(this.createQueuedStage(A));f.length>0&&!i.has(u)&&(i.add(u),this.nodeStageIndexTracker.set(u,0))}}await this.bulkSetQueuedStageResults(i)}createQueuedStage({name:t,sql:n,type:i}){return{name:t,status:"Queued",success:!0,sql:n,rows:[],fields:[],startTime:new Date,endTime:new Date,isRunning:!1,exportedRefs:[],invalidExportedRefs:[],type:i}}async bulkSetQueuedStageResults(t){if(!this.repository)return;let n=this.repository.batch(),i=this.getRepositoryForRun().runResults;for(let o of t){let s=this.runResults[o];if(!s)continue;let a={...r.truncateRunResult(s),name:s.queryResultSequence.name,runExecutionSequenceID:s.runExecutionSequenceID,version:2},u=i.get(o);await n.save(u,a)}await n.commit()}formatErrorToResult(t,n){let i=null,o=null;return typeof t.error=="object"&&(i=t.error.queryID||null,o=t.error.warehouse||null),{...this.formatError(t,i,o,n),name:t.stageName,stageExecutionStartTime:t.stageExecutionStartTime,stageExecutionEndTime:t.stageExecutionEndTime}}ensureHasQueryResult(t){if(Dp("DEPLOY",!!t.queryResult,this.GetLogContext(t.stepID),"query result should always be returned for stage execution"),!t.queryResult)throw new Error("Got an empty query result for stage execution")}updateStageResultAtTrackedIndex=(t,n)=>{let o=eA(t,this.runResults,"[EventHandler.setLastQueryResult()]").queryResultSequence.queryResults,s=this.getCurrentStageIndex(t);if(s<0||s>=o.length)throw this.Logger.errorContext(this.GetLogContext(t),"[EventHandler.setLastQueryResult] stage index out of bounds",{targetIndex:s,queryResultsLength:o.length,resultName:n.name}),new et(`Stage index ${s} out of bounds (length: ${o.length}) for node ${t}`);o[s]=n};async dispatchQueryFailure(t,n){let i=this.formatErrorToResult(t,n);return this.Logger.errorContext(this.GetLogContext(t.stepID),"failed to execute run sql",n?"- canceled":"- errored",t.error,"stack: ",t.error.stack||"<none found>"),this.updateStageResultAtTrackedIndex(t.stepID,i),{error:i.error}}getSingleStepData(t,n){let i=this.state.nodes[n];if(i)return i;let o=`(${this.runTypeName}) EventHandler: Could not get step data for step: ${n}`;throw this.Logger.errorContext(this.GetLogContext(n),o,n),new et(o)}getUnrunSteps(){let t={},n=this.state.nodes,i=this.runResults;if(n&&this.stepsInitialized)for(let o of this.stepsInitialized){let s=i[o];if(s){let{runState:a}=s;(a==="waiting"||a==="queued")&&(n[o]?t[o]=0:this.Logger.alertContext(this.logContext,"Node ID from initialization not found in steps data",o))}else this.Logger.alertContext(this.logContext,"Node ID from initialization not found in run results",o)}return t}getStepContext=(t,n,i,o)=>{let s=this.getSingleStepData(t,n),{locationName:a}=s.operation,{database:u}=this.state.mappings[a]?.mappingDefinitions[this.state.currentWorkspace]??{},l=wB(s,void 0),c=s.operation.name;return{startTime:new Date,stepID:n,stepName:c,runExecutionSequenceID:i,phase:t,isPreview:o,isSource:l,database:u??""}};convertIQueryToCompletedQueryResult(t){return{...t,startTime:A8n(t.startTime),endTime:A8n(t.endTime)}}getCurrentStageIndex(t){let n=this.nodeStageIndexTracker.get(t);if(n===void 0)throw new et(`[EventHandler.getCurrentStageIndex] Node ${t} not in stage tracker. Was populateQueuedStages called for this node?`);return n}advanceToNextStage(t){let n=this.getCurrentStageIndex(t);this.nodeStageIndexTracker.set(t,n+1)}getQueryResultForUpdateSuccess(t){return{...this.convertIQueryToCompletedQueryResult(t.queryResult),name:t.stageName,stageExecutionStartTime:t.stageExecutionStartTime,stageExecutionEndTime:t.stageExecutionEndTime}}getStepRunState(t,n){return Chc(t,n,this.operationType)}async updateRunResult(t){if(!this.repository)return;let n=this.runResults[t];if(!n)throw new et(`[EventHandler.updateRunResult()] run result for node ${t} does not exist for run ${this.runID}`);let i={...r.truncateRunResult(n),name:n.queryResultSequence.name,runExecutionSequenceID:n.runExecutionSequenceID,version:2};this.Logger.debugContext(this.GetLogContext(t),"updating run result",i),await this.getRepositoryForRun().runResults.get(t).save(i)}isFinalRunForStep(t){return!0}async beforePhaseExecution(t,n){}async afterPhaseExecution(t){}async beforeStepExecution(t){this.runResults[t.stepID]&&(this.runResults[t.stepID].runExecutionSequenceID=t.runExecutionSequenceID),this.updateNodeLocalRunResult(t,"running"),await this.updateRunResult(t.stepID)}async afterFinalRunSuccessForNode(t){return Promise.resolve()}async afterStepExecutionSuccess(t){this.isFinalRunForStep(t)?(this.updateNodeLocalRunResult(t,"complete"),await this.afterFinalRunSuccessForNode(t)):this.updateNodeLocalRunResult(t,"waiting"),await this.updateRunResult(t.stepID)}async afterStepExecutionFailure(t){let n=await this.isCoalesceInitiatedCancel(t.error);this.markUnexecutedStagesAsCanceled(t.stepID),this.updateNodeLocalRunResult(t,n?"canceled":"error");try{await this.updateRunResult(t.stepID)}catch(i){this.Logger.emergContext(this.GetLogContext(t.stepID),`Error in firebaseUpdateStepResult for stepCounter:${t.stepID}:`,i)}}markUnexecutedStagesAsCanceled(t){let n=this.runResults[t];if(n)for(let i of n.queryResultSequence.queryResults)"status"in i&&i.status==="Queued"&&(i.status="Canceled")}sanityCheckContext(t){if(!t.stageType)throw this.Logger.emergContext(this.logContext,`No stage type on this ${this.runTypeName}!`,t),new Error(`Internal critical error: no stage type on this ${this.runTypeName}!`)}async beforeStageExecution(t){this.sanityCheckContext(t);let n=this.runResults[t.stepID];if(n){let i=n.queryResultSequence.queryResults,o=this.getCurrentStageIndex(t.stepID),s=i[o];if(!s||!("status"in s)||s.status!=="Queued"){let a=s&&"status"in s?s.status:"no-status";throw new et(`[EventHandler.beforeStageExecution] Expected queued placeholder at index ${o} for node ${t.stepID}, but found: ${s?`status=${a}`:"undefined"}`)}s.status="Running",s.startTime=new Date,s.endTime=s.startTime,await this.updateRunResult(t.stepID)}}async updateRunWithHeartbeat(t){await this.getRepositoryForRun().updateHeartbeat(t)}async afterStageExecutionSuccess(t){let n="[EventHandler.afterStageExecutionSuccess()]";if(this.sanityCheckContext(t),!t.queryResult){let i="Got an empty query result for stage execution - query result should always be returned!";throw this.Logger.alertContext(this.GetLogContext(t.stepID),n,i),new et(i)}if(t.stageExecutionStartTime&&t.stageExecutionEndTime){let i=t.stageExecutionEndTime.getTime()-t.stageExecutionStartTime.getTime();this.analyticsCollector.addQueryTiming(t.stepID,t.stageName,i,!0,t.stageExecutionStartTime)}if(Iyt(t.queryResult)&&!t.queryResult.success){await this.updateRunWithHeartbeat({hasTestFailures:!0});let i=this.runResults[t.stepID];i&&(i.hasTestFailures=!0)}this.updateStageResultAtTrackedIndex(t.stepID,this.getQueryResultForUpdateSuccess(t)),await this.updateRunResult(t.stepID),await this.repositoryUpdateCurrentQueryResult(t.stepID),this.advanceToNextStage(t.stepID)}async afterStageExecutionFailure(t){if(this.sanityCheckContext(t),t.stageExecutionStartTime&&t.stageExecutionEndTime){let o=t.stageExecutionEndTime.getTime()-t.stageExecutionStartTime.getTime();this.analyticsCollector.addQueryTiming(t.stepID,t.stageName,o,!1,t.stageExecutionStartTime)}let n=await this.isCoalesceInitiatedCancel(t.error),i=await this.dispatchQueryFailure(t,n);await this.updateRunResult(t.stepID);try{await this.repositoryUpdateCurrentQueryResult(t.stepID)}catch(o){this.Logger.errorContext(this.GetLogContext(t.stepID),"got an error trying to update firebase during error handling:",o,"re-throwing the original error")}throw this.advanceToNextStage(t.stepID),n?t.error:i}async isCoalesceInitiatedCancel(t){return xQe(t)?!0:BQe(t)?this.runIsCanceled():kQe(t)?this.runIsCanceled():!1}static truncateQueryResult(t,n=_hc,i=vhc){let o=t.sql,s=t.rows,a,u;if(o){let l=new TextEncoder,c=new TextDecoder("utf8"),d=l.encode(o);if(d.length>n){let p=c.decode(d.slice(0,n));p.slice(-1)==="\uFFFD"&&(p=p.slice(0,-1)),a=`${p}...data truncated`}}return s?.length>i&&(u=s.slice(0,i),u.push({values:[`${s.length-i} rows truncated`]})),a||u?{...t,sql:a??o,rows:u??s}:t}static truncateRunResult(t){let n=(t.dataResult?.sql?1:0)+(t.queryResultSequence?.renderQueryResults?.sql?1:0)+(t.queryResultSequence?.queryResults?.length??0),i=(t.dataResult?.rows?.length?1:0)+(t.queryResultSequence?.renderQueryResults?.rows?.length?1:0)+(t.queryResultSequence?.queryResults?.reduce((l,c)=>l+c?.rows?.length?1:0,0)??0);if(n===0&&i===0)return t;let o=Math.trunc(_hc/n)-100,s=vhc/(i??1),a={...t};t.dataResult?.sql&&(a.dataResult=r.truncateQueryResult(t.dataResult,o,s)??null);let u=t.queryResultSequence;return u&&(a.queryResultSequence={...u,queryResults:u.queryResults?.map(l=>r.truncateQueryResult(l,o,s))},u.renderQueryResults&&(a.queryResultSequence.renderQueryResults=r.truncateQueryResult(u.renderQueryResults,o,s))),a}};var Byt=class extends LQe{constructor(n,i,o,s,a){super(n,i,o,"create",a);this.phasedNodeData=s}getNameForStageWithoutSQL=(n,i)=>ZKn(n,i);getNodeDataForUpdate=n=>{let i=this.getSingleStepData(n.phase,n.stepID),o=i.operation.locationName,s=BK(this.state.mappings,this.envID),a=this.GetLogContext(n.stepID),u;try{let l=s?.[o]?.database??i.operation.database,c=s?.[o]?.schema??i.operation.schema;return u={...i.operation,metadata:{...i.operation.metadata,columns:i.operation.metadata.columns.map(d=>({...d}))},database:l,schema:c,version:1,id:n.stepID,deployEnabled:!0},this.Logger.infoContext(a,"newStepData:",u,"stepCounter:",n.stepID),OQa("(Logging Only) Compare locations from context and workspace",a,()=>{let d=BK(this.state.mappings||{},this.state.currentWorkspace);Dp("DEPLOY",Cue(d[o],s[o]),a,`Location data for location ${o} for node ${i.operation.name} with id ${n.stepID} differs between data from context and data from workspace.`,"locationsFromWorkspace:",d,"locationsFromContext:",s)}),u}catch(l){let c=u?u.name:i.operation.name,d=`Error attempting to update the database/schema on deployed nodeID ${n.stepID}: ${c}`;throw this.Logger.emergContext(a,d,"locations:",s,"error:",l),new Mne(n.stepID,d)}};async updateEnvironmentNodeMetadata(n){if(!this.repository)return;let i=this.repository.org(this.teamID).workspace(+this.envID).nodes.get(n.stepID);if(n.phase==="deletedTable")n.stepID in this.phasedNodeData.addedTable||await i.delete();else{let o=this.getNodeDataForUpdate(n);await i.save(o)}}isFinalRunForStep(n){let i=[];return n.phase==="deletedTable"&&(i.push(this.phasedNodeData.alteredTable),i.push(this.phasedNodeData.addedTable)),n.phase==="alteredTable"&&i.push(this.phasedNodeData.addedTable),!i.some(o=>n.stepID in o)}async afterFinalRunSuccessForNode(n){try{await this.updateEnvironmentNodeMetadata(n)}catch(i){let o=this.GetLogContext(n.stepID);throw this.Logger.errorContext(o,"Error setting firebase -- stepCounter:",n.stepID,"error:",i),new Mne(n.stepID,`Failed to set firebase for step: ${this.teamID}, ${this.envID}, ${n.stepID}`)}}};var Thc=(r,t)=>{let n=new Set(t);return n.delete(r),Array.from(n)},eYn=async(r,t,n)=>{if(!t)throw new et(`Cannot get deploy run info since workspace ${r} has no currently running jobs`);if(t.length)return(await n.selectInBatches("id","in",t,[["runType","==","deploy"],["runStatus","==","running"]]))[0]};var tYn="No SQL to execute";var kyt=class extends LQe{constructor(t,n,i,o){super(t,n,i,"run",o)}async initializeRunResults(t){await super.initializeRunResults(t,"waiting")}getNameForStageWithoutSQL=()=>tYn};var rYn=class extends Byt{constructor(t,n,i,o,s){super(t,n,i,o,s)}get Logger(){return We("DEPLOY")}get runTypeName(){return"Deploy"}get runLevel(){return"orgRuns"}},nYn=class extends kyt{get Logger(){return We("RUNNER")}get runTypeName(){return"Refresh"}get runLevel(){return"orgRuns"}afterStepExecutionSuccess=async t=>{await super.afterStepExecutionSuccess(t),this.repository&&super.isFinalRunForStep(t)&&!t.isSource&&await this.repository.org(this.logContext.orgID).workspace(this.logContext.workspaceID).nodeLastRefreshed(t.stepID).save({lastRefreshed:new Date().toISOString()})};getQueryResultForUpdateSuccess=t=>({...super.getQueryResultForUpdateSuccess(t),type:t.stageType});async dispatchQueryFailure(t,n){if(Shc(t.error)){let i=t.error,o=this.getCurrentStageIndex(t.stepID);t.stepID in this.runResults&&(this.runResults[t.stepID].queryResultSequence.queryResults[o]=this.convertIQueryToCompletedQueryResult(i.result));let s=this.runResults[t.stepID];return s&&(s.hasTestFailures=!0),await this.updateRunWithHeartbeat({hasTestFailures:!0}),{error:{errorString:t.error.message,errorDetail:t.error.message}}}else return super.dispatchQueryFailure(t,n)}},iYn=class extends Byt{get Logger(){return We("RUNNER")}get runTypeName(){return"Dev Run"}get runLevel(){return"devRuns"}},oYn=class extends kyt{get Logger(){return We("RUNNER")}get runTypeName(){return"Dev Run"}get runLevel(){return"devRuns"}};var E3e=["deletedTable","alteredTable","addedTable"],C3e=["refresh"];var sYn=`{%- macro get_value_by_column_attribute(column_attribute, value="name") -%}
9474
+ `,l),l}return i};var MQe=We("SEARCH"),qE2=M.object({include:M.string(),exclude:M.string(),enabled:M.boolean()}),bBh=new RegExp(/([\+]?){([\s\S]+)}([\+](?![\+]))?\s*/g),EBh=new RegExp(/((\w+):\s*((?:["])((([^\"\+\r\n\[/\\]+))(?:["]))|(([^\"\ \+\r\n\[/\\]+))))/g),CBh=new RegExp(/((?:[^\+\ \r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+)\s*/g),Pyt=(r,t)=>!!w1s(r,t).length,rhc={name:{MatchFunction:Pyt,MatchList:r=>[r.operation.name]},location:{MatchFunction:Pyt,MatchList:r=>[r.operation.locationName]},nodeType:{MatchFunction:Pyt,MatchList:r=>[r.operation.sqlType]},subgraph:{MatchFunction:Pyt,MatchList:r=>[r?.id?.toString(),r.name]},nodeID:{MatchFunction:Pyt,MatchList:r=>[r]}},nhc=r=>{let t=[];return r.forEach((n,i)=>{if(n==="+{"||n==="{"||n==="}"||n==="}+")return;let o=n,s=n.split(""),a=s[s.length-1],u=s[0];a!=="}"&&a!=="+"&&(o=o+r[i+1]),u!=="{"&&u!=="+"&&(o=r[i-1]+o),t.push(o)}),t},SBh=2,_Bh=1,vBh=3,TBh=2,IBh=5,OBh=8,ihc=(r,t,n)=>{let{steps:i,graphInformation:o,allSubgraphs:s,allStepTypesYAML:a}=n,u={},l=uT()?Date.now():performance.now(),c=r;c||(c=t);let d=c.split(/(\}\+?)\s*(or|OR|\|\|)\s*(\+?\{)/).filter(A=>!(A==="OR"||A==="or"||A==="||")),p=nhc(d);p.length||(p=[t]),MQe.debug("got unions",p,"searchStringTouse",c,"defaultSearchString",t,"steps",i),p.forEach(A=>{let g=A.split(/(\}\+?)\s*(and|AND|\,)\s*(\+?\{)/).filter(R=>!(R==="AND"||R==="and"||R===",")),b=nhc(g),_=[];b.forEach(R=>{let w={};MQe.debug("Got intersection:",R);let P=[...R.matchAll(bBh)];if(MQe.debug("Got matches:",R,P),!P[0])return;let z=P[0][SBh],j={prefix:P[0][_Bh]||"",postfix:P[0][vBh]||""};if(z.indexOf(":")>-1)[...z.trim().matchAll(EBh)].forEach(L=>{let W=L[TBh],V=L[IBh]||L[OBh];j[W]=V});else{let L=[...z.trim().matchAll(CBh)][0];L&&(j.name=L[0])}B3(j);let U=j;MQe.debug("Got groups ",R,U);let G=new Set;if(U.subgraph?Object.values(s).forEach(H=>{let L=rhc.subgraph,W=L.MatchList(H);if(L.MatchFunction(W,U.subgraph)){let{steps:q}=H;q.forEach(Y=>{G.add(Y.toString())})}else return}):G=new Set(Object.keys(i)),U.nodeType){let{nodeType:H}=U;if(!a[H]){let L=H;Object.entries(a).forEach(([W,V])=>{V.name===H&&(L=W)}),U.nodeType=L}}Object.keys(i).forEach(H=>{if(!U){MQe.emerg("got an unexpected undefined value for match",c,U,R);return}let L=G.has(H);if(Object.entries(U).forEach(([W,V])=>{let q=i[H];if(W==="nodeID"&&(q=H),W==="subgraph"){L=G.has(H);return}let Y=rhc[W];if(Y){let J=Y.MatchList(q).filter(re=>re!=null);L=L&&Y.MatchFunction(J,V)}}),L){if(w[H]=!0,U.prefix&&o){let W=P1s(o,H,"predecessors");Object.values(W).forEach(V=>[...V.keys()].forEach(q=>w[q]=!0))}if(U.postfix&&o){let W=P1s(o,H,"successors");Object.values(W).forEach(V=>[...V.keys()].forEach(q=>w[q]=!0))}}}),_.push(w)}),_.length||_.push({});let v={};Object.keys(i).forEach(R=>{v[R]=!0});let O=_.reduce((R,w)=>Object.fromEntries(AQa(R,w).map(P=>[P,!0])),v);u={...u,...O}});let f=uT()?Date.now():performance.now();return MQe.debug("Time that search took: ",f-l),u};var ohc=(r,t,n)=>{let i=ihc(`${r}`,"{ * }",n),o=ihc(`${t}`,"!*",n),s=i;return Object.keys(o).forEach(a=>{delete s[a]}),{stepsResult:s}};var shc=(r,t,n,i)=>{let o=[];return t.forEach(s=>{let a=i[s];if(a){let{name:u}=a,l=`{ subgraph: "${u}" }`;o.push(l)}}),r.forEach(s=>{let a=n[s];if(a){let{locationName:u,name:l}=a.operation,c=`{ location: ${u} name: ${l} }`;o.push(c)}}),o};var RBh=We("JOBS");var ahc=r=>!r?.hasOwnProperty("includeSelector")||!r?.hasOwnProperty("version"),N1s=(r,t,n)=>{let{steps:i,subgraphs:o,...s}=r,a={...s};if(a.hasOwnProperty("version")||(a.version=R0e),a.hasOwnProperty("includeSelector"))return a;a.includeSelector="",a.excludeSelector="";let u=new Set(i),l=new Set(o),p=shc([...u],[...l].map(f=>`${f}`),n,t).map(f=>`+${f}`).join(" OR ");return a.includeSelector=p,RBh.info("Upgrading job v1 to v2",r,a),a};var uhc=(r,t)=>{let{jobs:n,folders:i,steps:o}=r,s=n[t];return N1s(s,i,o)};var VE2=We("PACKAGES_BACKEND");var chc=(r,t,n)=>{let i=a1s(t)??"",o=r?.config?.entities?.nodeTypes[i];return o||(n.error(`No config found for node type ${t}`),{isDisabled:!1,defaultStorageLocation:null})};var YKn=(r,t={})=>Object.values(r).map(n=>MBh(n)).reduce((n,i)=>{for(let[o,s]of Object.entries(i))n[o]=s;return n},t),MBh=r=>Object.fromEntries(Object.entries(r?.contents?.nodeTypes??{}).map(([t,n])=>{let{id:i,nodeType:o}=wBh(r.alias,t,r,n);return[i,o]})),wBh=(r,t,n,i)=>{let o=MKn(r,t),{isDisabled:s,defaultStorageLocation:a}=chc(n,o,We("PACKAGES")),u={...Vc(i),id:o,isDisabled:s};return u.metadata.defaultStorageLocation=a,{id:o,nodeType:u}};var bo=_t(e8());var PBh=bo.Record({type:bo.Unknown,name:bo.String}),lhc=bo.Record({locationName:bo.String,nodeName:bo.String}),dhc=bo.Record({sql:bo.String,success:bo.Boolean,rows:bo.Array(bo.Unknown),fields:bo.Array(PBh),error:bo.Union(bo.Null,VPn).optional(),startTime:bo.Unknown,endTime:bo.Unknown,status:bo.String,name:bo.String,isRunning:bo.Boolean,exportedRefs:bo.Array(lhc),invalidExportedRefs:bo.Array(lhc),queryResultSequence:bo.Optional(bo.Unknown),type:bo.Union(bo.Literal("sql"),bo.Literal("sqlTest")).optional(),warehouse:bo.String.nullable().optional(),queryID:bo.String.nullable().optional()}),D1s=bo.Record({name:bo.String,queryResults:bo.Array(dhc),isRunning:bo.Boolean,renderQueryResults:bo.Optional(dhc)}),iC2=bo.Record({runExecutionSequenceID:bo.Number,runResultVersion:bo.Number,name:bo.String,queryResultSequence:D1s,runState:bo.String}),NBh=bo.Record({dataResult:bo.Unknown,name:bo.String,queryResultSequence:D1s,runExecutionSequenceID:bo.Number,runResultVersion:bo.Number,runState:bo.String,stepRunState:MFe(efs)}),phc=P4("RunResultFirestoreValidator",NBh),DBh=bo.Record({nodeID:bo.String,queryResultSequence:D1s,runState:bo.String,hasTestFailures:bo.Boolean.optional()}),xBh=bo.Record({runResults:bo.Record({runStartTime:bo.Unknown,runEndTime:bo.Unknown,runFailureReason:bo.Optional(bo.String),runType:bo.String,runStatus:bo.String,runResults:bo.Array(DBh),runID:bo.Number,environmentID:bo.String,snowflakeAccount:bo.String.optional(),snowflakeWarehouse:bo.String.optional(),jobID:bo.Number.optional(),hasFailedTest:bo.Boolean.optional(),runTimeParameters:bo.Unknown.nullable(),includeNodesSelector:bo.String.optional(),excludeNodesSelector:bo.String.optional()})}),JKn=P4("TRunOutput",xBh);var aC2=MFe(Z0s);var kBh=["deploy","refresh","rerun","plan"],uC2=[...kBh,"devRun"];var y3e=class{constructor(t,n,i,o){this.allNodes=t;this.renderResults=n;this.extraRefs=i;this.logContext=o;this.phasedRefUsage=n.map("phased ref usage",s=>s.map(a=>a.runDetails.ref_usage))}phasedRefUsage;buildPhase(t,n){let i="[DependencyBuilder.buildPhase()]",o=n.keys(),s=Object.keys(this.extraRefs),a=[...new Set([...o,...s])];if(We("PIPELINE").appContext(this.logContext,i,"Nodes present in both current-phase data AND extra non-phased (views & advanced deploy) data:",$Li([...o],s)),this.noDependenciesPhases.includes(t))return Object.fromEntries(a.map(u=>[u,[]]));{let u=this.getNodeRefsInPhase(t,a),l=new vne(ub(this.allNodes,a));return OC(u,(c,d)=>{let{nodeIDsToAdd:p}=OKn(c,l);return[...new Set(p)].filter(f=>f!==d)})}}build(){return Object.fromEntries([...this.phasedRefUsage.entries()].map(([t,n])=>[t,this.buildPhase(t,n)]))}};var mC2=We("DEBUG");var $Kn=r=>{typeof r.stepCounter=="number"&&(r.stepCounter=`${r.stepCounter}`),typeof r.columnCounter=="number"&&(r.columnCounter=`${r.columnCounter}`)};var ofe=new Date("1980-01-01T00:00:00.000Z"),Os=(r,t,n)=>{let i=`${r}Entity`;return n||(n=Xs(t)),{standard:fr(i,n),strict:fr(`${i} (strict)`,t)}};var fhc=r=>{if(Array.isArray(r))for(let t=r.length-1;t>=0;t--)r[t]===void 0&&r.splice(t,1);if(r&&typeof r=="object")for(let t in r)r.hasOwnProperty(t)&&r[t]===void 0&&delete r[t];return[r,!1]},LBh=(r,t)=>{if(r&&typeof r=="object"){let n=r;if(n.toDate&&(!isNaN(n.seconds)&&!isNaN(n.nanoseconds)||!isNaN(n._seconds)&&!isNaN(n._nanoseconds))){let i=n.toDate();return i.getTime()===yV.SENTINEL_DATE&&Tc().emerg(`Repository server timestamp sentinel value found in stored data at path ${t}`),[i,!0]}}return[r,!1]},Ahc=(r,t)=>r instanceof nTe?[t.getDeleteSentinel(),!0]:r instanceof Date&&r.getTime()===yV.SENTINEL_DATE?[t.getServerTimestampSentinel(),!0]:[r,!1],b3e=(r,t,n)=>{let[i,o]=t(n,r);if(!o&&typeof i=="object"){if(Array.isArray(i))return i.map(s=>b3e(r,t,s));for(let s in i)i.hasOwnProperty(s)&&(i[s]=b3e(r,t,i[s]))}return i},Nyt=class{fromStorage(t,n,i,o,s){try{return this.transformFromStorage(t,n,i,o,s)}catch(a){if(s?.onDataTransformError&&s.onDataTransformError(n,a),!s?.ignoreDataTransformErrors)throw Tc().debug(`Error transforming repository entity ${n} from storage: ${a}`),a}return i}toStorage(t,n,i,o,s){try{return this.transformToStorage(t,n,i,o,s)}catch(a){if(s?.onDataTransformError&&s.onDataTransformError(n,a),!s?.ignoreDataTransformErrors)throw Tc().debug(`Error transforming repository entity ${n} to storage ${a}`),a}return i}mergeToStorage(t,n,i,o,s){try{return this.mergeTransformToStorage(t,n,i,o,s)}catch(a){if(s?.onDataTransformError&&s.onDataTransformError(n,a),!s?.ignoreDataTransformErrors)throw Tc().debug(`Error merge transforming repository entity ${n} to storage ${a}`),a}return i}},x1s=class extends Nyt{constructor(n=!1){super();this.preserveID=n}transformFromStorage(n,i,o){return"id"in o?o.id!=n&&(Tc().error(`'id' property does not match doc id on doc at path ${i}; doc id: ${n}, value.id: ${o.id}`),o.id=n):o.id=n,"createdAt"in o||(o.createdAt=ofe),"updatedAt"in o||(o.updatedAt=ofe),b3e(i,LBh,o)}transformToStorage(n,i,o,s){return this.preserveID||delete o.id,b3e(i,a=>{let[u,l]=Ahc(a,s);return l?[u,!0]:fhc(u)},o)}mergeTransformToStorage(n,i,o,s){return this.preserveID||delete o.id,b3e(i,a=>{let[u,l]=Ahc(a,s);return l?[u,!0]:fhc(u)},o)}},B1s=class extends Nyt{constructor(n){super();this.validators=n}transformFromStorage(n,i,o,s,a){let u=this.getValidatorOptions(n,a?.validatorOptions);return a?.enableStrictValidation?this.validators.strict.assert(o,u):this.validators.standard.assert(o,u)}transformToStorage(n,i,o,s,a){let u=this.getValidatorOptions(n,a?.validatorOptions);return a?.enableStrictValidation?this.validators.strict.assert(o,u):this.validators.standard.assert(o,u)}mergeTransformToStorage(n,i,o,s,a){return o}getValidatorOptions(n,i,o=500){let s={...i,statusCode:o};return s.errorMessage||(s.errorMessage=a=>`Found ${a.failures.length} validation failure(s) for ${this.validators.standard.name} ${n}`),s}},Au=(r,t,n)=>{let i=[new x1s(n),new B1s(r)];return t&&i.unshift(t),new k1s(...i)},k1s=class{transforms;constructor(...t){this.transforms=t}fromStorage(t,n,i,o,s){return this.transforms.reduce((a,u)=>u.fromStorage(t,n,a,o,s),i)}toStorage(t,n,i,o,s){return this.transforms.reduceRight((a,u)=>u.toStorage(t,n,a,o,s),i)}mergeToStorage(t,n,i,o,s){return this.transforms.reduceRight((a,u)=>u.mergeToStorage(t,n,a,o,s),i)}},Q_=class extends Nyt{transformToStorage(t,n,i){return i}mergeTransformToStorage(t,n,i){return i}};var hhc=r=>!!r&&typeof r=="object"&&!Array.isArray(r),wQe=r=>hhc(r)&&!(r instanceof Date)&&!(r instanceof RegExp),sF=r=>{if(typeof r=="string")return r;if(hhc(r)&&r.constructor&&typeof r.constructor.name=="string")return`[class ${r.constructor.name}]`;if(r instanceof Date)return`[date ${r.toISOString()}]`;if(r instanceof RegExp)return`[regexp ${r.toString()}]`;if(typeof r=="function")return`[function ${r.name}]`;try{return JSON.stringify(r)}catch{return"Error: could not stringify unknown value"}},L1s=r=>r==null,Dyt=(r,t,n,i)=>{t.filter((o,s)=>wQe(o)?!0:(n.logError(`Invalid ${r} item detected at index ${s}: ${sF(o)}`),n.logPatch(`Removed invalid ${r} item at index ${s}`),!1)).forEach(i)},mL=(r,t,n)=>{r[t]=n},sfe=(r,t)=>{delete r[t]},z1s=(r,t,n)=>{let i=new q1s(r,We("FIREBASE"),t),{logError:o,logPatch:s,report:a}=i,u=()=>(a(),n);if(!wQe(n))return u();let l=n;if([["locationName",!l.locationName&&typeof l.locationName!="string"||typeof l.locationName!="string"],["description",typeof l.description!="string"]].forEach(([c,d])=>{d&&(s(`Set non-string property ${c} from ${sF(l[c])} to ""`),mL(l,c,""))}),["dependencies","isDataVault","locationID"].forEach(c=>{c in l&&(s(`Removed deprecated field ${c}`),sfe(l,c))}),l.type==="sql")s("-- data.type is sql --"),qBh(r,l,i);else if(l.type==="sourceInput")s("-- data.type is sourceInput --"),zBh(r,l,i);else return o(`Data type is of invalid type ${sF(l.type)}`),u();return l.version!==Ane&&(s(`Set version ${sF(l.version)} to ${Ane}`),mL(l,"version",Ane)),u()},qBh=(r,t,n)=>{let{logError:i,logPatch:o}=n;if(t.isMultisource===void 0&&(o("Set missing isMultisource to false"),mL(t,"isMultisource",!1)),wQe(t.metadata)){let s=t.metadata;if(s.appliedNodeTests===null&&(o("Set metadata.appliedNodeTests from null to []"),mL(s,"appliedNodeTests",[])),!Array.isArray(s.sourceMapping)||!s.sourceMapping.length){o("Set non-array or empty metadata.sourceMapping to [ basicMapping ]");let a;typeof t.name=="string"?a=t.name:(o("Data has no name value, setting sourceMapping.name to empty string"),a=""),mL(s,"sourceMapping",[{name:a,join:{joinCondition:""},dependencies:[],noLinkRefs:[],aliases:{}}])}else Dyt("sourceMapping",s.sourceMapping,n,(a,u)=>{let l=a;if(typeof l.join=="string"){let c={joinCondition:""};o(`Setting invalid string value metadata.sourceMapping[${u}].join to object: ${sF(c)}`),mL(l,"join",c)}if(l.name===void 0){let c=l.join?.name??"";o(`Set missing metadata.sourceMapping[${u}].name to "${c}"`),mL(l,"name",c),c||i(`metadata.sourceMapping[${u}].name is an empty string`)}Array.isArray(l.dependencies)&&Dyt("sourceMapping dependency",l.dependencies,n,(c,d)=>{let p=c;for(let f of["locationName","nodeName"])L1s(p[f])&&(o(`Set metadata.sourceMapping[${u}].dependencies[${d}].${f} from ${sF(p[f])} to ""`),mL(p,f,""))})});ghc(r,s.columns,n)}if(t.config&&typeof t.config=="object")for(let[s,a]of Object.entries(t.config))a===null&&(o(`Removing null config property "${s}"`),sfe(t.config,s))},zBh=(r,t,n)=>{let{logPatch:i,logError:o}=n;if(t.dataset!==void 0&&(i("Removed deprecated v0 property dataset"),sfe(t,"dataset")),t.table!==void 0&&(t.table!==t.name&&o(`source data properties 'table' and 'name' are different for source node ${r}, table: ${t.table}, name: ${t.name}`),i("Removed deprecated v0 property table"),sfe(t,"table")),wQe(t.metadata)){let s=t.metadata;Array.isArray(s.columns)&&(s.columns.length&&ghc(r,s.columns,n),Object.keys(s).length>1&&(i(`Removed deprecated metadata properties, keeping only columns. Was: ${sF(s)}`),mL(t,"metadata",{columns:s.columns})))}},ghc=(r,t,n)=>{let{logPatch:i}=n;Array.isArray(t)&&Dyt("column",t,n,(o,s)=>{let a=o;if(["ghostRecordValue","descendedFrom","hashColumns","columnsForHash"].forEach(c=>{a.hasOwnProperty(c)&&(i(`Removed deprecated property '${c}' from metadata.columns[${s}]`),sfe(a,c))}),wQe(a.hashDetails)){let c=a.hashDetails;c.hashType&&(i(`Removed deprecated property 'hashType' from metadata.columns[${s}].hashDetails`),sfe(c,"hashType")),c.hubHashes&&(i(`Removed deprecated property 'hubHashes' from metadata.columns[${s}].hashDetails`),sfe(c,"hubHashes"))}[["appliedColumnTests",a.appliedColumnTests===null],["config",a.config===null],["hashDetails",typeof a.hashDetails=="string"]].forEach(([c,d])=>{d&&(i(`Deleted metadata.columns[${s}].${c} with invalid value ${sF(a[c])}`),sfe(a,c))}),[["dataType",typeof a.dataType!="string"],["transform",a.transform===null]].forEach(([c,d])=>{d&&(i(`Set ${c} from ${sF(a[c])} to "" in metadata.columns[${s}]`),mL(a,c,""))});let u=a.hashedColumns;if(Array.isArray(u))for(let c of u)$Kn(c);let l=a.columnReference;if(wQe(l)){$Kn(l);let c=l;L1s(c.stepCounter)&&(i(`Set metadata.columns[${s}].columnReference.stepCounter from ${sF(c.stepCounter)} to ${r}`),mL(c,"stepCounter",r))}Array.isArray(a.sourceColumnReferences)&&Dyt("sourceColumnReference",a.sourceColumnReferences,n,(c,d)=>{let p=c;Array.isArray(p.columnReferences)&&Dyt("columnReference",p.columnReferences,n,(f,A)=>{$Kn(f);let g=f;L1s(g.stepCounter)&&(i(`Set invalid metadata.columns[${s}].sourceColumnReferences[${d}].columnReferences[${A}].stepCounter to "" from ${sF(r)}`),mL(g,"stepCounter",""))})})})},q1s=class{constructor(t,n,i){this.id=t;this.logger=n;this.path=i}patchMessages=[];errorMessages=[];logPatch=t=>{this.patchMessages.push(t)};logError=t=>{this.errorMessages.push(t)};reportErrors=()=>{this.errorMessages.length&&this.logger.error(`Error patching node data with id ${this.id} at path ${this.path}`,this.errorMessages)};reportPatches=()=>{this.patchMessages.length&&this.logger.debug(`Patched node data with id ${this.id} at path ${this.path}`,this.patchMessages)};report=()=>{this.reportErrors(),this.reportPatches()}},XKn=class extends Q_{transformFromStorage(t,n,i){return z1s(t,n,i)}};var oS2=We("FIREBASE");var sS2=We("STEPS"),aS2=We("METADATA_OPERATIONS");var mhc=(r,t)=>t[r].runState==="running";var yhc=r=>(SA("STEPS",!!r,`Error converting API refs: argument apiRefLinks is ${r}.`),r.map(t=>({locationName:t.location_name,nodeName:t.node_name})));var bhc=r=>r?.deployEnabled??!0;var afe=class extends y3e{noDependenciesPhases=["deletedTable"];getNodeRefsInPhase(t,n){return Object.fromEntries(n.map(i=>{let o,s=this.extraRefs[i];s?o=[s]:o=this.phasedRefUsage.get(t,i);let a=o.map(({ref:u,ref_no_link:l})=>yhc([...u,...l]));return[i,[].concat(...a)]}))}};var PQe=class extends y3e{noDependenciesPhases=[];getNodeRefsInPhase(t,n){let i=ub(this.allNodes,...n);return OC(i,o=>{if(vQe(o.operation))return[];let{sourceMapping:s}=o.operation.metadata;if(!s?.length)return[];let a=s.map(({dependencies:u})=>u);return[].concat(...a)})}};var xyt=async(r,t)=>{let{attempts:n,tags:i,waitSeconds:o}=t,s=Tc().child({retryOptions:{maxAttempts:n,waitSeconds:o},tags:["[withRetries]",...i]});gm(n>=2,`Retry attempts value must be at least '2', but was '${n}'`,s);try{let a=await r();return s.info("Operation succeeded without retrying"),a}catch(a){s.error(`Operation initial attempt failed; retrying. Error: ${a}`);let u,l=n-1;do{l--,await new Promise(c=>setTimeout(c,o*(n-l)*1e3));try{let c=await r();return s.info(`Operation succeeded on retry (attempt ${n-l})`),c}catch(c){s.error(`Operation failed on retry (attempt ${n-l}). Error: ${c}`),u=c}}while(l);throw s.error("Exhausted all retry attempts; exiting"),u}};var DB=_t(e8()),jBh=DB.String,GBh=DB.Record({locationName:DB.String,database:DB.String,schema:DB.String}),IS2=DB.Dictionary(GBh,jBh);var OS2=DB.Record({seconds:DB.Number,nanoseconds:DB.Number});var HBh="Making metadata updates",Ehc="Deleting metadata for source input";function NQe(r,t){let n=[];for(let i of r){let o=i.compiledSQL?BKn(i.compiledSQL):[];if(o.length===0)t&&n.push({name:t,sql:"",type:"sql",continueOnFailure:!1,parsedStage:null});else for(let s of o)n.push({name:s.name,sql:s.code,type:s.type,continueOnFailure:s.continueOnFailure,parsedStage:s})}return n}function ZKn(r,t){return r==="deletedTable"&&t?Ehc:HBh}var Mne=class extends et{constructor(n,i){super(i,`Failed node ${n}: ${i}`);this.nodeID=n}};var qK=class extends et{constructor(n){super(`Run ${n} canceled by user`);this.runID=n}},DQe=class extends et{constructor(n){super('Test failed with "continue on failure" set to false');this.result=n}};var Chc=(r,t,n)=>{switch(r){case"skipped":return"Skipped";case"error":return"Error";case"complete":switch(n){case"create":return t?"Validated":"Created";case"run":return t?"Validated":"DataLoaded";default:return"None"}case"waiting":case"queued":case"running":case"canceled":default:return"None"}},Shc=r=>typeof r=="object"&&r instanceof DQe,xQe=r=>typeof r=="object"&&(r instanceof Qh||r instanceof qK),BQe=r=>typeof r=="object"&&r instanceof AL&&r.isCancel(),kQe=r=>typeof r=="object"&&r instanceof LK&&r.isCancel();var _hc=5e5,vhc=500,LQe=class r{constructor(t,n,i,o,s){this.state=t;this.repository=n;this.logContext=i;this.operationType=o;this.analyticsCollector=s}stepsInitialized=null;runResults={};wasCanceled=!1;nodeStageIndexTracker=new Map;aggregateIndex=0;analyticsCollector;get teamID(){return this.logContext.orgID}get runID(){return this.logContext.runID}get envID(){return this.logContext.workspaceID}GetLogContext=t=>({...this.logContext,nodeID:t});async runIsCanceled(){if(!this.repository)return!1;if(this.wasCanceled)return!0;try{let t=!!(await this.getRepositoryForRun().fetch({pendingWritesTimeoutMs:100})).runDetails.canceled;return t&&(this.wasCanceled=!0),t}catch(t){if(y1(t)){if(t instanceof R_e)return!1;if(t instanceof Ya)return!1}throw t}}async throwIfRunCanceled(){if(await this.runIsCanceled())throw new qK(this.runID)}updateNodeLocalRunResult({stepID:t,isPreview:n,runExecutionSequenceID:i},o){let s=this.runResults[t];s?(s.runState=o,s.queryResultSequence.isRunning=o==="running",s.stepRunState=this.getStepRunState(o,n),i!==void 0&&(s.runExecutionSequenceID=i),(o==="canceled"||o==="skipped"||o==="error")&&s.queryResultSequence.queryResults.forEach(a=>{!a.isRunning&&a.status==="Queued"&&(a.status="Canceled")})):this.Logger.errorContext(this.GetLogContext(t),"EventHandler updateNodeLocalRunResult: missing expected local run result for node",t)}getBulkSkipHandler=()=>async t=>{if(!this.repository)return;let n=this.repository.batch(),i=this.getRepositoryForRun().runResults;for(let[o,s]of Object.entries(t))if(this.runResults[o]){let a=i.get(o);this.updateNodeLocalRunResult({stepID:o,isPreview:!1,runExecutionSequenceID:s},"skipped");let u={...r.truncateRunResult(this.runResults[o]),version:2};await n.save(a,u)}await n.commit()};async repositoryUpdateRunStatus({expectedStatus:t,newStatus:n}){if(!this.repository)return;let i=this.getRepositoryForRun();try{let o=await i.fetch();Dp("RUNNER_BACKEND",t===o.runStatus,this.logContext,`EventHandler.repositoryUpdateRunStatus found unexpected run status - expected: ${t} / actual: ${o.runStatus}`)}catch(o){this.Logger.alertContext(this.logContext,"Error fetching runInfo",o)}await i.merge({runStatus:n})}async repositoryUpdateRenderingProgress(t){if(this.repository)try{await this.getRepositoryForRun().merge({renderingProgress:{totalNodes:t.totalNodes,completedNodes:t.completedNodes}})}catch(n){this.Logger.errorContext(this.logContext,"[EventHandler.repositoryUpdateRenderingProgress] Error updating rendering progress. Cannot update run document renderingProgress.",n)}}async repositoryUpdateCurrentQueryResult(t){let n="[EventHandler.repositoryUpdateCurrentQueryResult()]";if(!this.repository)return;let{queryResultSequence:{queryResults:i}}=eA(t,this.runResults,n),o=this.getCurrentStageIndex(t),s=i[o];if(!s)throw new et(`${n} Attempted to update query result at index ${o} for node '${t}', which was unexpectedly ${s}. Existing query results: ${JSON.stringify(i.map(u=>u.name))}`);if(s.isRunning)throw new et(`${n} Got an unexpected still-running query result`);let a={...r.truncateQueryResult(s),queryResultExecutionIndex:this.aggregateIndex++,version:1};await this.getRepositoryForRun().runResults.get(t).queryResults.createEntity(a)}getRepositoryRunsCollection(){if(!this.repository)throw new et("No repository to get runs collection for!");let t=this.repository.orgs.get(this.logContext.orgID);return this.runLevel==="orgRuns"?t.runs:t.devRuns}getRepositoryForRun(){return this.getRepositoryRunsCollection().get(this.runID)}formatError=(t,n=null,i=null,o=!1)=>{let s=Ga(t.error).error,a="";return t.error&&typeof t.error=="object"&&!(t.error instanceof Error)&&"runDetails"in t.error&&typeof t.error.runDetails=="object"&&(a=t.error?.runDetails?.compiledSQL??""),t.templateString&&(a=t.templateString),{success:!1,error:{errorString:s.errorString??"",errorDetail:s.errorDetail??""},rows:[],fields:[],name:"",exportedRefs:[],invalidExportedRefs:[],status:o?"Canceled":"Failure",sql:a??"",startTime:t.startTime,endTime:new Date,isRunning:!1,type:"sql",queryID:n,warehouse:i}};populateRunResults(t,n){let i="[EventHandler.populateRunResults()]",o=t.length+1;for(let s of t){let u=eA(s,this.state.nodes,`${i} state.nodes`).operation.name;this.runResults[s]={name:u,runExecutionSequenceID:o,dataResult:null,runState:n,stepRunState:"None",queryResultSequence:{name:u,queryResults:[],isRunning:!1},runResultVersion:2}}}async bulkSetRunResults(t){if(!this.repository)return;let n=this.repository.batch(),i=this.getRepositoryForRun().runResults;for(let o of t){let s=this.runResults[o];if(!s)throw new et(`Run result for node ${o} does not exist for run ${this.runID}`);let a={...s,name:s.queryResultSequence.name,runExecutionSequenceID:s.runExecutionSequenceID,version:2},u=i.get(o);await n.save(u,a)}await n.commit()}async initializeRunResults(t,n="queued"){this.stepsInitialized=[...t],this.populateRunResults(t,n),await this.bulkSetRunResults(t)}async populatePlaceholderStages(t,n){let i=new Set,o=new Set(t.keys());for(let s of n){if(!o.has(s))continue;let a=t.getPhaseItems(s);for(let[u,l]of a.entries()){let c=eA(u,this.runResults,"populateQueuedStages: this.runResults"),d=this.state.nodes[u],p=d?wB(d,void 0):!1,f=NQe(l,this.getNameForStageWithoutSQL(s,p));for(let A of f)c.queryResultSequence.queryResults.push(this.createQueuedStage(A));f.length>0&&!i.has(u)&&(i.add(u),this.nodeStageIndexTracker.set(u,0))}}await this.bulkSetQueuedStageResults(i)}createQueuedStage({name:t,sql:n,type:i}){return{name:t,status:"Queued",success:!0,sql:n,rows:[],fields:[],startTime:new Date,endTime:new Date,isRunning:!1,exportedRefs:[],invalidExportedRefs:[],type:i}}async bulkSetQueuedStageResults(t){if(!this.repository)return;let n=this.repository.batch(),i=this.getRepositoryForRun().runResults;for(let o of t){let s=this.runResults[o];if(!s)continue;let a={...r.truncateRunResult(s),name:s.queryResultSequence.name,runExecutionSequenceID:s.runExecutionSequenceID,version:2},u=i.get(o);await n.save(u,a)}await n.commit()}formatErrorToResult(t,n){let i=null,o=null;return typeof t.error=="object"&&(i=t.error.queryID||null,o=t.error.warehouse||null),{...this.formatError(t,i,o,n),name:t.stageName,stageExecutionStartTime:t.stageExecutionStartTime,stageExecutionEndTime:t.stageExecutionEndTime}}ensureHasQueryResult(t){if(Dp("DEPLOY",!!t.queryResult,this.GetLogContext(t.stepID),"query result should always be returned for stage execution"),!t.queryResult)throw new Error("Got an empty query result for stage execution")}updateStageResultAtTrackedIndex=(t,n)=>{let o=eA(t,this.runResults,"[EventHandler.setLastQueryResult()]").queryResultSequence.queryResults,s=this.getCurrentStageIndex(t);if(s<0||s>=o.length)throw this.Logger.errorContext(this.GetLogContext(t),"[EventHandler.setLastQueryResult] stage index out of bounds",{targetIndex:s,queryResultsLength:o.length,resultName:n.name}),new et(`Stage index ${s} out of bounds (length: ${o.length}) for node ${t}`);o[s]=n};async dispatchQueryFailure(t,n){let i=this.formatErrorToResult(t,n);return this.Logger.errorContext(this.GetLogContext(t.stepID),"failed to execute run sql",n?"- canceled":"- errored",t.error,"stack: ",t.error.stack||"<none found>"),this.updateStageResultAtTrackedIndex(t.stepID,i),{error:i.error}}getSingleStepData(t,n){let i=this.state.nodes[n];if(i)return i;let o=`(${this.runTypeName}) EventHandler: Could not get step data for step: ${n}`;throw this.Logger.errorContext(this.GetLogContext(n),o,n),new et(o)}getUnrunSteps(){let t={},n=this.state.nodes,i=this.runResults;if(n&&this.stepsInitialized)for(let o of this.stepsInitialized){let s=i[o];if(s){let{runState:a}=s;(a==="waiting"||a==="queued")&&(n[o]?t[o]=0:this.Logger.alertContext(this.logContext,"Node ID from initialization not found in steps data",o))}else this.Logger.alertContext(this.logContext,"Node ID from initialization not found in run results",o)}return t}getStepContext=(t,n,i,o)=>{let s=this.getSingleStepData(t,n),{locationName:a}=s.operation,{database:u}=this.state.mappings[a]?.mappingDefinitions[this.state.currentWorkspace]??{},l=wB(s,void 0),c=s.operation.name;return{startTime:new Date,stepID:n,stepName:c,runExecutionSequenceID:i,phase:t,isPreview:o,isSource:l,database:u??""}};convertIQueryToCompletedQueryResult(t){return{...t,startTime:A8n(t.startTime),endTime:A8n(t.endTime)}}getCurrentStageIndex(t){let n=this.nodeStageIndexTracker.get(t);if(n===void 0)throw new et(`[EventHandler.getCurrentStageIndex] Node ${t} not in stage tracker. Was populateQueuedStages called for this node?`);return n}advanceToNextStage(t){let n=this.getCurrentStageIndex(t);this.nodeStageIndexTracker.set(t,n+1)}getQueryResultForUpdateSuccess(t){return{...this.convertIQueryToCompletedQueryResult(t.queryResult),name:t.stageName,stageExecutionStartTime:t.stageExecutionStartTime,stageExecutionEndTime:t.stageExecutionEndTime}}getStepRunState(t,n){return Chc(t,n,this.operationType)}async updateRunResult(t){if(!this.repository)return;let n=this.runResults[t];if(!n)throw new et(`[EventHandler.updateRunResult()] run result for node ${t} does not exist for run ${this.runID}`);let i={...r.truncateRunResult(n),name:n.queryResultSequence.name,runExecutionSequenceID:n.runExecutionSequenceID,version:2};this.Logger.debugContext(this.GetLogContext(t),"updating run result",i),await this.getRepositoryForRun().runResults.get(t).save(i)}isFinalRunForStep(t){return!0}async beforePhaseExecution(t,n){}async afterPhaseExecution(t){}async beforeStepExecution(t){this.runResults[t.stepID]&&(this.runResults[t.stepID].runExecutionSequenceID=t.runExecutionSequenceID),this.updateNodeLocalRunResult(t,"running"),await this.updateRunResult(t.stepID)}async afterFinalRunSuccessForNode(t){return Promise.resolve()}async afterStepExecutionSuccess(t){this.isFinalRunForStep(t)?(this.updateNodeLocalRunResult(t,"complete"),await this.afterFinalRunSuccessForNode(t)):this.updateNodeLocalRunResult(t,"waiting"),await this.updateRunResult(t.stepID)}async afterStepExecutionFailure(t){let n=await this.isCoalesceInitiatedCancel(t.error);this.markUnexecutedStagesAsCanceled(t.stepID),this.updateNodeLocalRunResult(t,n?"canceled":"error");try{await this.updateRunResult(t.stepID)}catch(i){this.Logger.emergContext(this.GetLogContext(t.stepID),`Error in firebaseUpdateStepResult for stepCounter:${t.stepID}:`,i)}}markUnexecutedStagesAsCanceled(t){let n=this.runResults[t];if(n)for(let i of n.queryResultSequence.queryResults)"status"in i&&i.status==="Queued"&&(i.status="Canceled")}sanityCheckContext(t){if(!t.stageType)throw this.Logger.emergContext(this.logContext,`No stage type on this ${this.runTypeName}!`,t),new Error(`Internal critical error: no stage type on this ${this.runTypeName}!`)}async beforeStageExecution(t){this.sanityCheckContext(t);let n=this.runResults[t.stepID];if(n){let i=n.queryResultSequence.queryResults,o=this.getCurrentStageIndex(t.stepID),s=i[o];if(!s||!("status"in s)||s.status!=="Queued"){let a=s&&"status"in s?s.status:"no-status";throw new et(`[EventHandler.beforeStageExecution] Expected queued placeholder at index ${o} for node ${t.stepID}, but found: ${s?`status=${a}`:"undefined"}`)}s.status="Running",s.startTime=new Date,s.endTime=s.startTime}}async updateRunWithHeartbeat(t){await this.getRepositoryForRun().updateHeartbeat(t)}async afterStageExecutionSuccess(t){let n="[EventHandler.afterStageExecutionSuccess()]";if(this.sanityCheckContext(t),!t.queryResult){let i="Got an empty query result for stage execution - query result should always be returned!";throw this.Logger.alertContext(this.GetLogContext(t.stepID),n,i),new et(i)}if(t.stageExecutionStartTime&&t.stageExecutionEndTime){let i=t.stageExecutionEndTime.getTime()-t.stageExecutionStartTime.getTime();this.analyticsCollector.addQueryTiming(t.stepID,t.stageName,i,!0,t.stageExecutionStartTime)}if(Iyt(t.queryResult)&&!t.queryResult.success){await this.updateRunWithHeartbeat({hasTestFailures:!0});let i=this.runResults[t.stepID];i&&(i.hasTestFailures=!0)}this.updateStageResultAtTrackedIndex(t.stepID,this.getQueryResultForUpdateSuccess(t)),await this.repositoryUpdateCurrentQueryResult(t.stepID),this.advanceToNextStage(t.stepID)}async afterStageExecutionFailure(t){if(this.sanityCheckContext(t),t.stageExecutionStartTime&&t.stageExecutionEndTime){let o=t.stageExecutionEndTime.getTime()-t.stageExecutionStartTime.getTime();this.analyticsCollector.addQueryTiming(t.stepID,t.stageName,o,!1,t.stageExecutionStartTime)}let n=await this.isCoalesceInitiatedCancel(t.error),i=await this.dispatchQueryFailure(t,n);try{await this.repositoryUpdateCurrentQueryResult(t.stepID)}catch(o){this.Logger.errorContext(this.GetLogContext(t.stepID),"got an error trying to update firebase during error handling:",o,"re-throwing the original error")}throw this.advanceToNextStage(t.stepID),n?t.error:i}async isCoalesceInitiatedCancel(t){return xQe(t)?!0:BQe(t)?this.runIsCanceled():kQe(t)?this.runIsCanceled():!1}static truncateQueryResult(t,n=_hc,i=vhc){let o=t.sql,s=t.rows,a,u;if(o){let l=new TextEncoder,c=new TextDecoder("utf8"),d=l.encode(o);if(d.length>n){let p=c.decode(d.slice(0,n));p.slice(-1)==="\uFFFD"&&(p=p.slice(0,-1)),a=`${p}...data truncated`}}return s?.length>i&&(u=s.slice(0,i),u.push({values:[`${s.length-i} rows truncated`]})),a||u?{...t,sql:a??o,rows:u??s}:t}static truncateRunResult(t){let n=(t.dataResult?.sql?1:0)+(t.queryResultSequence?.renderQueryResults?.sql?1:0)+(t.queryResultSequence?.queryResults?.length??0),i=(t.dataResult?.rows?.length?1:0)+(t.queryResultSequence?.renderQueryResults?.rows?.length?1:0)+(t.queryResultSequence?.queryResults?.reduce((l,c)=>l+c?.rows?.length?1:0,0)??0);if(n===0&&i===0)return t;let o=Math.trunc(_hc/n)-100,s=vhc/(i??1),a={...t};t.dataResult?.sql&&(a.dataResult=r.truncateQueryResult(t.dataResult,o,s)??null);let u=t.queryResultSequence;return u&&(a.queryResultSequence={...u,queryResults:u.queryResults?.map(l=>r.truncateQueryResult(l,o,s))},u.renderQueryResults&&(a.queryResultSequence.renderQueryResults=r.truncateQueryResult(u.renderQueryResults,o,s))),a}};var Byt=class extends LQe{constructor(n,i,o,s,a){super(n,i,o,"create",a);this.phasedNodeData=s}getNameForStageWithoutSQL=(n,i)=>ZKn(n,i);getNodeDataForUpdate=n=>{let i=this.getSingleStepData(n.phase,n.stepID),o=i.operation.locationName,s=BK(this.state.mappings,this.envID),a=this.GetLogContext(n.stepID),u;try{let l=s?.[o]?.database??i.operation.database,c=s?.[o]?.schema??i.operation.schema;return u={...i.operation,metadata:{...i.operation.metadata,columns:i.operation.metadata.columns.map(d=>({...d}))},database:l,schema:c,version:1,id:n.stepID,deployEnabled:!0},this.Logger.infoContext(a,"newStepData:",u,"stepCounter:",n.stepID),OQa("(Logging Only) Compare locations from context and workspace",a,()=>{let d=BK(this.state.mappings||{},this.state.currentWorkspace);Dp("DEPLOY",Cue(d[o],s[o]),a,`Location data for location ${o} for node ${i.operation.name} with id ${n.stepID} differs between data from context and data from workspace.`,"locationsFromWorkspace:",d,"locationsFromContext:",s)}),u}catch(l){let c=u?u.name:i.operation.name,d=`Error attempting to update the database/schema on deployed nodeID ${n.stepID}: ${c}`;throw this.Logger.emergContext(a,d,"locations:",s,"error:",l),new Mne(n.stepID,d)}};async updateEnvironmentNodeMetadata(n){if(!this.repository)return;let i=this.repository.org(this.teamID).workspace(+this.envID).nodes.get(n.stepID);if(n.phase==="deletedTable")n.stepID in this.phasedNodeData.addedTable||await i.delete();else{let o=this.getNodeDataForUpdate(n);await i.save(o)}}isFinalRunForStep(n){let i=[];return n.phase==="deletedTable"&&(i.push(this.phasedNodeData.alteredTable),i.push(this.phasedNodeData.addedTable)),n.phase==="alteredTable"&&i.push(this.phasedNodeData.addedTable),!i.some(o=>n.stepID in o)}async afterFinalRunSuccessForNode(n){try{await this.updateEnvironmentNodeMetadata(n)}catch(i){let o=this.GetLogContext(n.stepID);throw this.Logger.errorContext(o,"Error setting firebase -- stepCounter:",n.stepID,"error:",i),new Mne(n.stepID,`Failed to set firebase for step: ${this.teamID}, ${this.envID}, ${n.stepID}`)}}};var Thc=(r,t)=>{let n=new Set(t);return n.delete(r),Array.from(n)},eYn=async(r,t,n)=>{if(!t)throw new et(`Cannot get deploy run info since workspace ${r} has no currently running jobs`);if(t.length)return(await n.selectInBatches("id","in",t,[["runType","==","deploy"],["runStatus","==","running"]]))[0]};var tYn="No SQL to execute";var kyt=class extends LQe{constructor(t,n,i,o){super(t,n,i,"run",o)}async initializeRunResults(t){await super.initializeRunResults(t,"waiting")}getNameForStageWithoutSQL=()=>tYn};var rYn=class extends Byt{constructor(t,n,i,o,s){super(t,n,i,o,s)}get Logger(){return We("DEPLOY")}get runTypeName(){return"Deploy"}get runLevel(){return"orgRuns"}},nYn=class extends kyt{get Logger(){return We("RUNNER")}get runTypeName(){return"Refresh"}get runLevel(){return"orgRuns"}afterStepExecutionSuccess=async t=>{await super.afterStepExecutionSuccess(t),this.repository&&super.isFinalRunForStep(t)&&!t.isSource&&await this.repository.org(this.logContext.orgID).workspace(this.logContext.workspaceID).nodeLastRefreshed(t.stepID).save({lastRefreshed:new Date().toISOString()})};getQueryResultForUpdateSuccess=t=>({...super.getQueryResultForUpdateSuccess(t),type:t.stageType});async dispatchQueryFailure(t,n){if(Shc(t.error)){let i=t.error,o=this.getCurrentStageIndex(t.stepID);t.stepID in this.runResults&&(this.runResults[t.stepID].queryResultSequence.queryResults[o]=this.convertIQueryToCompletedQueryResult(i.result));let s=this.runResults[t.stepID];return s&&(s.hasTestFailures=!0),await this.updateRunWithHeartbeat({hasTestFailures:!0}),{error:{errorString:t.error.message,errorDetail:t.error.message}}}else return super.dispatchQueryFailure(t,n)}},iYn=class extends Byt{get Logger(){return We("RUNNER")}get runTypeName(){return"Dev Run"}get runLevel(){return"devRuns"}},oYn=class extends kyt{get Logger(){return We("RUNNER")}get runTypeName(){return"Dev Run"}get runLevel(){return"devRuns"}};var E3e=["deletedTable","alteredTable","addedTable"],C3e=["refresh"];var sYn=`{%- macro get_value_by_column_attribute(column_attribute, value="name") -%}
9475
9475
  {%- set filtered_columns_by_attribute = columns | selectattr(column_attribute) | list -%}
9476
9476
  {%- if filtered_columns_by_attribute | length > 0 -%}
9477
9477
  {{- (filtered_columns_by_attribute | first)[value] -}}
@@ -10367,12 +10367,12 @@ The delete attempt failed with this message:
10367
10367
  `,r.UPLOAD_MISMATCH=`The uploaded data did not match the data from the server.
10368
10368
  As a precaution, the file has been deleted.
10369
10369
  To be sure the content is the same, you should try uploading the file again.`,r.MD5_RESUMED_UPLOAD="MD5 cannot be used with a continued resumable upload as MD5 cannot be extended from an existing value",r.MISSING_RESUME_CRC32C_FINAL_UPLOAD="The CRC32C is missing for the final portion of a resumed upload, which is required for validation. Please provide `resumeCRC32C` if validation is required, or disable `validation`."})(JI||(JI={}));var QZ=class r extends rx{constructor(t,n,i={}){var o,s;let a={},u;i.generation!==null&&(typeof i.generation=="string"?u=Number(i.generation):u=i.generation,isNaN(u)||(a.generation=u)),Object.assign(a,i.preconditionOpts);let l=i.userProject||t.userProject;typeof l=="string"&&(a.userProject=l);let c={delete:{reqOpts:{qs:a}},exists:{reqOpts:{qs:a}},get:{reqOpts:{qs:a}},getMetadata:{reqOpts:{qs:a}},setMetadata:{reqOpts:{qs:a}}};if(super({parent:t,baseUrl:"/o",id:encodeURIComponent(n),methods:c}),Z0a.add(this),this.bucket=t,this.storage=t.parent,i.generation!==null){let d;typeof i.generation=="string"?d=Number(i.generation):d=i.generation,isNaN(d)||(this.generation=d)}this.kmsKeyName=i.kmsKeyName,this.userProject=l,this.name=n,i.encryptionKey&&this.setEncryptionKey(i.encryptionKey),this.acl=new SEe({request:this.request.bind(this),pathPrefix:"/acl"}),this.crc32cGenerator=i.crc32cGenerator||this.bucket.crc32cGenerator,this.instanceRetryValue=(s=(o=this.storage)===null||o===void 0?void 0:o.retryOptions)===null||s===void 0?void 0:s.autoRetry,this.instancePreconditionOpts=i?.preconditionOpts}get cloudStorageURI(){let t=this.bucket.cloudStorageURI;return t.pathname=this.name,t}shouldRetryBasedOnPreconditionAndIdempotencyStrat(t){var n;return!(t?.ifGenerationMatch===void 0&&((n=this.instancePreconditionOpts)===null||n===void 0?void 0:n.ifGenerationMatch)===void 0&&this.storage.retryOptions.idempotencyStrategy===n2.RetryConditional||this.storage.retryOptions.idempotencyStrategy===n2.RetryNever)}copy(t,n,i){var o,s;let a=new Error(JI.DESTINATION_NO_NAME);if(!t)throw a;let u={};typeof n=="function"?i=n:n&&(u={...n}),i=i||jp.noop;let l,c,d;if(typeof t=="string"){let A=hBm.exec(t);A!==null&&A.length===3?(l=this.storage.bucket(A[1]),c=A[2]):(l=this.bucket,c=t)}else if(t instanceof UZ)l=t,c=this.name;else if(t instanceof r)l=t.bucket,c=t.name,d=t;else throw a;let p={};this.generation!==void 0&&(p.sourceGeneration=this.generation),u.token!==void 0&&(p.rewriteToken=u.token),u.userProject!==void 0&&(p.userProject=u.userProject,delete u.userProject),u.predefinedAcl!==void 0&&(p.destinationPredefinedAcl=u.predefinedAcl,delete u.predefinedAcl),d=d||l.file(c);let f={};if(this.encryptionKey!==void 0&&(f["x-goog-copy-source-encryption-algorithm"]="AES256",f["x-goog-copy-source-encryption-key"]=this.encryptionKeyBase64,f["x-goog-copy-source-encryption-key-sha256"]=this.encryptionKeyHash),d.encryptionKey!==void 0?this.setEncryptionKey(d.encryptionKey):u.destinationKmsKeyName!==void 0?(p.destinationKmsKeyName=u.destinationKmsKeyName,delete u.destinationKmsKeyName):d.kmsKeyName!==void 0&&(p.destinationKmsKeyName=d.kmsKeyName),p.destinationKmsKeyName){this.kmsKeyName=p.destinationKmsKeyName;let A=this.interceptors.indexOf(this.encryptionKeyInterceptor);A>-1&&this.interceptors.splice(A,1)}this.shouldRetryBasedOnPreconditionAndIdempotencyStrat(u?.preconditionOpts)||(this.storage.retryOptions.autoRetry=!1),((o=u.preconditionOpts)===null||o===void 0?void 0:o.ifGenerationMatch)!==void 0&&(p.ifGenerationMatch=(s=u.preconditionOpts)===null||s===void 0?void 0:s.ifGenerationMatch,delete u.preconditionOpts),this.request({method:"POST",uri:`/rewriteTo/b/${l.name}/o/${encodeURIComponent(d.name)}`,qs:p,json:u,headers:f},(A,g)=>{if(this.storage.retryOptions.autoRetry=this.instanceRetryValue,A){i(A,null,g);return}if(g.rewriteToken){let b={token:g.rewriteToken};p.userProject&&(b.userProject=p.userProject),p.destinationKmsKeyName&&(b.destinationKmsKeyName=p.destinationKmsKeyName),this.copy(d,b,i);return}i(null,d,g)})}createReadStream(t={}){t=Object.assign({decompress:!0},t);let n=typeof t.start=="number"||typeof t.end=="number",i=t.end<0,o,s,a=new pxt,u=!0,l=!1;if(typeof t.validation=="string"){let A=t.validation.toLowerCase().trim();u=A==="crc32c",l=A==="md5"}else t.validation===!1&&(u=!1);let c=!n&&(u||l);if(n){if(typeof t.validation=="string"||t.validation===!0)throw new Error(JI.INVALID_VALIDATION_FILE_RANGE);u=!1,l=!1}let d=A=>{A&&(s?.agent&&s.agent.destroy(),a.destroy(A))},p=(A,g,b)=>{if(A){this.getBufferFromReadable(b).then(P=>{A.message=P.toString("utf8"),a.destroy(A)});return}s=b.request;let _=b.toJSON().headers,v=_["content-encoding"]==="gzip",O={},R=_["x-goog-stored-content-encoding"]==="gzip"&&v||_["x-goog-stored-content-encoding"]==="identity",w=[];if(c&&(typeof _["x-goog-hash"]=="string"&&_["x-goog-hash"].split(",").forEach(P=>{let z=P.indexOf("="),j=P.substring(0,z),U=P.substring(z+1);O[j]=U}),o=new mxt({crc32c:u,md5:l,crc32cGenerator:this.crc32cGenerator,crc32cExpected:O.crc32c,md5Expected:O.md5})),l&&!O.md5){let P=new FNe(JI.MD5_NOT_AVAILABLE);P.code="MD5_NOT_AVAILABLE",a.destroy(P);return}R&&c&&o&&w.push(o),v&&t.decompress&&w.push(KMi.createGunzip()),(0,zot.pipeline)(b,...w,a,d)},f=()=>{let A={alt:"media"};this.generation&&(A.generation=this.generation),t.userProject&&(A.userProject=t.userProject);let g={"Accept-Encoding":"gzip","Cache-Control":"no-store"};if(n){let _=typeof t.start=="number"?t.start:"0",v=typeof t.end=="number"?t.end:"";g.Range=`bytes=${i?v:`${_}-${v}`}`}let b={uri:"",headers:g,qs:A};t[jv]&&(b[jv]=t[jv]),this.requestStream(b).on("error",_=>{a.destroy(_)}).on("response",_=>{a.emit("response",_),jp.handleResp(null,_,null,p)}).resume()};return a.on("reading",f),a}createResumableUpload(t,n){var i,o;let s=typeof t=="object"?t:{};n=typeof t=="function"?t:n;let a=this.storage.retryOptions;(((i=s?.preconditionOpts)===null||i===void 0?void 0:i.ifGenerationMatch)===void 0&&((o=this.instancePreconditionOpts)===null||o===void 0?void 0:o.ifGenerationMatch)===void 0&&this.storage.retryOptions.idempotencyStrategy===n2.RetryConditional||this.storage.retryOptions.idempotencyStrategy===n2.RetryNever)&&(a.autoRetry=!1),rAd({authClient:this.storage.authClient,apiEndpoint:this.storage.apiEndpoint,bucket:this.bucket.name,customRequestOptions:this.getRequestInterceptors().reduce((u,l)=>l(u),{}),file:this.name,generation:this.generation,key:this.encryptionKey,kmsKeyName:this.kmsKeyName,metadata:s.metadata,offset:s.offset,origin:s.origin,predefinedAcl:s.predefinedAcl,private:s.private,public:s.public,userProject:s.userProject||this.userProject,retryOptions:a,params:s?.preconditionOpts||this.instancePreconditionOpts,universeDomain:this.bucket.storage.universeDomain,[jv]:s[jv]},n),this.storage.retryOptions.autoRetry=this.instanceRetryValue}createWriteStream(t={}){var n;if((n=t.metadata)!==null&&n!==void 0||(t.metadata={}),t.contentType&&(t.metadata.contentType=t.contentType),!t.metadata.contentType||t.metadata.contentType==="auto"){let A=hAd.default.getType(this.name);A&&(t.metadata.contentType=A)}let i=t.gzip;i==="auto"&&(i=(0,fAd.default)(t.metadata.contentType||"")),i&&(t.metadata.contentEncoding="gzip");let o=!0,s=!1;if(typeof t.validation=="string"?(t.validation=t.validation.toLowerCase(),o=t.validation==="crc32c",s=t.validation==="md5"):t.validation===!1&&(o=!1,s=!1),t.offset){if(s)throw new RangeError(JI.MD5_RESUMED_UPLOAD);if(o&&!t.isPartialUpload&&!t.resumeCRC32C)throw new RangeError(JI.MISSING_RESUME_CRC32C_FINAL_UPLOAD)}let a=A=>{u.destroy(A||void 0)},u=new zot.Writable({final(A){a=A,c.end()},write(A,g,b){c.write(A,g,b)}}),l=[];i&&l.push(KMi.createGzip());let c=new pxt,d=null;if(o||s){let A=t.resumeCRC32C?vEe.from(t.resumeCRC32C):void 0;d=new mxt({crc32c:o,crc32cInstance:A,md5:s,crc32cGenerator:this.crc32cGenerator,updateHashesOnly:!0}),l.push(d)}let p=(0,gAd.default)(),f=!1;return c.on("reading",()=>u.emit("reading")),c.on("writing",()=>u.emit("writing")),p.on("uri",A=>u.emit("uri",A)),p.on("progress",A=>u.emit("progress",A)),p.on("response",A=>u.emit("response",A)),p.once("metadata",()=>{f=!0}),u.once("writing",()=>{t.resumable===!1?this.startSimpleUpload_(p,t):this.startResumableUpload_(p,t),(0,zot.pipeline)(c,...l,p,async A=>{if(A)return a(A);if(!f)try{await new Promise((g,b)=>{p.once("metadata",g),p.once("error",b)})}catch(g){return a(g)}d?.crc32c&&u.emit("crc32c",d.crc32c);try{let g=t.isPartialUpload&&!this.metadata;d&&!g&&await ABm(this,Z0a,"m",dAd).call(this,d,{crc32c:o,md5:s}),a()}catch(g){a(g)}})}),u}delete(t,n){let i=typeof t=="object"?t:{};n=typeof t=="function"?t:n,this.disableAutoRetryConditionallyIdempotent_(this.methods.delete,zU.delete,i),super.delete(i).then(o=>n(null,...o)).catch(n).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}download(t,n){let i;typeof t=="function"?(n=t,i={}):i=t;let o=!1,s=(...c)=>{o||n(...c),o=!0},a=i.destination;delete i.destination;let u=this.createReadStream(i),l=!1;a?u.on("error",s).once("data",c=>{l=!0;let d=VMi.createWriteStream(a);d.write(c),u.pipe(d).on("error",s).on("finish",s)}).on("end",()=>{if(!l){let c=Buffer.alloc(0);try{VMi.writeFileSync(a,c),s(null,c)}catch(d){s(d,c)}}}):this.getBufferFromReadable(u).then(c=>s?.(null,c)).catch(s)}setEncryptionKey(t){return this.encryptionKey=t,this.encryptionKeyBase64=Buffer.from(t).toString("base64"),this.encryptionKeyHash=AAd.createHash("sha256").update(this.encryptionKeyBase64,"base64").digest("base64"),this.encryptionKeyInterceptor={request:n=>(n.headers=n.headers||{},n.headers["x-goog-encryption-algorithm"]="AES256",n.headers["x-goog-encryption-key"]=this.encryptionKeyBase64,n.headers["x-goog-encryption-key-sha256"]=this.encryptionKeyHash,n)},this.interceptors.push(this.encryptionKeyInterceptor),this}getExpirationDate(t){this.getMetadata((n,i,o)=>{if(n){t(n,null,o);return}if(!i.retentionExpirationTime){let s=new Error(JI.EXPIRATION_TIME_NA);t(s,null,o);return}t(null,new Date(i.retentionExpirationTime),o)})}generateSignedPostPolicyV2(t,n){let i=Xq(t,n),o=i.options,s=i.callback,a=new Date(o.expires);if(isNaN(a.getTime()))throw new Error(FZ.EXPIRATION_DATE_INVALID);if(a.valueOf()<Date.now())throw new Error(FZ.EXPIRATION_DATE_PAST);o=Object.assign({},o);let u=[["eq","$key",this.name],{bucket:this.bucket.name}];if(Array.isArray(o.equals)&&(Array.isArray(o.equals[0])||(o.equals=[o.equals]),o.equals.forEach(p=>{if(!Array.isArray(p)||p.length!==2)throw new Error(JI.EQUALS_CONDITION_TWO_ELEMENTS);u.push(["eq",p[0],p[1]])})),Array.isArray(o.startsWith)&&(Array.isArray(o.startsWith[0])||(o.startsWith=[o.startsWith]),o.startsWith.forEach(p=>{if(!Array.isArray(p)||p.length!==2)throw new Error(JI.STARTS_WITH_TWO_ELEMENTS);u.push(["starts-with",p[0],p[1]])})),o.acl&&u.push({acl:o.acl}),o.successRedirect&&u.push({success_action_redirect:o.successRedirect}),o.successStatus&&u.push({success_action_status:o.successStatus}),o.contentLengthRange){let p=o.contentLengthRange.min,f=o.contentLengthRange.max;if(typeof p!="number"||typeof f!="number")throw new Error(JI.CONTENT_LENGTH_RANGE_MIN_MAX);u.push(["content-length-range",p,f])}let l={expiration:a.toISOString(),conditions:u},c=JSON.stringify(l),d=Buffer.from(c).toString("base64");this.storage.authClient.sign(d,o.signingEndpoint).then(p=>{s(null,{string:c,base64:d,signature:p})},p=>{s(new zNe(p.message))})}generateSignedPostPolicyV4(t,n){let i=Xq(t,n),o=i.options,s=i.callback,a=new Date(o.expires);if(isNaN(a.getTime()))throw new Error(FZ.EXPIRATION_DATE_INVALID);if(a.valueOf()<Date.now())throw new Error(FZ.EXPIRATION_DATE_PAST);if(a.valueOf()-Date.now()>lAd*1e3)throw new Error(`Max allowed expiration is seven days (${lAd} seconds).`);o=Object.assign({},o);let u=Object.assign({},o.fields),l=new Date,c=kNe(l,!0),d=kNe(l);(async()=>{let{client_email:f}=await this.storage.authClient.getCredentials(),A=`${f}/${d}/auto/storage/goog4_request`;u={...u,bucket:this.bucket.name,key:this.name,"x-goog-date":c,"x-goog-credential":A,"x-goog-algorithm":"GOOG4-RSA-SHA256"};let g=o.conditions||[];Object.entries(u).forEach(([R,w])=>{R.startsWith("x-ignore-")||g.push({[R]:w})}),delete u.bucket;let b=kNe(a,!0,"-",":"),v=Ufd({conditions:g,expiration:b}),O=Buffer.from(v).toString("base64");try{let R=await this.storage.authClient.sign(O,o.signingEndpoint),w=Buffer.from(R,"base64").toString("hex"),P=this.parent.storage.universeDomain;u.policy=O,u["x-goog-signature"]=w;let z;return this.storage.customEndpoint?z=this.storage.apiEndpoint:o.virtualHostedStyle?z=`https://${this.bucket.name}.storage.${P}/`:o.bucketBoundHostname?z=`${o.bucketBoundHostname}/`:z=`https://storage.${P}/${this.bucket.name}/`,{url:z,fields:u}}catch(R){throw new zNe(R.message)}})().then(f=>s(null,f),s)}getSignedUrl(t,n){let i=efa[t.action],o=Qfd(t.extensionHeaders||{});t.action==="resumable"&&(o["x-goog-resumable"]="start");let s=Object.assign({},t.queryParams);typeof t.responseType=="string"&&(s["response-content-type"]=t.responseType),typeof t.promptSaveAs=="string"&&(s["response-content-disposition"]='attachment; filename="'+t.promptSaveAs+'"'),typeof t.responseDisposition=="string"&&(s["response-content-disposition"]=t.responseDisposition),this.generation&&(s.generation=this.generation.toString());let a={method:i,expires:t.expires,accessibleAt:t.accessibleAt,extensionHeaders:o,queryParams:s,contentMd5:t.contentMd5,contentType:t.contentType,host:t.host};t.cname&&(a.cname=t.cname),t.version&&(a.version=t.version),t.virtualHostedStyle&&(a.virtualHostedStyle=t.virtualHostedStyle),this.signer||(this.signer=new qot(this.storage.authClient,this.bucket,this,this.storage)),this.signer.getSignedUrl(a).then(u=>n(null,u),n)}isPublic(t){var n;let i=((n=this.storage)===null||n===void 0?void 0:n.interceptors)||[],o=this.interceptors||[],a=i.concat(o).reduce((u,l)=>{let c=l.request({uri:`${this.storage.apiEndpoint}/${this.bucket.name}/${encodeURIComponent(this.name)}`});return Object.assign(u,c.headers),u},{});jp.makeRequest({method:"GET",uri:`${this.storage.apiEndpoint}/${this.bucket.name}/${encodeURIComponent(this.name)}`,headers:a},{retryOptions:this.storage.retryOptions},u=>{u?u.code===403?t(null,!1):t(u):t(null,!0)})}makePrivate(t,n){var i,o;let s=typeof t=="object"?t:{};n=typeof t=="function"?t:n;let a={predefinedAcl:s.strict?"private":"projectPrivate"};((i=s.preconditionOpts)===null||i===void 0?void 0:i.ifMetagenerationMatch)!==void 0&&(a.ifMetagenerationMatch=(o=s.preconditionOpts)===null||o===void 0?void 0:o.ifMetagenerationMatch,delete s.preconditionOpts),s.userProject&&(a.userProject=s.userProject);let u={...s.metadata,acl:null};this.setMetadata(u,a,n)}makePublic(t){t=t||jp.noop,this.acl.add({entity:"allUsers",role:"READER"},(n,i,o)=>{t(n,o)})}publicUrl(){return`${this.storage.apiEndpoint}/${this.bucket.name}/${encodeURIComponent(this.name)}`}move(t,n,i){let o=typeof n=="object"?n:{};i=typeof n=="function"?n:i,i=i||jp.noop,this.copy(t,o,(s,a,u)=>{if(s){s.message="file#copy failed with an error - "+s.message,i(s,null,u);return}this.name!==a.name||this.bucket.name!==a.bucket.name?this.delete(o,(l,c)=>{if(l){l.message="file#delete failed with an error - "+l.message,i(l,a,c);return}i(null,a,u)}):i(null,a,u)})}rename(t,n,i){let o=typeof n=="object"?n:{};i=typeof n=="function"?n:i,i=i||jp.noop,this.move(t,o,i)}request(t,n){return this.parent.request.call(this,t,n)}rotateEncryptionKey(t,n){var i;n=typeof t=="function"?t:n;let o={};typeof t=="string"||t instanceof Buffer?o={encryptionKey:t}:typeof t=="object"&&(o=t);let s=this.bucket.file(this.id,o),a=((i=o.preconditionOpts)===null||i===void 0?void 0:i.ifGenerationMatch)!==void 0?{preconditionOpts:o.preconditionOpts}:{};this.copy(s,a,n)}save(t,n,i){i=typeof n=="function"?n:i;let o=typeof n=="object"?n:{},s=this.storage.retryOptions.maxRetries;this.shouldRetryBasedOnPreconditionAndIdempotencyStrat(o?.preconditionOpts)||(s=0);let a=(0,mAd.default)(async u=>new Promise((l,c)=>{s===0&&(this.storage.retryOptions.autoRetry=!1);let d=this.createWriteStream(o);o.onUploadProgress&&d.on("progress",o.onUploadProgress);let p=f=>this.storage.retryOptions.autoRetry&&this.storage.retryOptions.retryableErrorFn(f)?c(f):u(f);typeof t=="string"||Buffer.isBuffer(t)?d.on("error",p).on("finish",()=>l()).end(t):(0,zot.pipeline)(t,d,f=>{if(f){if(typeof t!="function")return u(f);p(f)}else l()})}),{retries:s,factor:this.storage.retryOptions.retryDelayMultiplier,maxTimeout:this.storage.retryOptions.maxRetryDelay*1e3,maxRetryTime:this.storage.retryOptions.totalTimeout*1e3});return i?a.then(()=>{if(i)return i()}).catch(i):a}setMetadata(t,n,i){let o=typeof n=="object"?n:{};i=typeof n=="function"?n:i,this.disableAutoRetryConditionallyIdempotent_(this.methods.setMetadata,zU.setMetadata,o),super.setMetadata(t,o).then(s=>i(null,...s)).catch(i).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}setStorageClass(t,n,i){i=typeof n=="function"?n:i;let s={...typeof n=="object"?n:{},storageClass:t.replace(/-/g,"_").replace(/([a-z])([A-Z])/g,(a,u,l)=>u+"_"+l).toUpperCase()};this.copy(this,s,(a,u,l)=>{if(a){i(a,l);return}this.metadata=u.metadata,i(null,l)})}setUserProject(t){this.bucket.setUserProject.call(this,t)}startResumableUpload_(t,n={}){var i;(i=n.metadata)!==null&&i!==void 0||(n.metadata={});let o=this.storage.retryOptions;this.shouldRetryBasedOnPreconditionAndIdempotencyStrat(n.preconditionOpts)||(o.autoRetry=!1);let s=tAd({authClient:this.storage.authClient,apiEndpoint:this.storage.apiEndpoint,bucket:this.bucket.name,customRequestOptions:this.getRequestInterceptors().reduce((a,u)=>u(a),{}),file:this.name,generation:this.generation,isPartialUpload:n.isPartialUpload,key:this.encryptionKey,kmsKeyName:this.kmsKeyName,metadata:n.metadata,offset:n.offset,predefinedAcl:n.predefinedAcl,private:n.private,public:n.public,uri:n.uri,userProject:n.userProject||this.userProject,retryOptions:{...o},params:n?.preconditionOpts||this.instancePreconditionOpts,chunkSize:n?.chunkSize,highWaterMark:n?.highWaterMark,universeDomain:this.bucket.storage.universeDomain,[jv]:n[jv]});s.on("response",a=>{t.emit("response",a)}).on("uri",a=>{t.emit("uri",a)}).on("metadata",a=>{this.metadata=a,t.emit("metadata")}).on("finish",()=>{t.emit("complete")}).on("progress",a=>t.emit("progress",a)),t.setWritable(s),this.storage.retryOptions.autoRetry=this.instanceRetryValue}startSimpleUpload_(t,n={}){var i;(i=n.metadata)!==null&&i!==void 0||(n.metadata={});let o=this.storage.apiEndpoint,s=this.bucket.name,a=`${o}/upload/storage/v1/b/${s}/o`,u={qs:{name:this.name},uri:a,[jv]:n[jv]};this.generation!==void 0&&(u.qs.ifGenerationMatch=this.generation),this.kmsKeyName!==void 0&&(u.qs.kmsKeyName=this.kmsKeyName),typeof n.timeout=="number"&&(u.timeout=n.timeout),(n.userProject||this.userProject)&&(u.qs.userProject=n.userProject||this.userProject),n.predefinedAcl?u.qs.predefinedAcl=n.predefinedAcl:n.private?u.qs.predefinedAcl="private":n.public&&(u.qs.predefinedAcl="publicRead"),Object.assign(u.qs,this.instancePreconditionOpts,n.preconditionOpts),jp.makeWritableStream(t,{makeAuthenticatedRequest:l=>{this.request(l,(c,d,p)=>{if(c){t.destroy(c);return}this.metadata=d,t.emit("metadata",d),t.emit("response",p),t.emit("complete")})},metadata:n.metadata,request:u})}disableAutoRetryConditionallyIdempotent_(t,n,i){var o,s,a,u;(typeof t=="object"&&((s=(o=t?.reqOpts)===null||o===void 0?void 0:o.qs)===null||s===void 0?void 0:s.ifGenerationMatch)===void 0&&i?.ifGenerationMatch===void 0&&n===zU.delete&&this.storage.retryOptions.idempotencyStrategy===n2.RetryConditional||this.storage.retryOptions.idempotencyStrategy===n2.RetryNever)&&(this.storage.retryOptions.autoRetry=!1),(typeof t=="object"&&((u=(a=t?.reqOpts)===null||a===void 0?void 0:a.qs)===null||u===void 0?void 0:u.ifMetagenerationMatch)===void 0&&i?.ifMetagenerationMatch===void 0&&n===zU.setMetadata&&this.storage.retryOptions.idempotencyStrategy===n2.RetryConditional||this.storage.retryOptions.idempotencyStrategy===n2.RetryNever)&&(this.storage.retryOptions.autoRetry=!1)}async getBufferFromReadable(t){let n=[];for await(let i of t)n.push(i);return Buffer.concat(n)}};Z0a=new WeakSet,dAd=async function(t,n={}){let i=this.metadata,o=!!(n.crc32c||n.md5);if(n.crc32c&&i.crc32c&&(o=!t.test("crc32c",i.crc32c)),n.md5&&i.md5Hash&&(o=!t.test("md5",i.md5Hash)),o){let s=[],a="",u="";try{await this.delete(),n.md5&&!i.md5Hash?(a="MD5_NOT_AVAILABLE",u=JI.MD5_NOT_AVAILABLE):(a="FILE_NO_UPLOAD",u=JI.UPLOAD_MISMATCH)}catch(c){let d=c;a="FILE_NO_UPLOAD_DELETE",u=`${JI.UPLOAD_MISMATCH_DELETE_FAIL}${d.message}`,s.push(d)}let l=new FNe(u);throw l.code=a,l.errors=s,l}return!0};(0,pAd.promisifyAll)(QZ,{exclude:["cloudStorageURI","publicUrl","request","save","setEncryptionKey","shouldRetryBasedOnPreconditionAndIdempotencyStrat","getBufferFromReadable"]});var yAd=_t(Xg(),1);var YMi;(function(r){r.POLICY_OBJECT_REQUIRED="A policy object is required.",r.PERMISSIONS_REQUIRED="Permissions are required."})(YMi||(YMi={}));var Fot=class{constructor(t){this.request_=t.request.bind(t),this.resourceId_="buckets/"+t.getId()}getPolicy(t,n){let{options:i,callback:o}=Xq(t,n),s={};i.userProject&&(s.userProject=i.userProject),i.requestedPolicyVersion!==null&&i.requestedPolicyVersion!==void 0&&(s.optionsRequestedPolicyVersion=i.requestedPolicyVersion),this.request_({uri:"/iam",qs:s},o)}setPolicy(t,n,i){if(t===null||typeof t!="object")throw new Error(YMi.POLICY_OBJECT_REQUIRED);let{options:o,callback:s}=Xq(n,i),a;t.etag===void 0&&(a=0),this.request_({method:"PUT",uri:"/iam",maxRetries:a,json:Object.assign({resourceId:this.resourceId_},t),qs:o},s)}testPermissions(t,n,i){if(!Array.isArray(t)&&typeof t!="string")throw new Error(YMi.PERMISSIONS_REQUIRED);let{options:o,callback:s}=Xq(n,i),a=Array.isArray(t)?t:[t],u=Object.assign({permissions:a},o);this.request_({uri:"/iam/testPermissions",qs:u,useQuerystring:!0},(l,c)=>{if(l){s(l,null,c);return}let d=Array.isArray(c.permissions)?c.permissions:[],p=a.reduce((f,A)=>(f[A]=d.indexOf(A)>-1,f),{});s(null,p,c)})}};(0,yAd.promisifyAll)(Fot);var bAd=_t(Xg(),1),Qot=class extends rx{constructor(t,n){let i={},o={create:!0,delete:{reqOpts:{qs:i}},get:{reqOpts:{qs:i}},getMetadata:{reqOpts:{qs:i}},exists:!0};super({parent:t,baseUrl:"/notificationConfigs",id:n.toString(),createMethod:t.createNotification.bind(t),methods:o})}};(0,bAd.promisifyAll)(Qot);var TAd=require("stream"),IAd=require("url"),nfa;(function(r){r.list="GET"})(nfa||(nfa={}));var zU;(function(r){r[r.setMetadata=0]="setMetadata",r[r.delete=1]="delete"})(zU||(zU={}));var jZ;(function(r){r.PROVIDE_SOURCE_FILE="You must provide at least one source file.",r.DESTINATION_FILE_NOT_SPECIFIED="A destination file must be specified.",r.CHANNEL_ID_REQUIRED="An ID is required to create a channel.",r.TOPIC_NAME_REQUIRED="A valid topic name is required.",r.CONFIGURATION_OBJECT_PREFIX_REQUIRED="A configuration object with a prefix is required.",r.SPECIFY_FILE_NAME="A file name must be specified.",r.METAGENERATION_NOT_PROVIDED="A metageneration must be provided.",r.SUPPLY_NOTIFICATION_ID="You must supply a notification ID."})(jZ||(jZ={}));var UZ=class r extends rx{getFilesStream(t){return new TAd.Readable}constructor(t,n,i){var o,s,a,u;i=i||{},n=n.replace(/^gs:\/\//,"").replace(/\/+$/,"");let l={};!((o=i?.preconditionOpts)===null||o===void 0)&&o.ifGenerationMatch&&(l.ifGenerationMatch=i.preconditionOpts.ifGenerationMatch),!((s=i?.preconditionOpts)===null||s===void 0)&&s.ifGenerationNotMatch&&(l.ifGenerationNotMatch=i.preconditionOpts.ifGenerationNotMatch),!((a=i?.preconditionOpts)===null||a===void 0)&&a.ifMetagenerationMatch&&(l.ifMetagenerationMatch=i.preconditionOpts.ifMetagenerationMatch),!((u=i?.preconditionOpts)===null||u===void 0)&&u.ifMetagenerationNotMatch&&(l.ifMetagenerationNotMatch=i.preconditionOpts.ifMetagenerationNotMatch);let c=i.userProject;typeof c=="string"&&(l.userProject=c);let d={create:{reqOpts:{qs:l}},delete:{reqOpts:{qs:l}},exists:{reqOpts:{qs:l}},get:{reqOpts:{qs:l}},getMetadata:{reqOpts:{qs:l}},setMetadata:{reqOpts:{qs:l}}};super({parent:t,baseUrl:"/b",id:n,createMethod:t.createBucket.bind(t),methods:d}),this.name=n,this.storage=t,this.userProject=i.userProject,this.acl=new SEe({request:this.request.bind(this),pathPrefix:"/acl"}),this.acl.default=new SEe({request:this.request.bind(this),pathPrefix:"/defaultObjectAcl"}),this.crc32cGenerator=i.crc32cGenerator||this.storage.crc32cGenerator,this.iam=new Fot(this),this.getFilesStream=ifa.paginator.streamify("getFiles"),this.instanceRetryValue=t.retryOptions.autoRetry,this.instancePreconditionOpts=i?.preconditionOpts}get cloudStorageURI(){let t=new IAd.URL("gs://");return t.host=this.name,t}addLifecycleRule(t,n,i){let o={};typeof n=="function"?i=n:n&&(o=n),o=o||{};let s=Array.isArray(t)?t:[t];for(let a of s)a.condition.createdBefore instanceof Date&&(a.condition.createdBefore=a.condition.createdBefore.toISOString().replace(/T.+$/,"")),a.condition.customTimeBefore instanceof Date&&(a.condition.customTimeBefore=a.condition.customTimeBefore.toISOString().replace(/T.+$/,"")),a.condition.noncurrentTimeBefore instanceof Date&&(a.condition.noncurrentTimeBefore=a.condition.noncurrentTimeBefore.toISOString().replace(/T.+$/,""));if(o.append===!1){this.setMetadata({lifecycle:{rule:s}},o,i);return}this.getMetadata((a,u)=>{var l,c;if(a){i(a);return}let d=Array.isArray((l=u.lifecycle)===null||l===void 0?void 0:l.rule)?(c=u.lifecycle)===null||c===void 0?void 0:c.rule:[];this.setMetadata({lifecycle:{rule:d.concat(s)}},o,i)})}combine(t,n,i,o){var s;if(!Array.isArray(t)||t.length===0)throw new Error(jZ.PROVIDE_SOURCE_FILE);if(!n)throw new Error(jZ.DESTINATION_FILE_NOT_SPECIFIED);let a={};typeof i=="function"?o=i:i&&(a=i),this.disableAutoRetryConditionallyIdempotent_(this.methods.setMetadata,zU.setMetadata,a);let u=d=>d instanceof QZ?d:this.file(d);t=t.map(u);let l=u(n);if(o=o||jp.noop,!l.metadata.contentType){let d=SAd.contentType(l.name);d&&(l.metadata.contentType=d)}let c=this.storage.retryOptions.maxRetries;(((s=l?.instancePreconditionOpts)===null||s===void 0?void 0:s.ifGenerationMatch)===void 0&&a.ifGenerationMatch===void 0&&this.storage.retryOptions.idempotencyStrategy===n2.RetryConditional||this.storage.retryOptions.idempotencyStrategy===n2.RetryNever)&&(c=0),a.ifGenerationMatch===void 0&&Object.assign(a,l.instancePreconditionOpts,a),l.request({method:"POST",uri:"/compose",maxRetries:c,json:{destination:{contentType:l.metadata.contentType},sourceObjects:t.map(d=>{let p={name:d.name};return d.metadata&&d.metadata.generation&&(p.generation=parseInt(d.metadata.generation.toString())),p})},qs:a},(d,p)=>{if(this.storage.retryOptions.autoRetry=this.instanceRetryValue,d){o(d,null,p);return}o(null,l,p)})}createChannel(t,n,i,o){if(typeof t!="string")throw new Error(jZ.CHANNEL_ID_REQUIRED);let s={};typeof i=="function"?o=i:i&&(s=i),this.request({method:"POST",uri:"/o/watch",json:Object.assign({id:t,type:"web_hook"},n),qs:s},(a,u)=>{if(a){o(a,null,u);return}let l=u.resourceId,c=this.storage.channel(t,l);c.metadata=u,o(null,c,u)})}createNotification(t,n,i){let o={};if(typeof n=="function"?i=n:n&&(o=n),t!==null&&typeof t=="object"&&jp.isCustomType(t,"pubsub/topic")&&(t=t.name),typeof t!="string")throw new Error(jZ.TOPIC_NAME_REQUIRED);let a=Object.assign({topic:t},o);a.topic.indexOf("projects")!==0&&(a.topic="projects/{{projectId}}/topics/"+a.topic),a.topic=`//pubsub.${this.storage.universeDomain}/`+a.topic,a.payloadFormat||(a.payloadFormat="JSON_API_V1");let u={};a.userProject&&(u.userProject=a.userProject,delete a.userProject),this.request({method:"POST",uri:"/notificationConfigs",json:LMi(a),qs:u,maxRetries:0},(l,c)=>{if(l){i(l,null,c);return}let d=this.notification(c.id);d.metadata=c,i(null,d,c)})}deleteFiles(t,n){let i={};typeof t=="function"?n=t:t&&(i=t);let o=10,s=1e3,a=[],u=l=>l.delete(i).catch(c=>{if(!i.force)throw c;a.push(c)});(async()=>{try{let l=[],c=(0,tfa.default)(o),d=this.getFilesStream(i);for await(let p of d)l.length>=s&&(await Promise.all(l),l=[]),l.push(c(()=>u(p)).catch(f=>{throw d.destroy(),f}));await Promise.all(l),n(a.length>0?a:null)}catch(l){n(l);return}})()}deleteLabels(t,n,i){let o=new Array,s={};typeof t=="function"?i=t:typeof t=="string"?o=[t]:Array.isArray(t)?o=t:t&&(s=t),typeof n=="function"?i=n:n&&(s=n);let a=u=>{let l=u.reduce((c,d)=>(c[d]=null,c),{});s?.ifMetagenerationMatch!==void 0?this.setLabels(l,s,i):this.setLabels(l,i)};o.length===0?this.getLabels((u,l)=>{if(u){i(u);return}a(Object.keys(l))}):a(o)}disableRequesterPays(t,n){let i={};typeof t=="function"?n=t:t&&(i=t),this.setMetadata({billing:{requesterPays:!1}},i,n)}enableLogging(t,n){if(!t||typeof t=="function"||typeof t.prefix>"u")throw new Error(jZ.CONFIGURATION_OBJECT_PREFIX_REQUIRED);let i=this.id;t.bucket&&t.bucket instanceof r?i=t.bucket.id:t.bucket&&typeof t.bucket=="string"&&(i=t.bucket);let o={};t?.ifMetagenerationMatch&&(o.ifMetagenerationMatch=t.ifMetagenerationMatch),t?.ifMetagenerationNotMatch&&(o.ifMetagenerationNotMatch=t.ifMetagenerationNotMatch),(async()=>{try{let[s]=await this.iam.getPolicy();s.bindings.push({members:["group:cloud-storage-analytics@google.com"],role:"roles/storage.objectCreator"}),await this.iam.setPolicy(s),this.setMetadata({logging:{logBucket:i,logObjectPrefix:t.prefix}},o,n)}catch(s){n(s);return}})()}enableRequesterPays(t,n){let i={};typeof t=="function"?n=t:t&&(i=t),this.setMetadata({billing:{requesterPays:!0}},i,n)}file(t,n){if(!t)throw Error(jZ.SPECIFY_FILE_NAME);return new QZ(this,t,n)}getFiles(t,n){let i=typeof t=="object"?t:{};n||(n=t),i=Object.assign({},i),this.request({uri:"/o",qs:i},(o,s)=>{if(o){n(o,null,null,s);return}let u=(s.items?s.items:[]).map(c=>{let d={};i.versions&&(d.generation=c.generation),c.kmsKeyName&&(d.kmsKeyName=c.kmsKeyName);let p=this.file(c.name,d);return p.metadata=c,p}),l=null;s.nextPageToken&&(l=Object.assign({},i,{pageToken:s.nextPageToken})),n(null,u,l,s)})}getLabels(t,n){let i={};typeof t=="function"?n=t:t&&(i=t),this.getMetadata(i,(o,s)=>{if(o){n(o,null);return}n(null,s?.labels||{})})}getNotifications(t,n){let i={};typeof t=="function"?n=t:t&&(i=t),this.request({uri:"/notificationConfigs",qs:i},(o,s)=>{if(o){n(o,null,s);return}let u=(s.items?s.items:[]).map(l=>{let c=this.notification(l.id);return c.metadata=l,c});n(null,u,s)})}getSignedUrl(t,n){let o={method:nfa[t.action],expires:t.expires,version:t.version,cname:t.cname,extensionHeaders:t.extensionHeaders||{},queryParams:t.queryParams||{},host:t.host,signingEndpoint:t.signingEndpoint};this.signer||(this.signer=new qot(this.storage.authClient,this,void 0,this.storage)),this.signer.getSignedUrl(o).then(s=>n(null,s),n)}lock(t,n){let i=typeof t;if(i!=="number"&&i!=="string")throw new Error(jZ.METAGENERATION_NOT_PROVIDED);this.request({method:"POST",uri:"/lockRetentionPolicy",qs:{ifMetagenerationMatch:t}},n)}makePrivate(t,n){var i,o,s,a;let u=typeof t=="object"?t:{};n=typeof t=="function"?t:n,u.private=!0;let l={predefinedAcl:"projectPrivate"};u.userProject&&(l.userProject=u.userProject),!((i=u.preconditionOpts)===null||i===void 0)&&i.ifGenerationMatch&&(l.ifGenerationMatch=u.preconditionOpts.ifGenerationMatch),!((o=u.preconditionOpts)===null||o===void 0)&&o.ifGenerationNotMatch&&(l.ifGenerationNotMatch=u.preconditionOpts.ifGenerationNotMatch),!((s=u.preconditionOpts)===null||s===void 0)&&s.ifMetagenerationMatch&&(l.ifMetagenerationMatch=u.preconditionOpts.ifMetagenerationMatch),!((a=u.preconditionOpts)===null||a===void 0)&&a.ifMetagenerationNotMatch&&(l.ifMetagenerationNotMatch=u.preconditionOpts.ifMetagenerationNotMatch);let c={...u.metadata,acl:null};this.setMetadata(c,l,d=>{d&&n(d),(u.includeFiles?(0,rfa.promisify)(this.makeAllFilesPublicPrivate_).call(this,u):Promise.resolve([])).then(f=>n(null,f)).catch(n)})}makePublic(t,n){let i=typeof t=="object"?t:{};n=typeof t=="function"?t:n;let o={public:!0,...i};this.acl.add({entity:"allUsers",role:"READER"}).then(()=>this.acl.default.add({entity:"allUsers",role:"READER"})).then(()=>o.includeFiles?(0,rfa.promisify)(this.makeAllFilesPublicPrivate_).call(this,o):[]).then(s=>n(null,s),n)}notification(t){if(!t)throw new Error(jZ.SUPPLY_NOTIFICATION_ID);return new Qot(this,t)}removeRetentionPeriod(t,n){let i=typeof t=="object"?t:{};n=typeof t=="function"?t:n,this.setMetadata({retentionPolicy:null},i,n)}request(t,n){return this.userProject&&(!t.qs||!t.qs.userProject)&&(t.qs={...t.qs,userProject:this.userProject}),super.request(t,n)}setLabels(t,n,i){let o=typeof n=="object"?n:{};i=typeof n=="function"?n:i,i=i||jp.noop,this.setMetadata({labels:t},o,i)}setMetadata(t,n,i){let o=typeof n=="object"?n:{};i=typeof n=="function"?n:i,this.disableAutoRetryConditionallyIdempotent_(this.methods.setMetadata,zU.setMetadata,o),super.setMetadata(t,o).then(s=>i(null,...s)).catch(i).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}setRetentionPeriod(t,n,i){let o=typeof n=="object"?n:{};i=typeof n=="function"?n:i,this.setMetadata({retentionPolicy:{retentionPeriod:t.toString()}},o,i)}setCorsConfiguration(t,n,i){let o=typeof n=="object"?n:{};i=typeof n=="function"?n:i,this.setMetadata({cors:t},o,i)}setStorageClass(t,n,i){let o=typeof n=="object"?n:{};i=typeof n=="function"?n:i,t=t.replace(/-/g,"_").replace(/([a-z])([A-Z])/g,(s,a,u)=>a+"_"+u).toUpperCase(),this.setMetadata({storageClass:t},o,i)}setUserProject(t){this.userProject=t,["create","delete","exists","get","getMetadata","setMetadata"].forEach(i=>{let o=this.methods[i];typeof o=="object"&&(typeof o.reqOpts=="object"?Object.assign(o.reqOpts.qs,{userProject:t}):o.reqOpts={qs:{userProject:t}})})}upload(t,n,i){var o,s;let a=d=>{let p=(0,vAd.default)(async f=>{await new Promise((A,g)=>{var b,_;d===0&&(!((_=(b=c?.storage)===null||b===void 0?void 0:b.retryOptions)===null||_===void 0)&&_.autoRetry)&&(c.storage.retryOptions.autoRetry=!1);let v=c.createWriteStream(u);u.onUploadProgress&&v.on("progress",u.onUploadProgress),CAd.createReadStream(t).on("error",f).pipe(v).on("error",O=>this.storage.retryOptions.autoRetry&&this.storage.retryOptions.retryableErrorFn(O)?g(O):f(O)).on("finish",()=>A())})},{retries:d,factor:this.storage.retryOptions.retryDelayMultiplier,maxTimeout:this.storage.retryOptions.maxRetryDelay*1e3,maxRetryTime:this.storage.retryOptions.totalTimeout*1e3});return i?p.then(()=>{if(i)return i(null,c,c.metadata)}).catch(i):p};if(global.GCLOUD_SANDBOX_ENV)return;let u=typeof n=="object"?n:{};i=typeof n=="function"?n:i,u=Object.assign({metadata:{}},u);let l=this.storage.retryOptions.maxRetries;(((o=u?.preconditionOpts)===null||o===void 0?void 0:o.ifGenerationMatch)===void 0&&((s=this.instancePreconditionOpts)===null||s===void 0?void 0:s.ifGenerationMatch)===void 0&&this.storage.retryOptions.idempotencyStrategy===n2.RetryConditional||this.storage.retryOptions.idempotencyStrategy===n2.RetryNever)&&(l=0);let c;if(u.destination instanceof QZ)c=u.destination;else if(u.destination!==null&&typeof u.destination=="string")c=this.file(u.destination,{encryptionKey:u.encryptionKey,kmsKeyName:u.kmsKeyName,preconditionOpts:this.instancePreconditionOpts});else{let d=_Ad.basename(t);c=this.file(d,{encryptionKey:u.encryptionKey,kmsKeyName:u.kmsKeyName,preconditionOpts:this.instancePreconditionOpts})}a(l)}makeAllFilesPublicPrivate_(t,n){let o=[],s=[],a=typeof t=="object"?t:{};n=typeof t=="function"?t:n;let u=async l=>{try{await(a.public?l.makePublic():l.makePrivate(a)),s.push(l)}catch(c){if(!a.force)throw c;o.push(c)}};this.getFiles(a).then(([l])=>{let c=(0,tfa.default)(10),d=l.map(p=>c(()=>u(p)));return Promise.all(d)}).then(()=>n(o.length>0?o:null,s),l=>n(l,s))}getId(){return this.id}disableAutoRetryConditionallyIdempotent_(t,n,i){var o,s;typeof t=="object"&&((s=(o=t?.reqOpts)===null||o===void 0?void 0:o.qs)===null||s===void 0?void 0:s.ifMetagenerationMatch)===void 0&&i?.ifMetagenerationMatch===void 0&&(n===zU.setMetadata||n===zU.delete)&&this.storage.retryOptions.idempotencyStrategy===n2.RetryConditional?this.storage.retryOptions.autoRetry=!1:this.storage.retryOptions.idempotencyStrategy===n2.RetryNever&&(this.storage.retryOptions.autoRetry=!1)}};ifa.paginator.extend(UZ,"getFiles");(0,EAd.promisifyAll)(UZ,{exclude:["cloudStorageURI","request","file","notification"]});var OAd=_t(Xg(),1),QNe=class extends rx{constructor(t,n,i){let o={parent:t,baseUrl:"/channels",id:"",methods:{}};super(o),this.metadata.id=n,this.metadata.resourceId=i}stop(t){t=t||jp.noop,this.request({method:"POST",uri:"/stop",json:this.metadata},(n,i)=>{t(n,i)})}};(0,OAd.promisifyAll)(QNe);var wAd=_t(Bot(),1);var RAd=_t(Xg(),1),UNe=class extends rx{constructor(t,n,i){let o={delete:!0,get:!0,getMetadata:!0,setMetadata:{reqOpts:{method:"PUT"}}},s=i&&i.projectId||t.projectId;super({parent:t,id:n,baseUrl:`/projects/${s}/hmacKeys`,methods:o}),this.storage=t,this.instanceRetryValue=t.retryOptions.autoRetry}setMetadata(t,n,i){this.storage.retryOptions.idempotencyStrategy!==n2.RetryAlways&&(this.storage.retryOptions.autoRetry=!1);let o=typeof n=="object"?n:{};i=typeof n=="function"?n:i,super.setMetadata(t,o).then(s=>i(null,...s)).catch(i).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}};(0,RAd.promisifyAll)(UNe);var PAd=_t(JN(),1),n2;(function(r){r[r.RetryAlways=0]="RetryAlways",r[r.RetryConditional=1]="RetryConditional",r[r.RetryNever=2]="RetryNever"})(n2||(n2={}));var FZ;(function(r){r.EXPIRATION_DATE_INVALID="The expiration date provided was invalid.",r.EXPIRATION_DATE_PAST="An expiration date cannot be in the past."})(FZ||(FZ={}));var Uot;(function(r){r.BUCKET_NAME_REQUIRED="A bucket name is needed to use Cloud Storage.",r.BUCKET_NAME_REQUIRED_CREATE="A name is required to create a bucket.",r.HMAC_SERVICE_ACCOUNT="The first argument must be a service account email to create an HMAC key.",r.HMAC_ACCESS_ID="An access ID is needed to create an HmacKey object."})(Uot||(Uot={}));var gBm=/^(\w*):\/\//,mBm=!0,yBm=3,bBm=2,EBm=600,CBm=64,SBm=n2.RetryConditional,_Bm=function(r){var t;let n=i=>i.includes("eai_again")||i==="econnreset"||i==="unexpected connection closure"||i==="epipe"||i==="socket connection timeout";if(r){if([408,429,500,502,503,504].indexOf(r.code)!==-1)return!0;if(typeof r.code=="string"){if(["408","429","500","502","503","504"].indexOf(r.code)!==-1)return!0;let i=r.code.toLowerCase();if(n(i))return!0}if(r.errors)for(let i of r.errors){let o=(t=i?.reason)===null||t===void 0?void 0:t.toString().toLowerCase();if(o&&n(o))return!0}}return!1};var Zq=class r extends Axt{getBucketsStream(){return new ofa.Readable}getHmacKeysStream(){return new ofa.Readable}constructor(t={}){var n,i,o,s,a,u,l,c,d,p,f,A,g,b;let v=`https://storage.${t.universeDomain||PAd.DEFAULT_UNIVERSE}`,O=!1,R=process.env.STORAGE_EMULATOR_HOST;typeof R=="string"&&(v=r.sanitizeEndpoint(R),O=!0),t.apiEndpoint&&(v=r.sanitizeEndpoint(t.apiEndpoint),O=!0),t=Object.assign({},t,{apiEndpoint:v});let w=R||`${t.apiEndpoint}/storage/v1`,P={apiEndpoint:t.apiEndpoint,retryOptions:{autoRetry:((n=t.retryOptions)===null||n===void 0?void 0:n.autoRetry)!==void 0?(i=t.retryOptions)===null||i===void 0?void 0:i.autoRetry:mBm,maxRetries:!((o=t.retryOptions)===null||o===void 0)&&o.maxRetries?(s=t.retryOptions)===null||s===void 0?void 0:s.maxRetries:yBm,retryDelayMultiplier:!((a=t.retryOptions)===null||a===void 0)&&a.retryDelayMultiplier?(u=t.retryOptions)===null||u===void 0?void 0:u.retryDelayMultiplier:bBm,totalTimeout:!((l=t.retryOptions)===null||l===void 0)&&l.totalTimeout?(c=t.retryOptions)===null||c===void 0?void 0:c.totalTimeout:EBm,maxRetryDelay:!((d=t.retryOptions)===null||d===void 0)&&d.maxRetryDelay?(p=t.retryOptions)===null||p===void 0?void 0:p.maxRetryDelay:CBm,retryableErrorFn:!((f=t.retryOptions)===null||f===void 0)&&f.retryableErrorFn?(A=t.retryOptions)===null||A===void 0?void 0:A.retryableErrorFn:_Bm,idempotencyStrategy:((g=t.retryOptions)===null||g===void 0?void 0:g.idempotencyStrategy)!==void 0?(b=t.retryOptions)===null||b===void 0?void 0:b.idempotencyStrategy:SBm},baseUrl:w,customEndpoint:O,useAuthWithCustomEndpoint:t?.useAuthWithCustomEndpoint,projectIdRequired:!1,scopes:["https://www.googleapis.com/auth/iam","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/devstorage.full_control"],packageJson:(0,wAd.getPackageJSON)()};super(P,t),this.acl=r.acl,this.crc32cGenerator=t.crc32cGenerator||GMi,this.retryOptions=P.retryOptions,this.getBucketsStream=JMi.paginator.streamify("getBuckets"),this.getHmacKeysStream=JMi.paginator.streamify("getHmacKeys")}static sanitizeEndpoint(t){return gBm.test(t)||(t=`https://${t}`),t.replace(/\/+$/,"")}bucket(t,n){if(!t)throw new Error(Uot.BUCKET_NAME_REQUIRED);return new UZ(this,t,n)}channel(t,n){return new QNe(this,t,n)}createBucket(t,n,i){if(!t)throw new Error(Uot.BUCKET_NAME_REQUIRED_CREATE);let o;i?o=n:(i=n,o={});let s={...o,name:t},a={archive:"ARCHIVE",coldline:"COLDLINE",dra:"DURABLE_REDUCED_AVAILABILITY",multiRegional:"MULTI_REGIONAL",nearline:"NEARLINE",regional:"REGIONAL",standard:"STANDARD"},u=Object.keys(a);for(let c of u)if(s[c]){if(o.storageClass&&o.storageClass!==c)throw new Error(`Both \`${c}\` and \`storageClass\` were provided.`);s.storageClass=a[c],delete s[c]}s.requesterPays&&(s.billing={requesterPays:s.requesterPays},delete s.requesterPays);let l={project:this.projectId};s.userProject&&(l.userProject=s.userProject,delete s.userProject),s.enableObjectRetention&&(l.enableObjectRetention=s.enableObjectRetention,delete s.enableObjectRetention),this.request({method:"POST",uri:"/b",qs:l,json:s},(c,d)=>{if(c){i(c,null,d);return}let p=this.bucket(t);p.metadata=d,i(null,p,d)})}createHmacKey(t,n,i){if(typeof t!="string")throw new Error(Uot.HMAC_SERVICE_ACCOUNT);let{options:o,callback:s}=Xq(n,i),a=Object.assign({},o,{serviceAccountEmail:t}),u=a.projectId||this.projectId;delete a.projectId,this.request({method:"POST",uri:`/projects/${u}/hmacKeys`,qs:a,maxRetries:0},(l,c)=>{if(l){s(l,null,null,c);return}let d=c.metadata,p=this.hmacKey(d.accessId,{projectId:d.projectId});p.metadata=c.metadata,s(null,p,c.secret,c)})}getBuckets(t,n){let{options:i,callback:o}=Xq(t,n);i.project=i.project||this.projectId,this.request({uri:"/b",qs:i},(s,a)=>{if(s){o(s,null,null,a);return}let l=(a.items?a.items:[]).map(d=>{let p=this.bucket(d.id);return p.metadata=d,p}),c=a.nextPageToken?Object.assign({},i,{pageToken:a.nextPageToken}):null;o(null,l,c,a)})}getHmacKeys(t,n){let{options:i,callback:o}=Xq(t,n),s=Object.assign({},i),a=s.projectId||this.projectId;delete s.projectId,this.request({uri:`/projects/${a}/hmacKeys`,qs:s},(u,l)=>{if(u){o(u,null,null,l);return}let d=(l.items?l.items:[]).map(f=>{let A=this.hmacKey(f.accessId,{projectId:f.projectId});return A.metadata=f,A}),p=l.nextPageToken?Object.assign({},i,{pageToken:l.nextPageToken}):null;o(null,d,p,l)})}getServiceAccount(t,n){let{options:i,callback:o}=Xq(t,n);this.request({uri:`/projects/${this.projectId}/serviceAccount`,qs:i},(s,a)=>{if(s){o(s,null,a);return}let u={};for(let l in a)if(a.hasOwnProperty(l)){let c=l.replace(/_(\w)/g,(d,p)=>p.toUpperCase());u[c]=a[l]}o(null,u,a)})}hmacKey(t,n){if(!t)throw new Error(Uot.HMAC_ACCESS_ID);return new UNe(this,t,n)}};Zq.Bucket=UZ;Zq.Channel=QNe;Zq.File=QZ;Zq.HmacKey=UNe;Zq.acl={OWNER_ROLE:"OWNER",READER_ROLE:"READER",WRITER_ROLE:"WRITER"};JMi.paginator.extend(Zq,["getBuckets","getHmacKeys"]);(0,MAd.promisifyAll)(Zq,{exclude:["bucket","channel","hmacKey"]});var OBm=_t(D3t(),1);var RBm=_t(JN(),1),NAd=_t(ahi(),1),MBm=_t(Aoe(),1);var DAd=_t(Bot(),1);var vBm,TBm,IBm,wBm=(0,DAd.getPackageJSON)();var joC=32*1024*1024,GoC=32*1024*1024,HoC=32*1024*1024;var sfa={UPLOAD_MANY:"tm.upload_many",DOWNLOAD_MANY:"tm.download_many",UPLOAD_SHARDED:"tm.upload_sharded",DOWNLOAD_SHARDED:"tm.download_sharded"};vBm=new WeakSet,TBm=function(t={}){let n=!1,i=!1;for(let[o,s]of Object.entries(t))o.toLocaleLowerCase().trim()==="x-goog-api-client"?(n=!0,s.includes(sfa.UPLOAD_SHARDED)||(t[o]=`${s} gccl-gcs-cmd/${sfa.UPLOAD_SHARDED}`)):o.toLocaleLowerCase().trim()==="user-agent"&&(i=!0);return n||(t["x-goog-api-client"]=`${qZ()} gccl/${wBm.version} gccl-gcs-cmd/${sfa.UPLOAD_SHARDED}`),i||(t["User-Agent"]=zZ()),t},IBm=function(t,n){if(this.bucket.storage.retryOptions.autoRetry&&this.bucket.storage.retryOptions.retryableErrorFn(t))throw t;n(t)};ur();var PBm=_t(Fgi());var yxt=class{whereClauseDisjunctionLimits={in:30,"not-in":10,"array-contains-any":30};async selectInBatches(t,n,i,o,s){let a=[],u=this.whereClauseDisjunctionLimits[i];for(let l=0;l<o.length;l+=u){let c=o.slice(l,l+u),d=this.createQuery(t,{where:[...s,[n,i,c]]}),p=await this.runQuery(d);a.push(p)}return a.flat()}};var AsC=fB.getTracer("repository");var NBm=500,DBm=10*1024*1024,xBm=.7*DBm,$Mi=class{constructor(t){this.firestoreOperations=t;this.batch=t.batch(),this.batchSize=0,this.requestSize=0,this.batchesCommitted=0,this.batchesToCommit=[this.batch]}batch;batchSize;requestSize;batchesCommitted;batchesToCommit;batchIncrement=async(t,n)=>{let i=eWn(t)+eWn(n),o=this.requestSize+i>=xBm,s=this.batchSize+1>=NBm;o||s?(this.batchSize=1,this.requestSize=i,this.batch=this.firestoreOperations.batch(),this.batchesToCommit.push(this.batch)):(this.batchSize+=1,this.requestSize+=i)};async save(t,n){let i=t,o=i.prepareDataForSave(n);await this.batchIncrement(o,i.docRef.path),this.firestoreOperations.saveDocBatch(this.batch,i.docRef,o)}async merge(t,n){let i=t,o=i.prepareDataForMerge(n);await this.batchIncrement(o,i.docRef.path),this.firestoreOperations.updateDocBatch(this.batch,i.docRef,o)}async delete(t,n){let i=t,o=i.docRef;if(await this.batchIncrement(n,o.path),this.firestoreOperations.deleteDocBatch(this.batch,i.docRef),o.parent.id==="steps"){let s=this.firestoreOperations.collectionRef(o.parent.parent,"deletedSteps"),a=this.firestoreOperations.docRef(s,o.id),u={deletedAt:this.firestoreOperations.getServerTimestampSentinel()};await this.batchIncrement(u,a.path),this.firestoreOperations.saveDocBatch(this.batch,a,u)}}async commit(){if(Tc().info("committing batches!"),this.batchSize)for(let t of this.batchesToCommit)this.batchesCommitted+=1,await this.firestoreOperations.commitBatch(t);return this.batchesCommitted}};var IEe=class extends Are{constructor(n,i,o,s,a,u){super(n);this.id=n;this.ref=i;this.subCollectionNames=o;this.parent=s;this.logContext=a;this.firestoreOperations=u}subCollections=[];runTransaction(n,i){let o=n?.transaction;return tx(o?i(n):this.firestoreOperations.runTransaction(s=>i({...n??{},transaction:s})))}getSubCollection(n,i){let o=this.subCollections[n];return o||(o=new i(this.firestoreOperations.collectionRef(this.ref,n),this,this.logContext,this.firestoreOperations),this.subCollections[n]=o),o}};var Ra=class extends IEe{constructor(n,i,o,s,a,u,l=[]){super(n,i,l,s,a,u);this.docRef=i;this.dataTransform=o}get path(){return this.docRef.path}async fetch(n){let i=n?.transaction,o=i?()=>i.get(this.docRef):()=>this.firestoreOperations.getDoc(this.docRef,n),s=n?.retryOptions,u=await tx((s?()=>xyt(o,{...s,tags:[...s.tags,"[FirestoreEntityRepository.fetch()]",`[${this.path}]`]}):o)());if(!u.exists)throw Tc().info(`Document ${this.path} not found`),new Ya(`Entity ${this.path} not found`);return this.dataTransform.fromStorage(this.id.toString(),this.path,this.firestoreOperations.data(u),this.firestoreOperations,n)}async save(n,i){let o=i?.transaction,s=this.prepareDataForSave(n,i);o?o.set(this.docRef,s):await tx(this.firestoreOperations.saveDoc(this.docRef,s))}async merge(n,i){let o=i?.transaction,s=this.prepareDataForMerge(n,i),a=o?async()=>o.update(this.docRef,s):()=>this.firestoreOperations.updateDoc(this.docRef,s),u=i?.retryOptions;await tx((u?()=>xyt(a,{...u,tags:[...u.tags,"[FirestoreEntityRepository.merge()]",`[${this.path}]`]}):a)())}fetchAndMerge(n,i){return this.runTransaction(i,async o=>{let s=await this.fetch(o);return this.save(this.mergeWithDeletes(s,n),o)})}async delete(n){let i=n?.transaction;i?i.delete(this.docRef):await tx(this.firestoreOperations.deleteDoc(this.docRef))}async recursiveDelete(){let n=this.firestoreOperations.db;if(!Bfd(n))throw new et("Unable to perform repository recursive delete from non-admin firestore.");await tx(n.recursiveDelete(this.docRef))}listen(n,i,o){let s=!0;return this.firestoreOperations.onDocSnapshot(this.docRef,a=>{if(this.firestoreOperations.exists(a))try{Tc().debug(`Listener notification for document ${this.path} modified`),n({type:s?"added":"modified",value:this.dataTransform.fromStorage(this.id.toString(),this.path,this.firestoreOperations.data(a),this.firestoreOperations,o),id:this.id.toString(),hasPendingWrites:this.firestoreOperations.hasPendingWrites(a)}),s=!1}catch(u){i&&i(u)}else Tc().debug(`Listener notification for document ${this.path} removed`),n({type:"removed",id:a.id,hasPendingWrites:this.firestoreOperations.hasPendingWrites(a)})},a=>{Tc().error(`Firestore error listening to document ${this.path} ${a}`),i&&i(dxt(a))})}prepareDataForSave(n,i){if(n.id&&n.id?.toString()!==this.docRef.id)throw new mo(`Attempt to assign a new ID to entity ${this.path} `);let o=this.firestoreOperations.currentUser(),s=this.id.toString(),a={id:this.id,...Vc(n),createdAt:n.createdAt??Mk(),createdBy:n.createdBy??o,updatedAt:Mk(),updatedBy:o};return this.dataTransform.toStorage(s,this.path,a,this.firestoreOperations,i)}prepareDataForMerge(n,i){let o=n.id;if(o&&o.toString()!==this.docRef.id)throw new mo(`Attempt to assign a new ID to entity ${this.path} `);let s={...Vc(n),updatedAt:Mk(),updatedBy:this.firestoreOperations.currentUser()};return this.dataTransform.mergeToStorage(this.id.toString(),this.path,s,this.firestoreOperations)}mergeWithDeletes(n,i){return b3e(this.path,o=>o instanceof nTe?[void 0,!0]:[o,!1],XLi(n,i))}};var XMi=class{constructor(t){this.firestoreOperations=t;this.firestoreOperations=t}async uploadFile(t,n){await this.firestoreOperations.uploadToStorage(t,n)}async downloadFile(t){return this.firestoreOperations.downloadFromStorage(t)}async checkIfReferenceExists(t){return this.firestoreOperations.checkIfStorageReferenceExists(t)}async deleteFile(t){return this.firestoreOperations.deleteFileFromStorage(t)}};ur();var xAd=_t(gUe());var jot=class{constructor(t){this._storage=t}async uploadToStorage(t,n){let i=Gft(this._storage,t),o=(0,xAd.gzip)(new TextEncoder().encode(JSON.stringify(n)));await Z6n(i,o,{contentType:"application/json",contentEncoding:"gzip"})}async downloadFromStorage(t){let n=async()=>{let i=await lsu(this._storage.ref(t));return JSON.parse(Buffer.from(i).toString())};return await this.handleStorageNotFoundError("download",n(),t)}async deleteFileFromStorage(t){await this.handleStorageNotFoundError("delete",this._storage.ref(t).delete(),t)}async checkIfStorageReferenceExists(t){try{return!!await this._storage.ref(t).getDownloadURL()}catch(n){if(n instanceof w1&&n.code==="storage/object-not-found")return!1;throw n}}async handleStorageNotFoundError(t,n,i){try{return await n}catch(o){throw o instanceof w1&&o.code==="storage/object-not-found"?new Ya(`Could not ${t} file from storage (compat) - no file exists at provided path ${i}`):o}}};var FU=fB.getTracer("repository"),afa=class{constructor(t){this.transaction=t}async get(t){return Kjs(t.path),FU.startActiveSpan(`get ${t.path}`,async n=>{n.setAttribute("repositoryType","web"),n.setAttribute("path",t.path),n.setAttribute("operation","get");let i=await this.transaction.get(t);return n.end(),i})}set(t,n){return Yjs(t.path),FU.startActiveSpan(`set ${t.path}`,i=>(i.setAttribute("repositoryType","web"),i.setAttribute("path",t.path),i.setAttribute("operation","set"),this.transaction.set(t,n),i.end(),this))}async update(t,n){return Jjs(t.path),FU.startActiveSpan(`update ${t.path}`,i=>(i.setAttribute("repositoryType","web"),i.setAttribute("path",t.path),i.setAttribute("operation","update"),this.transaction.update(t,n),i.end(),this))}delete(t){return $js(t.path),FU.startActiveSpan(`delete ${t.path}`,n=>(n.setAttribute("repositoryType","web"),n.setAttribute("path",t.path),n.setAttribute("operation","delete"),this.transaction.delete(t),n.end(),this))}getQuery(t){throw new Yp("getQuery is not supported with the web sdk.")}},bxt=class r extends yxt{constructor(n,i=new jot(n.storage())){super();this.app=n;this.storage=i}get db(){return this.app.firestore()}currentUser(){return this.db.app.auth().currentUser?.uid}currentLogContext(){return{userID:this.db.app.auth().currentUser?.uid}}collectionRef(n,i){return n.collection(i)}data(n){return n.data()}docRef(n,i){return n.doc(i)}exists(n){return n.exists}hasPendingWrites(n){return n.metadata.hasPendingWrites}async getDoc(n,i){let o=n;return Vjs(o.path),FU.startActiveSpan(`get ${n.path}`,async s=>{s.setAttribute("repositoryType","web"),s.setAttribute("path",n.path),s.setAttribute("operation","get");let a=await o.get();if(!a.metadata.hasPendingWrites)return s.end(),a;let u=hCl(o,i?.pendingWritesTimeoutMs);return s.end(),u})}async addDoc(n,i){let o=n;Ggi(o.path),await FU.startActiveSpan(`set ${n.path}`,async s=>{s.setAttribute("repositoryType","web"),s.setAttribute("path",n.path),s.setAttribute("operation","set"),await o.set(i),s.end()})}async saveDoc(n,i){let o=n;return Ggi(n.path),FU.startActiveSpan(`set ${n.path}`,async s=>{s.setAttribute("repositoryType","web"),s.setAttribute("path",n.path),s.setAttribute("operation","set"),await o.set(i),s.end()})}async updateDoc(n,i){let o=n;return Wjs(n.path),FU.startActiveSpan(`update ${n.path}`,async s=>{s.setAttribute("repositoryType","web"),s.setAttribute("path",n.path),s.setAttribute("operation","update"),await o.update(i),s.end()})}async getChildren(n){throw new Yp("getChildren() is not possible in the firestore web sdk as it lacks listDocuments()")}async deleteDoc(n){let i=n;return Hjs(n.path),FU.startActiveSpan(`delete ${n.path}`,async o=>{o.setAttribute("repositoryType","web"),o.setAttribute("path",n.path),o.setAttribute("operation","delete"),await i.delete(),o.end()})}createQuery(n,i){let o=n,s=i?.where?.filter(a=>a[2]!==void 0);if(s&&s.forEach(a=>o=o.where(r.replaceIDSentinel(a[0]),a[1],a[2])),i?.orderBy?.forEach(a=>o=o.orderBy(a[0],a[1])),i?.startingFrom!==void 0&&(i.orderBy?.length?o=o.startAfter(i.startingFrom):(o=o.orderBy(X0.firestore.FieldPath.documentId()),o=o.startAfter(i.startingFrom.toString()))),i?.limit&&(o=o.limit(i.limit)),i?.selectFields)throw new Yp("Selecting specific fields is not supported with the Firebase web SDK");return o}runQuery(n){return FU.startActiveSpan("get query.unknown",async i=>{i.setAttribute("repositoryType","web"),i.setAttribute("path","query.unknown"),i.setAttribute("operation","get");let o=await n.get();return i.end(),o})}onDocSnapshot(n,i,o){return n.onSnapshot(i,o)}onCollectionSnapshot(n,i,o){return this.onQuerySnapshot(n,i,o)}onQuerySnapshot(n,i,o){return n.onSnapshot(i,o)}snapShotChanges(n){return n.docChanges()}runTransaction(n){return this.db.runTransaction(i=>n(new afa(i)))}batch(){return this.db.batch()}saveDocBatch(n,i,o){n.set(i,o)}updateDocBatch(n,i,o){n.update(i,o)}deleteDocBatch(n,i){n.delete(i)}commitBatch(n){return Xjs(),FU.startActiveSpan("batch",async i=>{i.setAttribute("repositoryType","web"),i.setAttribute("operation","batch commit"),await n.commit(),i.end()})}getServerTimestampSentinel(){return X0.firestore.FieldValue.serverTimestamp()}getDeleteSentinel(){return X0.firestore.FieldValue.delete()}uploadToStorage(n,i){return this.storage.uploadToStorage(n,i)}downloadFromStorage(n){return this.storage.downloadFromStorage(n)}deleteFileFromStorage(n){return this.storage.deleteFileFromStorage(n)}getCount(n){throw new Yp("getCount is not supported with the web sdk.")}async checkIfStorageReferenceExists(n){return this.storage.checkIfStorageReferenceExists(n)}static replaceIDSentinel(n){return n instanceof Vft?X0.firestore.FieldPath.documentId():n}};var ZMi=class r{constructor(t="unknown",n={}){this.collectionName=t;this.listeners=n}getCollection(t){return new r(t,this.listeners)}publishEvents(t){let n=this.listeners[this.collectionName]||{};Object.values(n).forEach(i=>i?.(t))}registerListener(t){let n=Za(),i=this.listeners[this.collectionName];return i||(i={},this.listeners[this.collectionName]=i),i[n]=t,()=>{i[n]=void 0}}};var ewi=(r,t)=>{if(!r)return r;let n=Object.create(Object.getPrototypeOf(r));return Object.assign(n,r),t&&Object.assign(n,t),n},BBm=["run","runs","devRun","devRuns"],kBm=["createEntity","save","delete","recursiveDelete","merge","fetchAndMerge","mergeMetadata"],jNe=class r{providers;flaggedRepositoryParent;constructor(t,n,i,o,s){return this.providers=n,this.flaggedRepositoryParent=t,new Proxy(this,{get:(a,u)=>{if(u==="flaggedRepositoryParent")return t;if(u==="providers")return n;if(BBm.includes(u))return this.providers.firebase[u];if(u==="batch"&&t.id==="root")return s;let{providerId:l,shouldMutateBoth:c}=o(u,i);if(!(l in this.providers))throw new et("[FLAGGED_REPOSITORY] Attempted to access a flagged repository implementation that is not configured.",`Provider ID: ${l}`);let d=a.providers[l]?.[u];if(d instanceof Are){let p=Object.fromEntries(Object.entries(this.providers).map(([f,A])=>[f,A?.[u]]));return new r(d,p,{...i},o,s)}return typeof d=="function"?(...p)=>{let f=t?.[u],A=d,g=this.providers.firebase?.[u],b=this.providers.service?.[u],_=f||A,v={};if(c&&u==="createEntity"){let Y=t.generateID?.(p[0]);v.generateID=()=>Y}let O=ewi(t,v),R=ewi(a.providers[l],v),w=ewi(this.providers.firebase,v),P=ewi(this.providers.service,v),z=f?.bind(O),j=A?.bind(R),U=g?.bind(w),G=b?.bind(P),L=(z||j)?.(...p);if(L instanceof Promise&&(L=new Promise((Y,J)=>{let re=L,ne=[re];kBm.includes(u)&&c&&(_===g?ne.push(G?.(...p)):ne.push(U?.(...p))),Promise.allSettled(ne).then(()=>{re.then(Y).catch(J)}).catch(()=>{console.error("Promise allSettled failed unexpectedly")})})),!(L instanceof Are))return L;let W=Object.fromEntries(Object.entries(this.providers).map(([Y,J])=>[Y,J?.[u]?.bind(J)?.(...p)])),V=i.orgId;u==="org"&&(V=p[0]),u==="get"&&t.id==="orgs"&&(V=p[0]);let q=u==="get"?L:j?.(...p);return new r(q,W,{...i,orgId:V},o,s)}:t[u]}})}},BAd=(r,t,n,i)=>new jNe(r,t,{},n,i);var cP=class extends Are{constructor(n,i,o,s,a,u){super(n);this.id=n;this.collectionName=i;this.subCollectionNames=o;this.parent=s;this.logContext=a;this.serviceOperations=u}subCollections=[];async getToken(){return this.serviceOperations.getToken()}getSubCollection(n,i){let o=this.subCollections[n];return o||(o=new i(this,this.serviceOperations,this.logContext),this.subCollections[n]=o),o}};var twi=class{constructor(t,n,i){this.getMutateAllRepositories=i;this.firestoreBatch=t.batch(),this.serviceBatch=n.batch()}firestoreBatch;serviceBatch;async save(t,n){if(t instanceof cP)return this.serviceBatch.save(t,n);if(t instanceof jNe){let i=t.flaggedRepositoryParent,o=this.getMutateAllRepositories();return i instanceof cP?(o&&this.firestoreBatch.save(t.providers.firebase,n),this.serviceBatch.save(t.providers.service,n)):(o&&t.providers.service&&this.serviceBatch.save(t.providers.service,n),this.firestoreBatch.save(t.providers.firebase,n))}return this.firestoreBatch.save(t,n)}async merge(t,n){if(t instanceof cP)return this.serviceBatch.merge(t,n);if(t instanceof jNe){let i=t.flaggedRepositoryParent,o=this.getMutateAllRepositories();return i instanceof cP?(o&&this.firestoreBatch.merge(t.providers.firebase,n),this.serviceBatch.merge(t.providers.service,n)):(o&&t.providers.service&&this.serviceBatch.merge(t.providers.service,n),this.firestoreBatch.merge(t.providers.firebase,n))}return this.firestoreBatch.merge(t,n)}async delete(t,n){if(t instanceof cP)return this.serviceBatch.delete(t,n);if(t instanceof jNe){let i=t.flaggedRepositoryParent,o=this.getMutateAllRepositories();return i instanceof cP?(o&&this.firestoreBatch.delete(t.providers.firebase,n),this.serviceBatch.delete(t.providers.service,n)):(o&&t.providers.service&&this.serviceBatch.delete(t.providers.service,n),this.firestoreBatch.delete(t.providers.firebase,n))}return this.firestoreBatch.delete(t,n)}async commit(){let[t,n]=await Promise.all([this.serviceBatch.commit(),this.firestoreBatch.commit()]);return Math.max(t,n)}};var yC=class extends cP{constructor(n,i,o,s,a,u=[],l,c){super(n,i,u,s,a,c);this.dataTransform=o;this.hostname=l;this.eventManager=this.serviceOperations.eventManager.getCollection(i)}eventManager;async addAuthHeader(n={}){let i=await this.getToken();return i&&(n.Authorization=`Bearer ${i}`),n}get path(){return`${this.parent.path}/${this.collectionName}/${this.id}`}handleNotFound(n,i){if(Ag(n)&&n.status===404){if(i)return!0;throw new Ya(`Couldn't find entity ${this.path} for service backed repository`)}return!1}async fetch(n){let i=await this.addAuthHeader({});try{let s=(await fd.get(`${this.hostname}${this.baseUri}/${this.id}`,{headers:i})).data;return this.dataTransform.fromStorage(this.id.toString(),this.path,s,n)}catch(o){throw this.handleNotFound(o),o}}async save(n,i){let o;try{let s=await this.addAuthHeader();o=this.dataTransform.toStorage(this.id.toString(),this.path,n,i);let{data:a}=await fd.put(`${this.hostname}${this.baseUri}/${this.id}`,o,{headers:s}),u=this.dataTransform.fromStorage(this.id.toString(),this.path,a,i);this.eventManager.publishEvents([{type:"modified",value:u,id:this.id.toString(),hasPendingWrites:!1}])}catch(s){if(this.handleNotFound(s,!0))try{let a=await this.addAuthHeader();o||(o=this.dataTransform.toStorage(this.id.toString(),this.path,n,i));let{data:u}=await fd.post(`${this.hostname}${this.baseUri}`,o,{headers:a}),l=this.dataTransform.fromStorage(this.id.toString(),this.path,u,i);this.eventManager.publishEvents([{type:"added",value:l,id:this.id.toString(),hasPendingWrites:!1}])}catch(a){throw this.handleNotFound(a),a}else throw s}}async merge(n,i){let o=Object.entries(n).reduce((s,[a,u])=>(Kut(s,a,u),s),{});await this.fetchAndMerge(o,i)}async fetchAndMerge(n,i){try{let o=await this.addAuthHeader(),s=this.dataTransform.mergeToStorage(String(this.id),this.path,n,i),{data:a}=await fd.patch(`${this.hostname}${this.baseUri}/${this.id}`,this.mapDataToPatchPayload(s),{headers:o}),u=this.dataTransform.fromStorage(String(this.id),this.path,a,i);this.eventManager.publishEvents([{type:"modified",value:u,id:String(this.id),hasPendingWrites:!1}])}catch(o){throw this.handleNotFound(o),o}}async delete(){try{let n=await this.addAuthHeader({});await fd.delete(`${this.hostname}${this.baseUri}/${this.id}`,{headers:n}),this.eventManager.publishEvents([{type:"removed",value:{},id:this.id.toString(),hasPendingWrites:!1}])}catch(n){throw this.handleNotFound(n),n}}recursiveDelete(){return this.delete()}listen(){throw new Yp}mapDataToPatchPayload(n){let i=this.flattenToPaths(n);return Object.entries(i).reduce((s,[a,u])=>(u===S8n()?Kut(s.delete,a,!0):Kut(s.update,a,u),s),{update:{id:this.id},delete:{}})}flattenToPaths(n){let i={};function o(s,a){Vut(s,(u,l)=>{let c=a?`${a}.${l}`:l;Th(u)&&!Array.isArray(u)?o(u,c):i[c]=u})}return o(n,""),i}};var ufa=r=>r instanceof yC,rwi=class{batches={save:{},merge:{},delete:{}};async save(t,n){if(!ufa(t))throw new et("Entity must be a ServiceEntityRepository for batch writes");let i=t.getCollection(),o=i.id,s=this.batches.save[o];s?s.data.push(n):this.batches.save[o]={collection:i,data:[n]}}async merge(t,n){if(!ufa(t))throw new et("Entity must be a ServiceEntityRepository for batch writes");let i=t.getCollection(),o=i.id,s=this.batches.merge[o];s?s.data.push(n):this.batches.merge[o]={collection:i,data:[n]}}async delete(t){if(!ufa(t))throw new et("Entity must be a ServiceEntityRepository for batch writes");let n=t.getCollection(),i=n.id,o=this.batches.delete[i],s={id:t.id};o?o.data.push(s):this.batches.delete[i]={collection:n,data:[s]}}async commit(){let t=0;if(this.batches.delete.nodes){let n=this.batches.delete.nodes;try{for(let i of T7(n.data,1e3))await n.collection.bulkDelete(i),t+=i.length}catch{}}if(await Promise.allSettled(Object.entries(this.batches.delete).map(async([n,i])=>{if(n!=="nodes")for(let o of T7(i.data,1e3))await i.collection.bulkDelete(o),t+=o.length})),this.batches.merge.nodes){let n=this.batches.merge.nodes;try{for(let i of T7(n.data,1e3))await n.collection.bulkUpdate(i),t+=i.length}catch{}}if(await Promise.allSettled(Object.entries(this.batches.merge).map(async([n,i])=>{if(n!=="nodes")for(let o of T7(i.data,1e3))await i.collection.bulkUpdate(o),t+=o.length})),this.batches.save.nodes){let n=this.batches.save.nodes;try{for(let i of T7(n.data,1e3))await n.collection.bulkSave(i),t+=i.length}catch{}}return await Promise.allSettled(Object.entries(this.batches.save).map(async([n,i])=>{if(n!=="nodes")for(let o of T7(i.data,1e3))await i.collection.bulkSave(o),t+=o.length})),t}};var Ext=class{fromStorage(t,n,i,o){try{return this.transformFromStorage(t,n,i,o)}catch(s){if(o?.onDataTransformError&&o.onDataTransformError(n,s),!o?.ignoreDataTransformErrors)throw Tc().debug(`Error transforming repository entity ${n} from storage ${s}`),s}return i}toStorage(t,n,i,o){try{return this.transformToStorage(t,n,{id:t,...i},o)}catch(s){if(o?.onDataTransformError&&o.onDataTransformError(n,s),!o?.ignoreDataTransformErrors)throw Tc().debug(`Error transforming repository entity ${n} to storage ${s}`),s}return i}mergeToStorage(t,n,i,o){try{return this.mergeTransformToStorage(t,n,i,o)}catch(s){if(o?.onDataTransformError&&o.onDataTransformError(n,s),!o?.ignoreDataTransformErrors)throw Tc().debug(`Error merge transforming repository entity ${n} to storage ${s}`),s}return i}},cfa=class extends Ext{constructor(n){super();this.validators=n}transformFromStorage(n,i,o,s){let a=this.getValidatorOptions(n,s?.validatorOptions);return s?.enableStrictValidation?this.validators.strict.assert(o,a):this.validators.standard.assert(o,a)}transformToStorage(n,i,o,s){let a=this.getValidatorOptions(n,s?.validatorOptions);return s?.enableStrictValidation?this.validators.strict.assert(o,a):this.validators.standard.assert(o,a)}mergeTransformToStorage(n,i,o,s){return o}getValidatorOptions(n,i,o=500){let s={...i,statusCode:o};return s.errorMessage||(s.errorMessage=a=>`Found ${a.failures.length} validation failure(s) for ${this.validators.standard.name} ${n}`),s}},lfa=class{transforms;constructor(...t){this.transforms=t}fromStorage(t,n,i,o){return this.transforms.reduce((s,a)=>a.fromStorage(t,n,s,o),i)}toStorage(t,n,i,o){return this.transforms.reduceRight((s,a)=>a.toStorage(t,n,s,o),i)}mergeToStorage(t,n,i,o){return this.transforms.reduceRight((s,a)=>a.mergeToStorage(t,n,s,o),i)}},GZ=class extends Ext{transformToStorage(t,n,i){return i}mergeTransformToStorage(t,n,i){return i}},Got=class extends GZ{constructor(n,i=o=>o){super();this.fieldName=n;this.transform=i}transformToStorage(n,i,o){return{id:o[this.fieldName],...GS(o,[this.fieldName])}}mergeTransformToStorage(n,i,o){return o}transformFromStorage(n,i,o){return{...o,[this.fieldName]:this.transform(o.id)}}},dfa=class extends Ext{transformToStorage(t,n,i){let{createdAt:o,createdBy:s,updatedAt:a,updatedBy:u,...l}=i;return l}mergeTransformToStorage(t,n,i){let{createdAt:o,createdBy:s,updatedAt:a,updatedBy:u,...l}=i;return l}transformFromStorage(t,n,i){return i}},nwi=class extends GZ{constructor(n,i=o=>o){super();this.fieldName=n;this.transform=i}transformToStorage(n,i,o){let s=o[this.fieldName];return kkt(s)?{...o,[this.fieldName]:(s.getTime()===yV.SENTINEL_DATE?new Date:s).toISOString()}:o}mergeTransformToStorage(n,i,o){let s=this.transform(o[this.fieldName]);return kkt(s)?{...o,[this.fieldName]:(s.getTime()===yV.SENTINEL_DATE?new Date:s).toISOString()}:o}transformFromStorage(n,i,o){let s=this.transform(o[this.fieldName]);return typeof s=="string"?{...o,[this.fieldName]:new Date(s)}:o}},vR=(r,t)=>{let n=[new dfa,new cfa(r)];return t&&n.unshift(t),new lfa(...n)};var LBm=()=>typeof document<"u"&&document.hidden||typeof navigator<"u"&&!navigator.onLine;function pfa(r,t){let n,i=!0,o=1e3,s=0,a=null,u=!1,l=new AbortController,c=l.signal,d=A=>{if(LBm())return;s++,a||(a=Date.now());let g=Date.now()-a;!u&&s>=3&&g>=1e4&&(u=!0,t.onError?.(A))},p=()=>{o=1e3,s=0,a=null};return(async()=>{for(;i;)try{let A=await t.auth?.(),g={accept:"text/event-stream"};A&&(g.Authorization=A),n&&(g["Last-Event-Id"]=n);let b=await fetch(r,{headers:g,signal:c});if(b.status!==200)throw new Error(await b.text());p(),await qBm(b.body,zBm(FBm(_=>{n=_},t.onMessage))),await new Promise(_=>setTimeout(_,0))}catch(A){if(A.name==="AbortError")break;d(A),await new Promise(g=>setTimeout(g,o)),o=o*2,o>6e4&&(o=6e4)}})().catch(A=>{d(A)}),()=>{i=!1,l.abort()}}async function qBm(r,t){let n=r.getReader(),i;for(;!(i=await n.read()).done;)t(i.value)}function zBm(r){let t,n,i,o=!1;return function(a){t===void 0?(t=a,n=0,i=-1):t=QBm(t,a);let u=t.length,l=0;for(;n<u;){o&&(t[n]===10&&(l=++n),o=!1);let c=-1;for(;n<u&&c===-1;++n)switch(t[n]){case 58:i===-1&&(i=n-l);break;case 13:o=!0,c=n;break;case 10:c=n;break}if(c===-1)break;r(t.subarray(l,c),i),l=n,i=-1}l===u?t=void 0:l!==0&&(t=t.subarray(l),n-=l)}}function FBm(r,t){let n=kAd(),i=new TextDecoder;return function(s,a){if(s.length===0)t?.(n),n=kAd();else if(a>0){let u=i.decode(s.subarray(0,a)),l=a+(s[a+1]===32?2:1),c=i.decode(s.subarray(l));switch(u){case"data":n.data=n.data?n.data+`
10370
- `+c:c;break;case"event":n.event=c;break;case"id":r(n.id=c);break}}}}function QBm(r,t){let n=new Uint8Array(r.length+t.length);return n.set(r),n.set(t,r.length),n}function kAd(){return{data:"",event:"",id:""}}var Gv=class extends cP{constructor(n,i,o,s,a,u,l){super(n,n,[],i,s,l);this.dataTransform=o;this.EntityRepositoryConstructor=a;this.hostname=u;this.eventManager=this.serviceOperations.eventManager.getCollection(n)}eventManager;async addAuthHeader(n={}){let i=await this.getToken();return i&&(n.Authorization=`Bearer ${i}`),n}get path(){return`${this.parent.path}/${this.id}`}get bulkUri(){throw new Yp("This entity does not support bulk operations")}get(n){return new this.EntityRepositoryConstructor(n,this.parent,this.serviceOperations,this.logContext)}encodeQueryComponent(n){if(n!==void 0)return Buffer.from(JSON.stringify(n)).toString("base64")}async select(n,i){let o=!1,s=0,a=[],u;n?.startingFrom&&(v0(n.startingFrom)?u=n.startingFrom:u=[n.startingFrom]);let l=this.encodeQueryComponent(u),c=n?.where?n?.where.map(_=>({field:_[0],operation:_[1],value:_[2]})):void 0,d=this.encodeQueryComponent(c),p;n?.orderBy&&(n.orderBy.length===0?p=[{field:"id",direction:"asc"}]:p=n?.orderBy.map(_=>({field:_[0],direction:_[1]})));let f=this.encodeQueryComponent(p),A=500,g=n?.limit??1/0;for(;!o;){let _=Math.min(A,g-s),v=await this.addAuthHeader(),O=await fd.get(`${this.hostname}${this.baseUri}`,{headers:v,params:{limit:_,startAfter:l,where:d,orderBy:f}}),R=O.data.data.map(w=>this.dataTransform.fromStorage(w.id.toString(),this.path,w,i));a.push(...R),s+=_,l=O.data.nextCursor,(R.length<_||s>=g)&&(o=!0)}let b=n?.selectFields;return b?a.map(_=>ub(_,b)):a}async selectIDs(n,i){return(await this.select({...n,selectFields:["id"]},i)).map(s=>s.id)}async selectInBatches(n,i,o,s=[]){return this.select({where:[...s,[n,i,o]]})}async createEntity(n,i){let o=await this.generateID(n),s=this.dataTransform.toStorage(o.toString(),`${this.path}/${o}`,n,i),a=await this.addAuthHeader(),l=(await fd.post(`${this.hostname}${this.baseUri}`,s,{headers:a,method:"post"})).data,c=this.dataTransform.fromStorage(String(l.id),`${this.path}/${l.id}`,l,i);return this.eventManager.publishEvents([{type:"added",value:c,id:String(l.id),hasPendingWrites:!1}]),new this.EntityRepositoryConstructor(l.id,this.parent,this.serviceOperations,this.logContext)}listenCollection(n,i,o){let s=this.eventManager.registerListener(n),a;try{console.log(`start subscription ${this.baseSSEUri}`),a=pfa(new URL(this.baseSSEUri,window.location.origin),{auth:async()=>{let u=await this.getToken();return ed(!!u,"Cookie-based auth is not yet supported for service-backed repositories","COMMON"),"Bearer "+u},onMessage:u=>{try{switch(u.event){case"entity":{let l=JSON.parse(u.data);if(l.type==="added"||l.type==="modified"){let c=this.dataTransform.fromStorage(l.id,`${this.path}/${l.id}`,l.value,o);this.eventManager.publishEvents([{type:l.type,value:c,id:l.id,hasPendingWrites:!1}])}else this.eventManager.publishEvents([{type:"removed",value:{},id:l.id,hasPendingWrites:!1}]);break}case"error":{if(i){let l=JSON.parse(u.data),c=new et(l.error.errorString,l.error.errorDetail);i(c)}break}case"connected":case"ready":case"disconnect":default:}}catch(l){We("COMMON").errorContext(this.logContext,"Failed to interpret SSE message",l),l instanceof Error&&i&&i(l)}},onError:u=>{u instanceof Error&&i&&i(u)}}),console.log(`subscription started ${this.baseSSEUri}`),this.select().then(u=>{this.eventManager.publishEvents(u.map(l=>({type:"added",value:l,id:String(l.id),hasPendingWrites:!1})))})}catch(u){if(u instanceof Error&&i)i(u);else throw u}return()=>{s(),a?.()}}listenQuery(n,i,o,s){throw new Yp("Not used by supported entities")}async generateID(n){return n.id??Za()}async bulkSave(n){We("COMMON").warnContext(this.logContext,"Using default bulk save operation",{path:this.path});for(let i of n)try{await this.createEntity(i)}catch(o){i&&i.id&&Ag(o)&&o.status===409?await this.get(i.id).save(i):We("COMMON").errorContext(this.logContext,"Failed to bulk save entity using default operation",{path:this.path},o)}}async bulkUpdate(n){We("COMMON").warnContext(this.logContext,"Using default bulk update operation",{path:this.path});for(let i of n)try{if(!i.id)throw We("COMMON").errorContext(this.logContext,"Tried to bulk update entity without entity ID",{path:this.path}),new et("Tried to bulk update entity without entity ID");await this.get(i.id).merge(i)}catch(o){We("COMMON").errorContext(this.logContext,"Failed to bulk update entity using default operation",{path:this.path},o)}}async bulkDelete(n){We("COMMON").warnContext(this.logContext,"Using default bulk delete operation",{path:this.path});for(let i of n)try{if(!i.id)throw We("COMMON").errorContext(this.logContext,"Tried to bulk delete entity without entity ID",{path:this.path}),new et("Tried to bulk delete entity without entity ID");await this.get(i.id).delete()}catch(o){We("COMMON").errorContext(this.logContext,"Failed to bulk delete entity using default operation",{path:this.path},o)}}async getCount(){throw new Yp}};var UBm=zi.merge(SK),jBm=Os("Job",UBm),LAd=vR(jBm,new Got("jobCounter")),ffa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/jobs`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/jobs`}get wsQuery(){return{}}getCollection(){return new Cxt(this.parent,this.serviceOperations,this.logContext)}constructor(t,n,i,o){super(t,"jobs",LAd,n,o,[],i.hostnames.metadataService,i)}},Cxt=class extends Gv{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/jobs`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/jobs`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("jobs",t,LAd,i,ffa,n.hostnames.metadataService,n)}async generateID(t){if(t.id)return t.id;if(t.jobCounter)return t.jobCounter;let n=await this.select();if(n.length<1)return 1;let o=n.sort((a,u)=>u.id-a.id)[0];return o?o.id+1:1}};var Afa=class r extends GZ{static ID_NUMBER=/^\d+$/;transformToStorage(t,n,i){return{...GS(i,["macroCounter","name","packageInfo"])}}mergeTransformToStorage(t,n,i){return i}transformFromStorage(t,n,i){return r.ID_NUMBER.test(i.id)?{...i,macroCounter:+i.id}:{...i}}},GBm=zi.merge(aL),HBm=Os("Macro",GBm),qAd=vR(HBm,new Afa),hfa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/macros`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/macros`}get wsQuery(){return{}}getCollection(){return new Sxt(this.parent,this.serviceOperations,this.logContext)}constructor(t,n,i,o){super(t,"macros",qAd,n,o,[],i.hostnames.metadataService,i)}},Sxt=class extends Gv{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/macros`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/macros`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("macros",t,qAd,i,hfa,n.hostnames.metadataService,n)}};var gfa=class extends GZ{transformToStorage(t,n,i){return{...GS(i,["templateCounter"])}}mergeTransformToStorage(t,n,i){return i}transformFromStorage(t,n,i){return i}},WBm=zi.merge(xFe),VBm=Os("NodeType",WBm),zAd=vR(VBm,new gfa),mfa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/templates`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/templates`}get wsQuery(){return{}}getCollection(){return new _xt(this.parent,this.serviceOperations,this.logContext)}constructor(t,n,i,o){super(t,"templates",zAd,n,o,[],i.hostnames.metadataService,i)}},_xt=class extends Gv{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/templates`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/templates`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("templates",t,zAd,i,mfa,n.hostnames.metadataService,n)}};var yfa=class extends GZ{transformToStorage(t,n,i){return i}mergeTransformToStorage(t,n,i){return i}transformFromStorage(t,n,i){let o=[];return i.metadata.columns.forEach(s=>{let a;(i.type==="sourceInput"||s.isSurrogateKey||s.isSystemCreateDate||s.isSystemUpdateDate||s.isSystemStartDate||s.isSystemEndDate||s.isSystemVersion||s.isSystemCurrentFlag)&&(a={strictMatch:!0,values:[]}),o.push({...s,acceptedValues:a})}),{...i,metadata:{...i.metadata,columns:o}}}},KBm=M.discriminatedUnion("type",[zi.merge(yi.merge(EK)),zi.merge(yi.merge(CK))]),YBm=Os("Node",KBm),FAd=vR(YBm,new yfa),bfa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/nodes`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/nodes`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i,o){super(t,"nodes",FAd,n,o,[],i.hostnames.metadataService,i)}mergeMetadata(t){return this.fetchAndMerge({metadata:t})}getCollection(){return new vxt(this.parent,this.serviceOperations,this.logContext)}},vxt=class r extends Gv{static NODE_BULK_LIMIT=1e3;get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/nodes`}get bulkUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/nodes_bulk`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/nodes`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("nodes",t,FAd,i,bfa,n.hostnames.metadataService,n)}listenCollectionOverride(t,n,i,o,s){let a=this.listenCollection(t,o,s);return()=>{a&&a()}}convertFromRestAPIStorage(t,n){return this.dataTransform.fromStorage(n,`${this.path}/${n}`,t)}async getNodesLocationInfo(){let t=await this.select(),n={};return t.forEach(i=>{n[i.id]={operation:i}}),n}async bulkSave(t){let n=t.map(o=>this.dataTransform.toStorage(o.id||"",`${this.path}/${o.id}`,o));await this.bulkPostChunk(()=>this.addAuthHeader({}),n,r.NODE_BULK_LIMIT);let i=n.map(o=>this.dataTransform.fromStorage(o.id,`${this.path}/${o.id}`,o));this.eventManager.publishEvents(i.map(o=>({type:"added",value:o,id:String(o.id),hasPendingWrites:!1})))}async bulkUpdate(t){let n=t.map(o=>this.dataTransform.mergeToStorage(o.id||"",`${this.path}/${o.id}`,o));await this.bulkPostChunk(()=>this.addAuthHeader({}),n,r.NODE_BULK_LIMIT);let i=n.map(o=>this.dataTransform.fromStorage(o.id,`${this.path}/${o.id}`,o));this.eventManager.publishEvents(i.map(o=>({type:"added",value:o,id:String(o.id),hasPendingWrites:!1})))}async bulkDelete(t){let n=t.map(o=>o.id),i;for(let o of T7(n,1e3))try{let s=await this.addAuthHeader();await fd.delete(`${this.hostname}${this.bulkUri}`,{headers:s,data:o})}catch(s){i=s}if(i)throw i;this.eventManager.publishEvents(n.map(o=>({type:"removed",value:{},id:o,hasPendingWrites:!1})))}async bulkPostChunk(t,n,i){let o;for(let s of T7(n,i)){let a=await t();try{await fd.post(`${this.hostname}${this.bulkUri}`,{nodes:s},{headers:a})}catch(u){if(i>1&&Ag(u)&&u.response?.status===ECa.PayloadTooLarge){await this.bulkPostChunk(t,s,Math.max(i/10,1));continue}o=u}}if(o)throw o}};var JBm=zi.merge(VIe),$Bm=Os("Subgraph",JBm),QAd=vR($Bm,new Got("folderCounter")),Efa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/subgraphs`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/subgraphs`}get wsQuery(){return{}}getCollection(){return new Txt(this.parent,this.serviceOperations,this.logContext)}constructor(t,n,i,o){super(t,"subgraphs",QAd,n,o,[],i.hostnames.metadataService,i)}},Txt=class extends Gv{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/subgraphs`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/subgraphs`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("subgraphs",t,QAd,i,Efa,n.hostnames.metadataService,n)}};var XBm=M.union([zi.merge(smt),zi.merge(amt),zi.merge(umt),zi.merge(cmt)]),ZBm=Os("WorkspaceUser",XBm),UAd=vR(ZBm),Cfa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/platform-authentications`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/platform-authentications`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i,o){super(t,"users",UAd,n,o,[],i.hostnames.metadataService,i)}getCollection(){return new Ixt(this.parent,this.serviceOperations,this.logContext)}},Ixt=class extends Gv{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/platform-authentications`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/platform-authentications`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("users",t,UAd,i,Cfa,n.hostnames.metadataService,n)}};var e5m=zi.merge(iWn),t5m=Os("Workspace",e5m),jAd=vR(t5m,new nwi("latestCommitDate")),Sfa=class extends yC{get baseUri(){return"/api/metadata/v1/workspaces"}get baseSSEUri(){return"/api/metadata/sse/v1/workspaces"}get wsQuery(){return{}}getCollection(){return new Oxt(this.parent,this.serviceOperations,this.logContext)}constructor(t,n,i,o){super(t,"workspaces",jAd,n,o,["jobs","macros","nodes","nodeTypes","subgraphs","workspaceUsers","installedPackages","nodesLastRefreshed"],i.hostnames.metadataService,i)}get nodes(){return this.getSubCollection("nodes",vxt)}node(t){return this.nodes.get(t)}installedPackages=void 0;installedPackage=void 0;get jobs(){return this.getSubCollection("jobs",Cxt)}job(t){return this.jobs.get(t)}get macros(){return this.getSubCollection("macros",Sxt)}macro(t){return this.macros.get(t)}nodesLastRefreshed=void 0;nodeLastRefreshed=void 0;get nodeTypes(){return this.getSubCollection("templates",_xt)}nodeType(t){return this.nodeTypes.get(t)}get subgraphs(){return this.getSubCollection("subgraphs",Txt)}subgraph(t){return this.subgraphs.get(t)}get workspaceUsers(){return this.getSubCollection("users",Ixt)}workspaceUser(t){return this.workspaceUsers.get(t)}isDevEnv=void 0;removeDeletedSteps=void 0},Oxt=class extends Gv{get baseUri(){return"/api/metadata/v1/workspaces"}get baseSSEUri(){return"/api/metadata/sse/v1/workspaces"}get wsQuery(){return{}}async fetchWorkspacesForPermissions(t){return this.select({where:[["devEnv","==",t]],selectFields:["id","project"]})}constructor(t,n,i){super("workspaces",t,jAd,i,Sfa,n.hostnames.metadataService,n)}};var r5m=zi.merge(OWn),n5m=Os("Org",r5m),GAd=vR(n5m),_fa=class extends yC{constructor(t,n,i,o){super(t,"orgs",GAd,n,{...o,orgID:t},["devRuns","globalUsersSettings","projects","runs","userRoles","workspaces"],"NOT_SERVICE_BACKED",i)}get baseUri(){return"orgs"}getCollection(){return new Rxt(this.parent,this.serviceOperations,this.logContext)}get baseSSEUri(){return"orgs"}get wsQuery(){return{}}get workspaces(){return this.getSubCollection("workspaces",Oxt)}workspace(t){return this.workspaces.get(t)}devRuns=void 0;devRun=void 0;globalUsersSettings=void 0;globalUsersSetting=void 0;projects=void 0;project=void 0;runs=void 0;run=void 0;userRoles=void 0;userRole=void 0;getNextCounter=void 0;releaseWorkspaceStatusAndEndRun=void 0;updateLastLoginTime=void 0;writePlanAnalytics=void 0;writeRunAnalyticsSummary=void 0},Rxt=class extends Gv{get baseUri(){return"orgs"}get baseSSEUri(){return"orgs"}get wsQuery(){return{}}constructor(t,n,i){super("orgs",t,GAd,i,_fa,"NOT_SERVICE_BACKED",n)}};var iwi=class extends cP{constructor(t,n){super("root","root",["orgs","users","packagesRegistry","events"],void 0,n,t)}get path(){return"root"}get baseUri(){return"root"}get baseSSEUri(){return"root"}get wsQuery(){return{}}get orgs(){return this.getSubCollection("orgs",Rxt)}org(t){return this.orgs.get(t)}orgsPublic=void 0;orgPublic=void 0;users=void 0;user=void 0;packagesRegistry=void 0;registryPackage=void 0;events=void 0;event=void 0;oauthStates=void 0;oauthState=void 0;activePrompts=void 0;activePrompt=void 0;promptVersions=void 0;promptVersion=void 0;storage=void 0;batch=()=>new rwi;getRepositoryFromPath(t){let n=t.split("/"),i,o;if(n.length){n[0].length||n.shift();for(let s of n)if(i)o=i.get(s),i=void 0;else{if(i=(o??this)[s],!i)return;o=void 0}}return i||o||this}};var Ma=class extends IEe{constructor(n,i,o,s,a,u){super(n.id,n,[],o,s,a);this.collectionRef=n;this.dataTransform=i;this.EntityRepositoryConstructor=u}get path(){return this.collectionRef.path}get(n){let i=this.firestoreOperations.docRef(this.collectionRef,n.toString());return new this.EntityRepositoryConstructor(n,i,this.parent,this.logContext,this.firestoreOperations)}async select(n,i){let o=i?.transaction,s=this.firestoreOperations.createQuery(this.collectionRef,n),a;return o?a=await tx(o.getQuery(s)):a=await tx(this.firestoreOperations.runQuery(s)),a.docs.map(u=>this.transformDataFromStorage(u.ref,this.firestoreOperations.data(u),i))}async selectIDs(n,i){let o=i?.transaction,s=this.firestoreOperations.createQuery(this.collectionRef,n),a;return o?a=await tx(o.getQuery(s)):a=await tx(this.firestoreOperations.runQuery(s)),a.docs.map(u=>u.id)}async createEntity(n,i){let o=i?.transaction,s=await this.generateID(n),a=this.firestoreOperations.docRef(this.collectionRef,s?.toString()),u=await this.prepareDataForCreate(n,s??a.id,i);return o?o.set(a,u):await tx(this.firestoreOperations.addDoc(a,u)),new this.EntityRepositoryConstructor(s||a.id,a,this.parent,this.logContext,this.firestoreOperations)}listenCollection(n,i,o){let[s,a]=this.getListenCallbacks(n,i,o);return this.firestoreOperations.onCollectionSnapshot(this.collectionRef,s,a)}listenQuery(n,i,o,s){let[a,u]=this.getListenCallbacks(i,o,s);return this.firestoreOperations.onQuerySnapshot(this.firestoreOperations.createQuery(this.collectionRef,n),a,u)}async prepareDataForCreate(n,i,o){let s=n.createdBy??this.firestoreOperations.currentUser(),a={...Vc(n),id:i,createdAt:Mk(),createdBy:s,updatedAt:Mk(),updatedBy:s};return this.dataTransform.toStorage(i.toString(),`${this.path}/${i}`,a,this.firestoreOperations,o)}getListenCallbacks(n,i,o){return[s=>{let a=this.firestoreOperations.snapShotChanges(s).reduce((u,l)=>{try{let c=this.transformDataFromStorage(l.doc.ref,l.doc.data(),o);u.push({type:l.type==="added"?"added":l.type==="removed"?"removed":"modified",value:c,id:c.id.toString(),hasPendingWrites:this.firestoreOperations.hasPendingWrites(l.doc)})}catch(c){i&&i(c)}return u},[]);Tc().debug(`Listener notification for ${a.length} changes in collection ${this.path}`),n(a)},s=>{Tc().error(`Firestore error listening to collection ${this.path}`,s),i&&i(dxt(s))}]}transformDataFromStorage(n,i,o){return this.dataTransform.fromStorage(n.id,n.path,i,this.firestoreOperations,o)}async generateID(n){return n.id}async getCount(){return this.firestoreOperations.getCount(this.collectionRef)}async selectInBatches(n,i,o,s=[]){return(await this.firestoreOperations.selectInBatches(this.collectionRef,n,i,o,s)).map(l=>l.docs).flat().map(l=>this.transformDataFromStorage(l.ref,this.firestoreOperations.data(l)))}};var i5m=M.discriminatedUnion("type",[zi.merge(yi.merge(Iy)),zi.merge(yi.merge(AWn)),zi.merge(yi.merge(yWn)),zi.merge(yi.merge(oWn)),zi.merge(yi.merge(bWn)),zi.merge(yi.merge(dWn)),zi.merge(yi.merge(sWn)),zi.merge(yi.merge(aWn)),zi.merge(yi.merge(hWn)),zi.merge(yi.merge(gWn)),zi.merge(yi.merge(mWn))]),o5m=Os("Event",i5m),HAd=Au(o5m),vfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,HAd,i,o,s)}},owi=class extends Ma{constructor(t,n,i,o){super(t,HAd,n,i,o,vfa)}createEventCore(t,n,i,o,s,a,u){return{type:"core",orgID:t,event:n,resourceType:i,resourceID:o,fromID:s,requestedBy:a,requestedByUserAgent:u}}async createDuplicatePkgNodeTypeEvent(t,n,i,o,s,a,u,l){let d={...this.createEventCore(t,"workspaces.nodeType.duplicate","NodeType",n,i,o,l),type:"duplicate",packageID:s,releaseID:a,workspaceID:u};return(await this.createEntity(d)).id}async createInstallPkgNodeTypeEvent(t,n,i,o,s,a){let l={...this.createEventCore(t,"workspaces.nodeType.install","NodeType",n,"",s,a),type:"install",packageID:n,releaseID:i,workspaceID:o};return(await this.createEntity(l)).id}async createEnableTotpTypeEvent(t,n,i){let o=this.createEventCore(t,"users.auth.enableTotp","Auth","Totp","",n,i);return(await this.createEntity(o)).id}async createDisableTotpTypeEvent(t,n,i,o){let s=this.createEventCore(t,"users.auth.disableTotp","Auth","Totp",i,n,o);return(await this.createEntity(s)).id}async createAIColumnDescriptionsTypeEvent(t,n,i,o,s,a,u,l){let d={...this.createEventCore(t,"ai.description.columnDescriptions","AI","Description",n,n,l),type:"update",workspaceID:i,nodeID:o,acceptedDescriptionsCount:s,modifiedDescriptionsCount:a,rejectedDescriptionsCount:u};return(await this.createEntity(d)).id}async createNewWorkspaceWizardTypeEvent(t,n,i,o,s,a,u,l,c,d){let p=this.createEventCore(t,"workspaces.create.newWorkspace","NewWorkspace",i.toString(),c?.toString()??"",l,d),f=typeof s=="string"?new Date(s):s,A={...p,type:"create",projectID:n,stepNumber:o,startTime:f,endTime:a,status:u};return(await this.createEntity(A)).id}async createAINodeDescriptionTypeEvent(t,n,i,o,s,a){let l={...this.createEventCore(t,"ai.description.nodeDescription","AI",o,"",n,a),type:"update_node_description",workspaceID:i,nodeID:o,action:s};return(await this.createEntity(l)).id}async createAIGitCommitMessageRequestEvent(t,n,i,o,s,a,u){let c={...this.createEventCore(t,"ai.git.commit","AI",u,"",n),type:"request",fileCount:i,diffContent:o,charCount:s,latencyMs:a,aiGitRequestId:u};return(await this.createEntity(c)).id}async createAIGitCommitMessageActionEvent(t,n,i,o,s,a,u){let c={...this.createEventCore(t,"ai.git.commit","AI","",n,u),type:"action",aiMessage:i,finalMessage:o,editDistance:s,action:a,aiGitRequestId:u};return(await this.createEntity(c)).id}async createMinimapEvent(t,n,i,o,s,a){let l={...this.createEventCore(t,"workspaces.graph.minimap",n,i,o.toString(),s),type:"minimap",isEnabled:a,time:new Date};return(await this.createEntity(l)).id}async createFilterToggleEvent(t,n,i,o,s){let u={...this.createEventCore(t,"workspaces.graph.filter",n.includes("subgraph")?"Subgraph":"BrowserGraph",n,i.toString(),o),type:"filterToggle",isVisible:s,time:new Date};return(await this.createEntity(u)).id}async createGraphContextFilterEvent(t,n,i,o,s,a){let l={...this.createEventCore(t,"workspaces.graph.contextMenu",i,n,o.toString(),s),type:"graphContextMenu",filter:a,time:new Date};return(await this.createEntity(l)).id}};var s5m=Os("Event",yXu),WAd=Au(s5m),Tfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,WAd,i,o,s)}},swi=class extends Ma{constructor(t,n,i,o){super(t,WAd,n,i,o,Tfa)}};var a5m=We("FIREBASE"),awi=class extends Q_{transformFromStorage(t,n,i){let o=[];i.orgName||(o.push("Adding property orgName with default value"),i.orgName="");let s=i.licenseDetails;return typeof s=="object"&&(s.trialActivator||(o.push("Adding property licenseDetails.trialActivator with default value"),s.trialActivator=""),s.companyName||(o.push("Adding property licenseDetails.companyName with default value"),s.companyName="")),o.length>0&&a5m.debug(`Patched org ${n}`,o),i}};var u5m=zi.merge(J$u),c5m=Os("GitAccount",u5m),VAd=Au(c5m),Ifa=class extends Ra{constructor(t,n,i,o,s){super(t,n,VAd,i,o,s)}},uwi=class extends Ma{constructor(t,n,i,o){super(t,VAd,n,i,o,Ifa)}async generateID(t){return t.id??Za()}};var l5m=zi.merge(TXu),d5m=Os("ProjectGitAccount",l5m),KAd=Au(d5m),Ofa=class extends Ra{constructor(t,n,i,o,s){super(t,n,KAd,i,o,s)}},cwi=class extends Ma{constructor(t,n,i,o){super(t,KAd,n,i,o,Ofa)}async generateID(t){return t.id??Za()}};var p5m=zi.merge(X$u),f5m=Os("GlobalUserSettings",p5m),YAd=Au(f5m),Rfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,YAd,i,o,s,["gitAccounts","projectGitAccounts"])}get gitAccounts(){return this.getSubCollection("gitAccounts",uwi)}gitAccount(t){return this.gitAccounts.get(t)}get projectGitAccounts(){return this.getSubCollection("projectGitAccounts",cwi)}projectGitAccount(t){return this.projectGitAccounts.get(t)}},lwi=class extends Ma{constructor(t,n,i,o){super(t,YAd,n,i,o,Rfa)}listUsers(){return this.firestoreOperations.getChildren(this.collectionRef)}};var A5m=zi.merge(U0s),h5m=Os("Project",A5m),JAd=Au(h5m),Mfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,JAd,i,o,s)}},dwi=class extends Ma{constructor(t,n,i,o){super(t,JAd,n,i,o,Mfa)}async generateID(t){return t.id??Za()}};var pwi=(r,t,n)=>{let i=typeof r=="string"?parseInt(r):r;if(isNaN(i)||i===void 0)throw new t(`Missing or invalid environment ID '${r}' context=${JSON.stringify(n)}`);return i};var g5m=We("FIREBASE"),fwi=class extends Q_{transformFromStorage(t,n,i){let o=i,s=[];return"endTime"in o&&(s.push("Removing property 'endTime'"),delete o.endTime),(!o.version||o.version<qFe)&&(s.push(`Updating version ${o.version} to ${qFe}`),o.version=qFe),o.runDetails&&!o.runDetails.environmentID&&("toWorkspaceID"in o.runDetails&&o.runDetails.toWorkspaceID!=null?(s.push(`Found runDetails.toWorkspaceID with value ${o.runDetails.toWorkspaceID}; setting to runDetails.environmentID`),o.runDetails.environmentID=o.runDetails.toWorkspaceID.toString()):(s.push('Setting missing runDetails.environmentID to "0"'),o.runDetails.environmentID="0")),o.runDetails&&"toWorkspaceID"in o.runDetails&&(s.push("Deleting runDetails.toWorkspaceID"),delete o.runDetails.toWorkspaceID),g5m.debug(`Patched run ${n}`,s),o}};var m5m=We("FIREBASE"),Awi=class extends Q_{transformFromStorage(t,n,i){let o=[];return!i.queryResultSequence&&Array.isArray(i.history)&&i.history.length>0&&(o.push("Moving 'history[0]' to 'queryResultSequence'"),i.queryResultSequence=i.history[0]?.queryResultSequence,delete i.history),(i.runExecutionSequenceID===void 0||i.runExecutionSequenceID===null)&&(o.push("Setting 'runExecutionSequenceID' to zero"),i.runExecutionSequenceID=0),(i.name===void 0||i.name===null)&&(o.push("Setting 'name' to 'unknown'"),i.name="unknown"),i.queryResultSequence?.queryResults?.map((s,a)=>{s.isRunning!==!0&&typeof s=="object"&&(s.status||(o.push(`Setting 'status' to 'Failure' for query result ${a}`),s.status="Failure"),s.type||(o.push(`Setting 'type' to 'sql' for query result ${a}`),s.type="sql"),s.exportedRefs||(o.push(`Setting 'exportedRefs' to empty array for query result ${a}`),s.exportedRefs=[]),s.invalidExportedRefs||(o.push(`Setting 'invalidExportedRefs' to empty array for query result ${a}`),s.invalidExportedRefs=[]),s.fields||(o.push(`Setting 'fields' to empty array for query result ${a}`),s.fields=[]),s.sql||(o.push(`Setting 'sql' to empty string for query result ${a}`),s.sql=""),s.rows||(o.push(`Setting 'rows' to empty array for query result ${a}`),s.rows=[]),s.startTime||(o.push(`Setting 'startTime' to ${ofe.toISOString} for query result ${a}`),s.startTime=ofe),s.endTime||(o.push(`Setting 'endTime' to ${ofe.toISOString} for query result ${a}`),s.endTime=ofe),s.fields?.map((u,l)=>{o.push(`Setting 'type' to 'unknown' for field ${l} of query result ${a}`),u.type||(u.type="unknown")}),s.error?.message&&(s.error.errorString||(o.push(`Setting 'error.errorString' to 'error.message' for query result ${a}`),s.error.errorString=s.error.message),o.push(`Removing 'error.message' for query result ${a}`),delete s.error.message),s.error?.originalError&&(o.push(`Removing 'error.originalError' from query result ${a}`),delete s.error.originalError))}),i.runResultVersion=2,i.version=2,o.length>0&&m5m.debug(`Patched run result ${n}`,o),i}};var y5m=zi.merge(RWn),b5m=Os("QueryResult",y5m),mwi=Au(b5m),wfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,mwi,i,o,s)}},Pfa=class extends Ma{constructor(t,n,i,o){super(t,mwi,n,i,o,wfa)}},Nfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,mwi,i,o,s)}},Dfa=class extends Ma{constructor(t,n,i,o){super(t,mwi,n,i,o,Nfa)}},E5m=zi.merge(PWn),C5m=Os("RunResult",E5m),ywi=Au(C5m,new Awi),xfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ywi,i,o,s,["queryResults"])}get queryResults(){return this.getSubCollection("queryResults",Pfa)}queryResult(t){return this.queryResults.get(t)}},hwi=class extends Ma{constructor(t,n,i,o){super(t,ywi,n,i,o,xfa)}},Bfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ywi,i,o,s,["queryResults"])}get queryResults(){return this.getSubCollection("queryResults",Dfa)}queryResult(t){return this.queryResults.get(t)}},gwi=class extends Ma{constructor(t,n,i,o){super(t,ywi,n,i,o,Bfa)}};var OEe=We("FIREBASE"),S5m=M.discriminatedUnion("runType",[zi.merge(J0s),zi.merge(QXu),zi.merge($0s)]),_5m=Os("Run",S5m),Cwi=Au(_5m,new fwi,!0),kfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,Cwi,i,{...o,runID:t},s,["runResults"])}get runResults(){return this.getSubCollection("runResults",hwi)}runResult(t){return this.runResults.get(t)}async updateHeartbeat(t={},n){return this.merge({...t,runHeartbeat:Mk()},{...n,retryOptions:{attempts:3,tags:["[FirestoreRunRepo.updateHeartbeat()]"],waitSeconds:5}})}},bwi=class extends Ma{constructor(t,n,i,o){super(t,Cwi,n,i,o,kfa)}async createDeployRun(t,n){let i=pwi(t.runDetails.environmentID,mo,this.logContext),o={...this.logContext,environmentID:i},s=(l,c)=>(Z1s(l,"deploy",t.runDetails.forcedDeployment,o),{status:"Deploying",currentlyRunningJobs:l.currentlyRunningJobs?l.currentlyRunningJobs.concat(c):[c]}),a={...t,runDetails:{...t.runDetails}};for(let l of BXu)delete a.runDetails[l];let u=await qfa(this,i,a,s,n);return FBe(o,u.id),OEe.infoContext(o,"FirestoreOrgRepo createDeployRun: finished securing workspace"),u}async createRefreshRun(t,n){let i=pwi(t.runDetails.environmentID,mo,this.logContext),o={...this.logContext,environmentID:i},a=await qfa(this,i,t,(u,l)=>(Z1s(u,"refresh",t.runDetails.forceIgnoreWorkspaceStatus,o),{status:u.status==="Failed Deploy"?u.status:"Refreshing",currentlyRunningJobs:u.currentlyRunningJobs?u.currentlyRunningJobs.concat(l):[l]}),n);return FBe(o,a.id),OEe.infoContext(o,"FirestoreOrgRepo createRefreshRun: finished securing workspace"),a}},Lfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,Cwi,i,{...o,runID:t},s,["runResults"])}get runResults(){return this.getSubCollection("runResults",gwi)}runResult(t){return this.runResults.get(t)}async updateHeartbeat(t={}){let n=this.prepareDataForMerge(t);n.runHeartbeat=this.firestoreOperations.getServerTimestampSentinel(),await this.firestoreOperations.updateDoc(this.docRef,n)}},Ewi=class extends Ma{constructor(t,n,i,o){super(t,Cwi,n,i,o,Lfa)}async createDevRun(t){let n=pwi(t.runDetails.environmentID,mo,this.logContext),i={...this.logContext,environmentID:n},o=(a,u)=>{if(!a.devEnv)throw new mo(`Unable to secure ${a.name}`,`${a.name} is a not a development workspace, context=${JSON.stringify(i)}`);return{currentlyRunningDevJobs:a.currentlyRunningDevJobs?a.currentlyRunningDevJobs.concat(u):[u]}};delete t.runDetails.dependencies;let s=await qfa(this,n,t,o);return FBe(i,s.id),OEe.infoContext(i,"FirestoreOrgRepo createDevRun: finished securing workspace"),s}},qfa=(r,t,n,i,o)=>{let s=r.parent.workspace(t),a={...r.logContext,environmentID:t};return r.runTransaction(o,async u=>{OEe.infoContext(a,"securing workspace status");let[l,c]=await Promise.all([FYn(s,vu().featureFlags,a,"FirestoreDevRunsRepo - createRun",u,vu().authToken),r.parent.getNextCounter(r.id.substring(0,r.id.length-1),1,u)]);FBe(a,c),OEe.infoContext(a,"got workspace doc data, updating workspace",{status:l?.status,jobs:l?.currentlyRunningJobs});let d=()=>{try{return i(l,c)}catch(A){if(OEe.errorContext(a,"createRun: error updating workspace",{error:A}),A instanceof cfe){let g=A.detail??`${l.name} is in state ${l.status},`;throw new y3(A.message,g+` context=${JSON.stringify(a)}.`)}throw A}};await s.merge(d(),u),OEe.infoContext(a,`Run ${c} will use the following mappings:`,l.mappingsV1),OEe.infoContext(a,"reserving run");let p=await r.prepareDataForCreate(n,c);p.runStartTime=r.firestoreOperations.getServerTimestampSentinel(),p.runHeartbeat=r.firestoreOperations.getServerTimestampSentinel();let f=r.get(c);return u.transaction.set(f.docRef,p),f})};var v5m=We("FIREBASE"),Swi=class extends Q_{transformFromStorage(t,n,i){let o=i,s=[];o.projects||(o.projects={},s.push("Changing userRoles.projects from undefined to empty object"));let a=(u,l,c,d)=>{let p=l.indexOf(c);p>=0&&(s.push(`Changing ${u} role '${c}' to '${d}'`),l[p]=d)};for(let u of Object.values(o?.projects)){u.projectRoles?(a("project",u.projectRoles,"reader","member"),a("project",u.projectRoles,"owner","admin")):(u.projectRoles=[],s.push("Changing project.projectRoles from undefined to empty array"));for(let l of Object.values(u?.environments))l.environmentRoles?a("env",l.environmentRoles,"owner","admin"):(l.environmentRoles=[],s.push("Changing env.environmentRoles from undefined to empty array"))}return s.length>0&&v5m.debug(`Patched userRoles ${n}`,s),i}};var GNe=We("USER_MANAGEMENT"),T5m=zi.merge(GXu),I5m=Os("UserRoles",T5m),$Ad=Au(I5m,new Swi),zfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,$Ad,i,o,s)}async upsertProjectRoles(t,n,i){return await this.runTransaction(i,async o=>{await this.parent.project(n).fetch(o);let s=await this.fetch(o);(s.projects[n]?.projectRoles.includes("admin")??!1)&&!t.projectRoles.includes("admin")&&await this.throwIfLastProjectAdmin(n,o);let l=Vc(s.projects[n]);return Object.values(t.environments).forEach(c=>{t.projectRoles.includes("member")?c.environmentRoles=[]:t.projectRoles.includes("admin")?c.environmentRoles=["admin"]:c.environmentRoles=["reader"]}),s.projects[n]=t,await this.save(s,o),GNe.infoContext(this.logContext,`User project roles updated for user ${s.id} at project ${n}. Previous roles:`,l,"New roles:",s.projects[n]),s})}async upsertProjectRole(t,n,i){return await this.runTransaction(i,async o=>{await this.parent.project(n).fetch(o);let s=await this.fetch(o);(s.projects[n]?.projectRoles.includes("admin")??!1)&&t!=="admin"&&await this.throwIfLastProjectAdmin(n,o);let l=Vc(s.projects[n]),c=s.projects[n];return c?c.projectRoles=[t]:s.projects[n]={projectRoles:[t],environments:{}},await this.save(s,o),GNe.infoContext(this.logContext,`User project roles updated for user ${s.id} at project ${n}. Previous roles:`,l,"New roles:",s.projects[n]),s})}async upsertUserOrganizationRoles(t,n){return await this.runTransaction(n,async i=>{let o;try{o=await this.fetch(i)}catch(c){if(y1(c)&&(c instanceof Ya||c instanceof m3))o={id:this.id,organizationRoles:[],projects:{}};else throw c}let s=o.organizationRoles.includes("admin"),a=t.includes("admin");s&&!a&&await this.throwIfLastOrgAdmin(i);let l=Vc(o.organizationRoles);return o.organizationRoles=t,await this.save(o,i),GNe.infoContext(this.logContext,`User org roles updated for user ${o.id}. Previous roles:`,l,"New roles:",o.organizationRoles),o})}async upsertEnvironmentRoles(t,n,i,o){return await this.runTransaction(o,async s=>{let a=await this.parent.workspace(i).fetch(s);if(a.project!==n||a.devEnv)throw new Ya(`Environment ${i} not found`);let u=await this.fetch(s);if(!u.projects[n]?.projectRoles.length)throw new m3("User must have a project role before being granted any environment roles therein");(u.projects[n]?.environments[i]?.environmentRoles.includes("admin")??!1)&&!t.environmentRoles.includes("admin")&&await this.throwIfLastEnvironmentAdmin(n,i,s);let d=Vc(u.projects[n].environments[i]);return u.projects[n].environments[i]=t,await this.save(u,s),GNe.infoContext(this.logContext,`User env roles updated for user ${u.id} at envID ${i} in project ${n}. Previous roles:`,d,"New roles:",u.projects[n].environments[i]),u})}async upsertEnvironmentRole(t,n,i,o,s){return await this.runTransaction(s,async a=>{let u=await this.parent.workspace(i).fetch(a);if(u.project!==n||u.devEnv)throw new Ya(`Environment ${i} not found`);let l=await this.fetch(a);if((l.projects[n]?.environments[i]?.environmentRoles.includes("admin")??!1)&&t!=="admin"&&await this.throwIfLastEnvironmentAdmin(n,i,a),!l.projects[n]?.projectRoles.length)if(o?.setDefaultProjectRole)l.projects[n]?l.projects[n].projectRoles=[o.setDefaultProjectRole]:l.projects[n]={projectRoles:[o.setDefaultProjectRole],environments:{}};else throw new m3("User must have a project role before being granted any environment roles therein");let p=Vc(l.projects[n].environments[i]),f=l.projects[n].environments[i];return f?f.environmentRoles=[t]:l.projects[n].environments[i]={environmentRoles:[t]},await this.save(l,a),GNe.infoContext(this.logContext,`User env roles updated for user ${l.id} at envID ${i} in project ${n}. Previous roles:`,p,"New roles:",l.projects[n].environments[i]),l})}async deleteUserProjectRoles(t,n){return await this.runTransaction(n,async i=>{let o=await this.fetch(i);(o.projects[t]?.projectRoles.includes("admin")??!1)&&await this.throwIfLastProjectAdmin(t,i);let a=Vc(o.projects[t]);delete o.projects[t],await this.save(o,i),GNe.infoContext(this.logContext,`User project roles deleted for user ${o.id} at projectID ${t}. Previous roles:`,a)})}async deleteUserEnvironmentRoles(t,n,i){return await this.runTransaction(i,async o=>{let s=await this.fetch(o);(s?.projects[t]?.environments[n]?.environmentRoles.includes("admin")??!1)&&await this.throwIfLastEnvironmentAdmin(t,n,o);let u=Vc(s.projects[t].environments[n]);delete s.projects[t].environments[n],await this.save(s,o),GNe.infoContext(this.logContext,`User environment roles deleted for user ${s.id} at envID ${n} in project ${t}. Previous roles:`,u)})}async throwIfLastOrgAdmin(t){return await this.runTransaction(t,async n=>{if((await this.parent.userRoles.select({where:[["organizationRoles","array-contains","admin"]]},n)).length<2)throw new y3("Role change failed, at least one org admin is required")})}async throwIfLastProjectAdmin(t,n){return await this.runTransaction(n,async i=>{if((await this.parent.userRoles.select({where:[[`projects.${t}.projectRoles`,"array-contains","admin"]]},i)).length<2)throw new y3("Role change failed, at least one project admin is required")})}async throwIfLastEnvironmentAdmin(t,n,i){return await this.runTransaction(i,async o=>{let s=await this.parent.userRoles.select({where:[[`projects.${t}.environments.${n}.environmentRoles`,"array-contains","admin"]]},o),a=await this.parent.userRoles.select({where:[[`projects.${t}.projectRoles`,"array-contains","admin"]]},o),u=s.length<2;if(!a.length&&u)throw new y3("Role change failed, at least one environment admin is required")})}},_wi=class extends Ma{constructor(t,n,i,o){super(t,$Ad,n,i,o,zfa)}};var O5m=We("FIREBASE"),vwi=class extends Q_{transformFromStorage(t,n,i){let o=i,s=[];return o.status||(s.push("setting missing 'status' property to 'initializing'"),o.status="Initializing"),o.version||(s.push(`setting missing 'version' property to '${PFe}'`),o.version=PFe),o.tagColors||(s.push("Setting missing 'tagColors' property to default"),o.tagColors={backgroundColor:Ahs,textColor:"#e5e5e5"}),o.mappingsV1||(s.push("Setting missing 'mappingsV1' property to '{}'"),o.mappingsV1="{}"),o.version===0&&(o.mappings||(s.push("Setting missing 'mappings' property to empty object"),o.mappings={}),o.deployedWorkspaces||(s.push("Setting missing 'deployedWorkspaces' property to empty object"),o.deployedWorkspaces={})),(o.mappingsV1===null||o.mappingsV1===void 0)&&(s.push("Settings missing 'mappingsV1' property to an empty string"),o.mappingsV1=""),o.name||(o.name=`Workspace${t}`,s.push(`Setting missing 'name' property to '${o.name}`)),s.length>0&&O5m.debug(`Patched workspace ${n}:`,s),o}};var R5m=zi.merge(BFe),M5m=Os("InstalledPackage",R5m),XAd=Au(M5m),Ffa=class extends Ra{constructor(t,n,i,o,s){super(t,n,XAd,i,o,s)}},Twi=class extends Ma{constructor(t,n,i,o){super(t,XAd,n,i,o,Ffa)}};var w5m=zi.merge(SK),P5m=Os("Job",w5m),ZAd=Au(P5m),Qfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ZAd,i,o,s)}async fetchAndMerge(t,n){return n?.uniquenessConstraints?this.runTransaction(n,async i=>{let o=await this.fetch(i);if(o.name!==t.name&&(await this.parent.jobs.select({where:[[n.uniquenessConstraints.field,"in",n.uniquenessConstraints.values]]},i)).length>0)throw new y3(`${n.uniquenessConstraints.field} must be unique`);return super.save(super.mergeWithDeletes(o,t),i)}):super.fetchAndMerge(t,n)}},Iwi=class extends Ma{constructor(t,n,i,o){super(t,ZAd,n,i,o,Qfa)}async generateID(t){return t.id??this.parent.parent.getNextCounter("job")}createEntity(t,n){return n?.uniquenessConstraints?this.runTransaction(n,async i=>{if((await this.select({where:[[n.uniquenessConstraints.field,"in",n.uniquenessConstraints.values]]},i)).length>0)throw new y3(`${n.uniquenessConstraints.field} must be unique`);return await super.createEntity(t,i)}):super.createEntity(t,n)}};var N5m=zi.merge(aL),D5m=Os("Macro",N5m),ehd=Au(D5m,void 0,!0),Ufa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ehd,i,o,s)}},Owi=class extends Ma{constructor(t,n,i,o){super(t,ehd,n,i,o,Ufa)}};var x5m=zi.merge(xFe),B5m=Os("NodeType",x5m),thd=Au(B5m),jfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,thd,i,o,s)}},Rwi=class extends Ma{constructor(t,n,i,o){super(t,thd,n,i,o,jfa)}async generateID(t){return t.id??(await this.parent.parent.getNextCounter("template")).toString()}};var k5m=M.discriminatedUnion("type",[zi.merge(yi.merge(EK)),zi.merge(yi.merge(CK))]),L5m=Os("Node",k5m),rhd=Au(L5m,new XKn),Gfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,rhd,i,{...o,nodeID:t},s)}async delete(t){if(await super.delete(t),this.docRef.parent.id==="steps"){let n=this.firestoreOperations.collectionRef(this.docRef.parent.parent,"deletedSteps"),i=this.firestoreOperations.docRef(n,this.id);await this.firestoreOperations.saveDoc(i,{deletedAt:this.firestoreOperations.getServerTimestampSentinel()})}}mergeMetadata(t,n){return this.merge(Object.fromEntries(Object.entries(t).map(([i,o])=>[`metadata.${i}`,o])),n)}},Mwi=class extends Ma{constructor(t,n,i,o){super(t,rhd,n,i,o,Gfa)}async generateID(t){return t.id??Za()}listenCollection(t,n,i){throw new Yp("The firestore nodes repository listener is not implemented. Use listenCollectionOverride")}listenCollectionOverride(t,n,i,o,s){let[a,u]=this.getListenCallbacks(t,o,s),l=this.firestoreOperations.onCollectionSnapshot(this.collectionRef.orderBy("updatedAt").startAfter(n),a,u),c=p=>{let A=[...p.docChanges()].map(g=>({type:"removed",id:g.doc.id,doc:g.doc,oldIndex:-1,newIndex:-1})).filter(g=>{let b=g.doc.data(),_=i[g.doc.id];if(_)if(_.updatedAt){let v=new Date(_.updatedAt),O=b.deletedAt?b.deletedAt.toDate():v;return v<=O}else return!0;return!1}).map(g=>({type:"removed",value:{id:g.doc.id},id:g.doc.id,hasPendingWrites:!1}));t(A)},d=this.firestoreOperations.onCollectionSnapshot(this.collectionRef.parent.collection("deletedSteps").orderBy("deletedAt").startAfter(n),c,u);return()=>{l(),d()}}convertFromRestAPIStorage(t,n){return this.transformDataFromStorage({id:n},t)}async getNodesLocationInfo(){let t=this.firestoreOperations.createQuery(this.collectionRef,{selectFields:["id","name","locationName","sqlType","type"]}),n=await this.firestoreOperations.runQuery(t),i={};return n.forEach(o=>{let s=H$u.verify({operation:{...o.data()}});i[o.id]=s}),i}};var q5m=zi.merge(mXu),z5m=Os("NodeLastRefreshed",q5m),nhd=Au(z5m,void 0,!0),Hfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,nhd,i,{...o,nodeID:t},s)}},wwi=class extends Ma{constructor(t,n,i,o){super(t,nhd,n,i,o,Hfa)}async generateID(t){return t.id??Za()}};var F5m=zi.merge(VIe),Q5m=Os("Subgraph",F5m),ihd=Au(Q5m),Wfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ihd,i,o,s)}fetchAndMerge(t,n){return n?.uniquenessConstraints?this.runTransaction(n,async i=>{if((await this.fetch(i)).name!==t.name&&(await this.parent.subgraphs.select({where:[[n.uniquenessConstraints.field,"in",n.uniquenessConstraints.values]]},i)).length>0)throw new y3(`${n.uniquenessConstraints.field} must be unique`);let a=this.prepareDataForMerge(t,n);return i.transaction.update(this.docRef,a)}):super.fetchAndMerge(t,n)}},Pwi=class extends Ma{constructor(t,n,i,o){super(t,ihd,n,i,o,Wfa)}async generateID(t){return t.id??(await this.parent.parent.getNextCounter("subgraph")).toString()}async createEntity(t,n){let i=await this.generateID(t);return n?.uniquenessConstraints?this.runTransaction(n,async o=>{if((await this.select({where:[[n.uniquenessConstraints.field,"in",n.uniquenessConstraints.values]]},o)).length>0)throw new y3(`${n.uniquenessConstraints.field} must be unique`);return super.createEntity({...t,id:i},o)}):super.createEntity({...t,id:i},n)}};var U5m=We("FIREBASE"),Nwi=class extends Q_{transformFromStorage(t,n,i){let o=[];return["connectionDetails","authenticator"].forEach(s=>{i?.connectionDetails?.hasOwnProperty(s)&&(o.push(`deleting property 'connectionDetails.${s}']`),delete i.connectionDetails[s])}),o.length>0&&U5m.debug(`Patched workspace user ${n}`,o),i}};var j5m=M.union([zi.merge(smt),zi.merge(amt),zi.merge(umt),zi.merge(cmt)]),G5m=Os("WorkspaceUser",j5m),ohd=Au(G5m,new Nwi),Vfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ohd,i,o,s)}},Dwi=class extends Ma{constructor(t,n,i,o){super(t,ohd,n,i,o,Vfa)}};var H5m=zi.merge(iWn),W5m=Os("Workspace",H5m),shd=Au(W5m,new vwi,!0),Kfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,shd,i,o,s,["jobs","macros","nodes","nodeTypes","subgraphs","workspaceUsers","installedPackages","nodesLastRefreshed"])}get installedPackages(){return this.getSubCollection("installedPackages",Twi)}installedPackage(t){return this.installedPackages.get(t)}get jobs(){return this.getSubCollection("jobs",Iwi)}job(t){return this.jobs.get(t)}get macros(){return this.getSubCollection("macros",Owi)}macro(t){return this.macros.get(t)}get nodes(){return this.getSubCollection("steps",Mwi)}node(t){return this.nodes.get(t)}get nodesLastRefreshed(){return this.getSubCollection("nodesLastRefreshed",wwi)}nodeLastRefreshed(t){return this.nodesLastRefreshed.get(t)}get nodeTypes(){return this.getSubCollection("templates",Rwi)}nodeType(t){return this.nodeTypes.get(t)}get subgraphs(){return this.getSubCollection("folders",Pwi)}subgraph(t){return this.subgraphs.get(t)}get workspaceUsers(){return this.getSubCollection("users",Dwi)}workspaceUser(t){return this.workspaceUsers.get(t)}async isDevEnv(){return!!(await this.fetch()).devEnv}async removeDeletedSteps(){let n=this.firestoreOperations.collectionRef(this.docRef,"deletedSteps").orderBy("__name__").limit(100),i=async(o,s)=>{try{let a=this.parent.parent.batch(),u=await n.get();if(u.size===0){o();return}let c=[...u.docs].map(d=>({docRef:d.ref}));for(let d of c)await a.delete(d,{});await a.commit(),process.nextTick(()=>{i(o,s)})}catch(a){s(a)}};return new Promise((o,s)=>i(o,s))}},xwi=class extends Ma{constructor(t,n,i,o){super(t,shd,n,i,o,Kfa)}async generateID(t){return t.id??this.parent.getNextCounter("workspace")}async fetchWorkspacesForPermissions(t){let n=this.firestoreOperations.createQuery(this.collectionRef,{selectFields:["id","project"],where:[["devEnv","==",t]]});return(await this.firestoreOperations.runQuery(n)).docs.map(s=>s.data())}};var V5m=zi.merge(OWn),K5m=Os("Org",V5m),ahd=Au(K5m,new awi),Y5m={gitRepo:"gitRepo",workspace:"workspace",job:"job",subgraph:"folder",location:"location",connection:"connection",template:"template",run:"run",devRun:"devRun"},Yfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ahd,i,{...o,orgID:t},s,["devRuns","globalUsersSettings","projects","runs","userRoles","workspaces"])}get devRuns(){return this.getSubCollection("devRuns",Ewi)}devRun(t){return this.devRuns.get(t)}get globalUsersSettings(){return this.getSubCollection("globalUsersSettings",lwi)}globalUsersSetting(t){return this.globalUsersSettings.get(t)}get projects(){return this.getSubCollection("projects",dwi)}project(t){return this.projects.get(t)}get runs(){return this.getSubCollection("runs",bwi)}run(t){return this.runs.get(t)}get userRoles(){return this.getSubCollection("userRoles",_wi)}userRole(t){return this.userRoles.get(t)}get workspaces(){return this.getSubCollection("workspaces",xwi)}workspace(t){return this.workspaces.get(t)}async getNextCounter(t,n=1,i){if(!n||n<=0)throw new Pee(`getNextCounter() expected reserveCount value greater than zero, received ${n}`);let o=Y5m[t];if(!o)throw new Pee(`getNextCounter() received unsupported counter name '${t}'`);return this.runTransaction(i,async s=>{let a=await this.fetch(s),u=`${o}Counter`,l=u in a?a[u]??0:0;return await this.merge({[u]:l+n},s),l+1})}async releaseWorkspaceStatusAndEndRun(t,n,i,o,s,a){return this.runTransaction(a,async u=>{let l=this.workspace(t),c=await l.fetch(u),{newStatus:d,remainingActiveRuns:p}=await o();c.status=d??c.status,i==="run"?c.currentlyRunningJobs=p:c.currentlyRunningDevJobs=p,await l.save(c,u);let f=this[i](n);return u.transaction.update(f.docRef,{...f.prepareDataForMerge(s,u),runEndTime:this.firestoreOperations.getServerTimestampSentinel()}),c.status})}async updateLastLoginTime(){let t=this.prepareDataForMerge({});t.lastLoginTime=this.firestoreOperations.getServerTimestampSentinel(),await this.firestoreOperations.updateDoc(this.docRef,t)}async writePlanAnalytics(t,n){let i=this.firestoreOperations.collectionRef(this.docRef,"planAnalytics"),o=this.firestoreOperations.docRef(i,t);await this.firestoreOperations.saveDoc(o,n)}async writeRunAnalyticsSummary(t,n,i,o,s,a){let u=this[n](t),l=this.firestoreOperations.collectionRef(u.docRef,"analyticsSummary"),c=this.firestoreOperations.docRef(l,"summary"),d=this.firestoreOperations.docRef(l,"runPhases"),p=this.firestoreOperations.batch();if(this.firestoreOperations.saveDocBatch(p,c,i),this.firestoreOperations.saveDocBatch(p,d,o),s){let f=this.firestoreOperations.docRef(l,"planPhases");this.firestoreOperations.saveDocBatch(p,f,s)}if(await this.firestoreOperations.commitBatch(p),a.length>0){let f=this.firestoreOperations.collectionRef(d,"queries"),A=500;for(let g=0;g<a.length;g+=A){let b=this.firestoreOperations.batch();a.slice(g,g+A).forEach((v,O)=>{let R=`${v.nodeId}-${v.stageName}-${g+O}`,w=this.firestoreOperations.docRef(f,R);this.firestoreOperations.saveDocBatch(b,w,v)}),await this.firestoreOperations.commitBatch(b)}}}},Bwi=class extends Ma{constructor(t,n,i,o){super(t,ahd,n,i,o,Yfa)}};var J5m=zi.merge(SXu),$5m=Os("OrgPublic",J5m),uhd=Au($5m),Jfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,uhd,i,{...o,orgID:t},s)}},kwi=class extends Ma{constructor(t,n,i,o){super(t,uhd,n,i,o,Jfa)}};var X5m=zi.merge(pWn),Z5m=Os("RegistryPackageRelease",X5m),chd=Au(Z5m),$fa=class extends Ra{constructor(t,n,i,o,s){super(t,n,chd,i,o,s)}},Lwi=class extends Ma{constructor(t,n,i,o){super(t,chd,n,i,o,$fa)}};var e6m=zi.merge(fWn),t6m=Os("RegistryPackage",e6m),lhd=Au(t6m),Xfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,lhd,i,o,s,["releases"])}get releases(){return this.getSubCollection("releases",Lwi)}release(t){return this.releases.get(t)}},qwi=class extends Ma{constructor(t,n,i,o){super(t,lhd,n,i,o,Xfa)}};var r6m=zi.merge(OXu),n6m=Os("ActivePrompt",r6m),dhd=Au(n6m),i6m=zi.merge(RXu),o6m=Os("PromptVersion",i6m),phd=Au(o6m),Zfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,dhd,i,{...o,nodeID:t},s)}},eAa=class extends Ra{constructor(t,n,i,o,s){super(t,n,phd,i,{...o,nodeID:t},s)}},zwi=class extends Ma{constructor(t,n,i,o){super(t,dhd,n,i,o,Zfa)}},Fwi=class extends Ma{constructor(t,n,i,o){super(t,phd,n,i,o,eAa)}};var s6m=We("FIREBASE"),Qwi=class extends Q_{transformFromStorage(t,n,i){return i.accountType||(s6m.debug(`Patched user ${n}: Setting accountType to 'normal'`),i.accountType="normal"),i}};var a6m=zi.merge(nfs),u6m=Os("User",a6m),fhd=Au(u6m,new Qwi),tAa=class extends Ra{constructor(t,n,i,o,s){super(t,n,fhd,i,o,s)}},Uwi=class extends Ma{constructor(t,n,i,o){super(t,fhd,n,i,o,tAa)}};var jwi=class extends IEe{constructor(t){super("root",t.db,["orgs","users","packagesRegistry","events"],void 0,t.currentLogContext(),t)}get path(){return""}get orgs(){return this.getSubCollection("orgs",Bwi)}org(t){return this.orgs.get(t)}get orgsPublic(){return this.getSubCollection("orgsPublic",kwi)}orgPublic(t){return this.orgsPublic.get(t)}get users(){return this.getSubCollection("users",Uwi)}user(t){return this.users.get(t)}get packagesRegistry(){return this.getSubCollection("packagesRegistry",qwi)}registryPackage(t){return this.packagesRegistry.get(t)}get events(){return this.getSubCollection("events",owi)}event(t){return this.events.get(t)}get oauthStates(){return this.getSubCollection("oauthState",swi)}oauthState(t){return this.oauthStates.get(t)}get activePrompts(){return this.getSubCollection("activePrompts",zwi)}activePrompt(t){return this.activePrompts.get(t)}get promptVersions(){return this.getSubCollection("promptVersions",Fwi)}promptVersion(t){return this.promptVersions.get(t)}batch(){return new $Mi(this.firestoreOperations)}getRepositoryFromPath(t){let n=t.split("/"),i,o;if(n.length){n[0].length||n.shift();for(let s of n)if(i)o=i.get(s),i=void 0;else{if(i=(o??this)[s],!i)return;o=void 0}}return i||o||this}storage(){return new XMi(this.firestoreOperations)}};var Gwi=(r,t,n)=>{let i=new ZMi,o=new jwi(r),s=new iwi({...t,eventManager:i},{});return BAd(o,{firebase:o,service:s},n,()=>new twi(o,s,()=>n("",{}).shouldMutateBoth))};var d6m=_t(Fgi());var hhd=()=>{let r=process.env.VITEST_HEARTBEAT_WORKER_PATH_OVERRIDE;if(r&&r!=="undefined")return r;let t="heartbeat-worker.js",n=s=>(0,nAa.join)(s,t),i=s=>(0,nAa.join)(s,"..","build-coa",t),o=n(__dirname);if((0,rAa.existsSync)(o))return o;for(let s of module.paths)for(let a of[n,i]){let u=a(s);if((0,rAa.existsSync)(u))return u}throw new et("Could not find a worker path")};var ghd=(0,Ahd.promisify)(setTimeout),iAa=r=>{if(!r)return;let t=parseInt(r);return isNaN(t)?void 0:t};var p6m=fB.getTracer(Ukt()??"unknown-context"),Hwi=class{logTag="[ManagedHeartbeatWorker]";logContext;task;worker;triggerExit;exitPromise;constructor(t,n,i,o){let{HEARTBEAT_CHECKIN_TIME:s,HEARTBEAT_MAX_LIFESPAN:a}=process.env,u=iAa(s)||5,l=iAa(a)||1/0;this.task={orgID:t,runID:n,runType:i,interval:u,lifespan:l,modality:o},this.logContext={...this.task};let{promise:c,resolve:d}=aT();this.exitPromise=c,this.triggerExit=d}start(){let{runType:t}=this.task,n=p6m.startSpan("run-heartbeat",{attributes:{runType:t}}),i=hhd();We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Starting worker, using path:",i),this.worker=new mhd.Worker(i,{env:process.env,workerData:this.task}),this.worker.on("online",()=>{We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Worker online")}),this.worker.on("exit",o=>{We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Worker exited with code",o),this.triggerExit(),n.end()}),this.worker.on("message",o=>{We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Worker message:",o)}),this.worker.on("error",o=>{We("HEARTBEAT").fatalContext(this.logContext,this.logTag,"Worker error:",o)})}async stop(){if(!this.worker)throw new et("Worker was never started!");We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Shutting down worker"),this.worker.postMessage("shutdown"),await Promise.race([this.exitPromise,ghd(1e3).then(()=>this.worker?.terminate())]),We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Finished shutting down worker")}};var REe=(r,t,n="nonCLI")=>{let i=new Hwi(t.parent.id,t.id,r,n);return i.start(),()=>i.stop()};var yhd=(r,t,n,i)=>{if(t.kind==="none")throw new Aue(t.kind,"CreateActiveRunInfoFromDevRun");let o=ije(r.userCredentials,t),s={userID:n,userCredentials:o,runTimeParameters:r.runTimeParameters,runDetails:{...r.runDetails,jobID:pmt(r.runDetails.jobID)},runStatus:i?"waitingToRun":"initializing",runType:"devRun",kubernetesJobUuid:i,origin:r.origin};return B3(s),s};var nx=We("RUNNER_BACKEND");var oAa=r=>r.map(t=>t.toLowerCase()),qAC=new Set(["accesstoken","authcode","clientsecret","code","codeverifier","id_token","keypair","newpassword","password","refresh_token","snowflakekeypair","snowflakepassword","token","uid","serviceaccountkey",...oAa(wFe),...oAa(EWn),...oAa(LFe)]);var sAa=(r,t,n,i)=>{let o=ije(r.userCredentials,t);return{runTimeParameters:r.runTimeParameters,runDetails:r.runDetails,userCredentials:o,runStatus:i?"waitingToRun":"initializing",userID:n,runType:"deploy",kubernetesJobUuid:i,origin:r.origin}},bhd=async(r,t,n,i,o,s)=>{let a=new cT(nx,o),{measure:u,printSummary:l}=P1("[BECLI_HandleDeploy] end-to-end execution",o),{teamInfo:{fbTeamID:c,fbUserID:d},rootRepository:p}=t,{runDetails:{environmentID:f,parallelism:A,phasedNodeEdits:g,planID:b}}=r,_=p.org(c),v=parseInt(f);nx.infoContext(o,"Initializing deploy! planId:",b);let O;try{let R=await u("create user context",()=>b6(p,c,d,v,n,o)),w=await u("prepare deploy configuration",()=>{let H=HNe(R,d);return r.runDetails.fromWorkspaceData.userConnections={[v]:{[d]:H}},nx.appContext(o,Yyt(R),"BECLI_HandleDeploy"),sAa(r,R,d,s)}),{connectionManager:P,platform:z}=await u("get backend platform",()=>{let H=Math.max(...Object.values(g).map(L=>Object.keys(L).length));return fae(R,t,lie(H,s?1:A),!0,o)}),j=(H,L,W)=>pei({allWorkspaceData:w.runDetails.fromWorkspaceData,connectionManager:P,logContext:L,platform:z,renderer:i,runID:H,runInfo:w,nodesInRun:hAe(g),teamInfoAndFirebase:t,workspaceID:v,memoryMonitor:new BB},W),U=await u("create run and setup pipeline",()=>lAa(!!s,w,_,P,j,o));O=U.runCounter;let G={...o,runID:O};return await u("save pre-deploy workspace",()=>f6m(p,t,O,v,d,G)),U}catch(R){throw nx.errorContext(o,`Error during deploy for plan ${b}:`,R,R instanceof Error?R.stack:void 0),R}finally{if(!s){let R=performance.now();a.logMetric("deploy-execution",{orgID:c,planID:b,runID:O,workspaceID:v});let w=performance.now()-R;nx.infoContext(o,`[BECLI_HandleDeploy] logMetric took ${(w/1e3).toFixed(3)} seconds`),l()}}},f6m=async(r,t,n,i,o,s)=>{try{let a=`run-${n}.predeploy`,u=`user/${o}/environment/${i}/workspacePreDeploy/${a}`,l=await r.org(t.teamInfo.fbTeamID).workspace(i).fetch();nx.appContext(s,"saving workspace data",l),await r.storage().uploadFile(u,l),nx.appContext(s,`Run ${n}: Saved pre-deploy workspace state to ${u}`)}catch(a){nx.errorContext(s,"Error while saving preDeploy workspace state: ",a)}},aAa=r=>{let{runDetails:t}=r;if(t.jobID&&(t.includeNodesSelector||t.excludeNodesSelector))throw new Error("Unable to process, don't provide a JobID and Node Include/Exclude Selector(s) for 1 Refresh Run")},uAa=(r,t,n,i)=>{let o=ije(r.userCredentials,t),s={runTimeParameters:r.runTimeParameters,runDetails:{...r.runDetails,jobID:pmt(r.runDetails.jobID)},userCredentials:o,runStatus:i?"waitingToRun":"initializing",userID:n,runType:"refresh",kubernetesJobUuid:i,origin:r.origin};return B3(s),s},HNe=(r,t)=>TB(r,{snowflake:n=>{let i={connectionDetails:{userID:t,user:n.user,role:n.role,warehouse:n.warehouse},connectionType:n.authenticator};return n.authenticator==="KeyPair"&&(i.connectionDetails.keyPair=n.keyPairKey),i},databricks:n=>({connectionKind:"databricks",connectionType:n.authenticator,connectionDetails:{userID:t,path:n.path}}),fabric:n=>({connectionKind:"fabric",connectionType:n.authenticator,connectionDetails:{userID:t,connectionString:n.connectionString}}),bigquery:n=>({connectionKind:"bigquery",connectionType:n.authenticator,connectionDetails:{userID:t,clientEmail:n.clientEmail??""}})}),Ehd=async(r,t,n,i,o,s)=>{let{rootRepository:a,teamInfo:{fbTeamID:u,fbUserID:l}}=t,{runDetails:{environmentID:c,jobID:d,parallelism:p}}=r,f=parseInt(c),A=a.org(u);aAa(r);let g=pmt(d);if(!g)nx.infoContext(o,"No job ID, refreshing all steps");else{nx.infoContext(o,"Refreshing job:",g);try{await A.workspace(f).job(g).fetch()}catch(j){throw nx.errorContext(o,`Failed to fetch job ${g}:`,j),j instanceof Ya?JPn(400,`Unable to start job ${g}`,`Job ${g} did not exist`):j}}let b=await b6(a,u,l,f,n,o),_=HNe(b,l);nx.appContext(o,Yyt(b),"BECLI_HandleRefresh"),r.runTimeParameters=await MEe(a,u,f,r.runTimeParameters);let v=uAa(r,b,l,s),O={steps:{},folders:{},jobs:{},macros:{},stepTypes:{}},R=new Set;s||(O=await g3e(f,A,new BB),O.userConnections[f][l]=_,R=tGe(v.runDetails,O)),v.runDetails.refreshDescription=KQe(v.runDetails,O.jobs);let{connectionManager:w,platform:P}=await fae(b,t,s?1:lie(R.size,p),!0,o);return lAa(!!s,v,A,w,(j,U,G)=>eGe({allWorkspaceData:O,connectionManager:w,logContext:U,platform:P,renderer:i,runID:j,runInfo:v,nodesInRun:R,teamInfoAndFirebase:t,workspaceID:f,memoryMonitor:new BB},G),o)};var A6m=async(r,t,n)=>{let o=(await r.org(t).workspace(n).fetch()).runTimeParameters??"";return LKn(o)},MEe=async(r,t,n,i)=>i?qKn(i):A6m(r,t,n),cAa=async(r,t,n,i,o,s)=>{let a=ije(t.userCredentials,i),u=await MEe(r,o.fbTeamID,parseInt(n.runDetails.environmentID),t.runTimeParameters);return n.runType==="refresh"&&(t.runDetails.forceIgnoreWorkspaceStatus!==void 0?n.runDetails.forceIgnoreWorkspaceStatus=t.runDetails.forceIgnoreWorkspaceStatus:n.runDetails.forceIgnoreWorkspaceStatus!==void 0&&delete n.runDetails.forceIgnoreWorkspaceStatus,n.runDetails.executor=t.runDetails.executor),{kubernetesJobUuid:s,origin:t.origin,reRunID:t.runDetails.runID,runDetails:n.runDetails,runStatus:s?"waitingToRun":"initializing",runTimeParameters:u,runType:"refresh",userCredentials:a,userID:o.fbUserID,version:3}},Chd=async(r,t,n,i,o,s,a)=>{let{runDetails:{environmentID:u,parallelism:l},runStatus:c,runType:d}=t,{runDetails:{runID:p}}=r;if(c!=="failed")throw new et(`Run status '${c}' is not eligible for re-run. Only failed jobs can be re-run!`);if(d!=="refresh")throw new et(`Run type '${d}' is not eligible for re-run`);if(!p)throw new et(`Invalid rerun ID '${p}'`);let{rootRepository:f,teamInfo:A,teamInfo:{fbTeamID:g,fbUserID:b}}=n,_=f.org(g),v=parseInt(u),O=await b6(f,g,b,v,i,s),R=HNe(O,b),w=await cAa(f,r,t,O,A,a),P=await g3e(v,_,new BB);w.runDetails.refreshDescription=KQe(w.runDetails,P.jobs),P.userConnections[v][b]=R;let z=await fei(_,w,P),{platform:j,connectionManager:U}=await fae(O,n,lie(z.size,a?1:l),!0,s);return lAa(!!a,w,_,U,(H,L,W)=>eGe({allWorkspaceData:P,connectionManager:U,logContext:L,platform:j,renderer:o,runID:H,runInfo:w,nodesInRun:z,teamInfoAndFirebase:n,workspaceID:v,memoryMonitor:new BB},W),s)},Shd=r=>_hd(r,"runCounter"),Hot=r=>_hd(r,"environment ID"),_hd=(r,t)=>{let n=typeof r=="number"?r:parseInt(r||"");if(!r||isNaN(n))throw new mo(`Specify a valid ${t}`,`400: ${n} is not valid`);return n},lAa=async(r,t,n,i,o,s)=>{if(r){try{nx.appContext(s,`tearing down connection manager for cloud ${t.runType} run`),await i.teardown()}catch(f){nx.errorContext(s,`error tearing down connection manager for cloud ${t.runType} run. Swallowing error.`,f)}let{runRepository:d,logContext:p}=await aCs(t,n,s);return{runCounter:d.id,logContext:p,runCompletion:Promise.resolve()}}let{runRepository:a,logContext:u}=await aCs(t,n,s),l=a.id,c=REe(t.runType,a,t.origin==="CLI"?"CLI":"nonCLI");return{runCounter:l,logContext:u,runCompletion:o(l,u,c)}};var h6m=new Map([["securetoken.googleapis.com",{path:"/securetoken",featureFlagName:"proxyGoogleAuth",enableByDefault:!1}],["identitytoolkit.googleapis.com",{path:"/identitytoolkit",featureFlagName:"proxyGoogleAuth",enableByDefault:!1}]]),vhd=r=>{let t=h6m.get(r.hostname);if(t&&fSe(t.enableByDefault,t.featureFlagName)){let n=new URL(OBe()),i=n.pathname;i.endsWith("/")&&(i=i.slice(0,-1)),r.pathname=i+t.path+r.pathname,r.hostname=n.hostname,r.protocol=n.protocol,r.port=n.port}return r};var Thd=async()=>{let r=fd.interceptors.request.use(t=>(typeof t.url=="string"&&(t.url=vhd(new URL(t.url)).toString()),t));return()=>fd.interceptors.request.eject(r)};var Ihd=_t(gUe());var Wot=We("FIREBASE"),g6m=3,Wwi=class extends jot{_backendUrl;_bucketPath;_forceBypassProxy;_baseStorageUrl;_axiosClient;constructor(t){super(t.storage),this._bucketPath=`v0/b/${t.bucket}/o`,this._backendUrl=t?.backendUrl??mm(),this._forceBypassProxy=!!t?.forceBypassProxy,this._axiosClient=t?.axiosClient,this._baseStorageUrl=t.emulatorStorageHost?`http://${t.emulatorStorageHost}`:"https://firebasestorage.googleapis.com"}async uploadToStorage(t,n){if(!this.isProxyEnabled)return super.uploadToStorage(t,n);Wot.info(`Uploading file to '${t}' via proxy`);let i=(0,Ihd.gzip)(new TextEncoder().encode(JSON.stringify(n))),o=await this.axios();try{let s=await o.post(this.determineProxyUrl(this._bucketPath,{name:t}),{contentEncoding:"gzip",contentType:"application/json",name:t},{headers:{Authorization:`Firebase ${await this.token()}`,"X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${i.length}`,"X-Goog-Upload-Header-Content-Type":"application/json","X-Goog-Upload-Protocol":"resumable"}}),a=s.headers["x-goog-upload-url"];ed(a,"Missing upload URL in firebase cloud storage upload response","FIREBASE"),a=await this.determineProxyUrl(a);let u=+s.headers["x-goog-upload-chunk-granularity"]||262144,c=i.length,d=0;for(;c>u;){let p=Math.min(c,u),f=d+p,A=i.slice(d,f);await this.uploadChunk(a,A,d,!1),c-=p,d+=p}await this.uploadChunk(a,i.slice(d),d,!0)}catch(s){throw this.handleAxiosError(s)}}async downloadFromStorage(t){if(!this.isProxyEnabled)return super.downloadFromStorage(t);Wot.info(`Downloading file from '${t}' via proxy`);let n=await this.axios();try{return(await n.get(this.determineProxyUrl(`${this._bucketPath}/${encodeURIComponent(t)}`,{alt:"media"}),{headers:{Authorization:`Firebase ${await this.token()}`}})).data}catch(i){throw this.handleAxiosError(i)}}async deleteFileFromStorage(t){if(!this.isProxyEnabled)return super.deleteFileFromStorage(t);Wot.info(`Deleting file at '${t}' via proxy`);let n=await this.axios();try{await n.delete(this.determineProxyUrl(`${this._bucketPath}/${encodeURIComponent(t)}`,{alt:"media"}),{headers:{Authorization:`Firebase ${await this.token()}`}})}catch(i){throw this.handleAxiosError(i)}}async checkIfStorageReferenceExists(t){if(!this.isProxyEnabled)return super.checkIfStorageReferenceExists(t);Wot.info(`Checking if file at '${t}' exists via proxy`);let n=await this.axios();try{return await n.get(this.determineProxyUrl(`${this._bucketPath}/${encodeURIComponent(t)}`),{headers:{Authorization:`Firebase ${await this.token()}`}}),!0}catch(i){if(Ag(i)&&i.status===404)return!1;throw this.handleAxiosError(i)}}determineProxyUrl(t,n){t=t.replace(/^https:\/\/firebasestorage\.googleapis\.com\//,"");let i="?";if(n)for(let o in n){let s=n[o];s!==void 0&&(t+=`${i}${o}=${encodeURIComponent(s)}`,i="&")}return`${this.proxyUrl}?gcsforward=${encodeURIComponent(t)}`}get isProxyEnabled(){let t=!1;return typeof window<"u"&&(t=window.location.hostname==="localhost"||/(^|\.)local\./.test(window.location.hostname)),!t&&!this._forceBypassProxy&&this._baseStorageUrl==="https://firebasestorage.googleapis.com"&&vu().featureFlags.isFeatureEnabled("proxyGoogleStorage")}async uploadChunk(t,n,i,o){await IA(async()=>{Wot.info(`Uploading ${n.length} bytes at offset ${i} to '${t}'`),await(await this.axios()).post(t,n,{headers:{Authorization:`Firebase ${await this.token()}`,"X-Goog-Upload-Command":`upload${o?", finalize":""}`,"X-Goog-Upload-Offset":`${i}`}})},g6m,Wot,{})}get proxyUrl(){return`${this._backendUrl}/gcs`}async token(){return Mf.instance.getFirebaseIDToken()}async axios(){return this._axiosClient||(this._axiosClient=fd),this._axiosClient}handleAxiosError(t){if(Ag(t)){let i=t.response?.data?.message??t.message;switch(t.status){case 403:return new m3(i);case 404:return new Ya(i);default:return new et(i)}}return t}};var dAa=new Map,m6m=r=>process.env.COALESCE_FORCE_FIREBASE_REPOSITORY==="true"?"firebase":vu().featureFlags.getStringValue("serviceBackedRepositories","").split(",").includes(r)?"service":"firebase",y6m=()=>vu().featureFlags.isFeatureEnabled("mutateAllRepositories",!0),b6m=r=>({providerId:m6m(r),shouldMutateBoth:y6m()}),Ohd=({app:r,storage:t,hostname:n="localhost",token:i})=>{r||(r=X0.app());let o=dAa.get(r.name);if(!o){let s;try{s=$ut()}catch(a){throw a instanceof Nee?(We("CLI_INTERNAL").error("Deploy Service configuration error",a.diagnostics),new et("Unable to connect to Coalesce services. Please check your configuration and ensure you are properly authenticated.")):a}o=Gwi(new bxt(r,t),{getToken:async()=>typeof i=="string"?i:i(),hostnames:{schedulerService:mm(),deployService:s,metadataService:jkt(n)}},b6m),dAa.set(r.name,o)}return o},Rhd=()=>{dAa.clear()};var Mxt=We("RUNNER_BACKEND"),E6m=async r=>{try{return await Zjs(r),X0.app()}catch(t){throw Mxt.error("GetOrSetupFirebase",t),t}},C6m=async(r,t,n)=>{let i;return J6()||(i=new Wwi({storage:X0.storage(),backendUrl:t.emulatorInfo?.storage,bucket:t.storageBucket})),Ohd({app:r,storage:i,hostname:n.origin,token:Mf.instance.getFirebaseIDToken})},S6m=async(r,t,n)=>{let i,o=new lxt(Tc(),n.apiKey,!!n.emulatorInfo,t,void 0,b9e());await o.initialize(),Mf.setInstance(o),MMi(r)?i=await o.loginWithIdToken(r):i=await o.loginWithRefreshToken(r);let s=await X0.firestore().collection("users").doc(i.id).get();if(!s.exists)throw N0a("Authorization failed: User not found in firebase",{userId:i.id},{warning:(l,c)=>Mxt.warn(l,c)});let{currentTeam:a,hasSuperUserAccess:u}=s.data();if(!a)throw N0a("Authorization failed: Firestore user is missing 'currentTeam'",{userID:i.id},{warning:(l,c)=>Mxt.warn(l,c)});return{token:await o.getAuthToken(),context:{userID:i.id,orgID:a,hasSuperUserAccess:!!u}}},_6m=async(r,t,n,i)=>{let o=S9e().instance;return r&&(t.subdomain={id:r}),DP&&(t.version={id:DP.version}),o.isInitialized||await o.initialize({context:t,rootRepository:()=>n,apiClient:X3(void 0,i,{timeout:b9e()})}),o.currentFlags},Vwi=async(r,t)=>{let n=X3(t.origin,void 0,{timeout:b9e()}),i=await IA(async()=>await n.GetDatabase(),4,Mxt,{},{alterRetryStrategy:()=>({name:"backoff",base:1}),logOnRetry:"Retrying to get Firebase configuration",logOnFailure:"Failed to get Firebase configuration",failureLogLevel:"error"}),o=S9e().instance,s=oxa(t.hostname);return process.env.SCHEDULER_ADDRESS=t.origin,o.isInitialized||await IA(async()=>{await o.initializeDefaultFlags(s)},4,Mxt,{},{logOnFailure:"Failed to initialize feature flags service",failureLogLevel:"error",logOnRetry:"Retrying to initialize feature flags service",alterRetryStrategy:()=>({name:"backoff",base:1})}),TFe({logContext:vu().logContext,featureFlags:o.currentFlags},async()=>(await Thd(),pCl(()=>E6m(i),a=>S6m(r,a,i),(a,u)=>C6m(a,i,t),(a,u,l)=>_6m(s,a,u,l))))};var v6m=async(r,t,n,i,o)=>{Wa.infoContext(o,`Starting deploy job coa-${r}`);let s=oZu.assert(n,{logContext:o,logArea:"CLI",errorMessage:"failed to validate request body"}),a=new UFe(s),{runDetails:u,userCredentials:l}=a,{environmentID:c,parallelism:d,phasedNodeEdits:p,planID:f}=u,A=Hot(c),g=Oce(i,`Unable to parse runID: ${i}`),b={...o,planID:f,runID:g,workspaceID:A},{teamInfo:{fbTeamID:_,fbUserID:v},rootRepository:O}=t,R=O.org(_),w=new cT(Wa,b),{measure:P,printSummary:z}=P1("[CloudDeploy] end-to-end execution",b),j;try{let U=await P("get user connection and adjust credentials",async()=>{let Y=await Rne(R.workspace(A).workspaceUser(v),b),J=vu().featureFlags;return await SNe(_,v,A,l,Y,J),J}),G=await P("create user context",()=>b6(O,_,v,A,DNe(l),b)),{runInfo:H,maxGraphSize:L,memoryMonitor:W}=await P("prepare deploy configuration",async()=>{let Y=sAa(a,G,v,r);Y.id=g;let J=R.run(g);await J.updateHeartbeat({runStatus:"initializing"}),j=REe(Y.runType,J);let re=new wU,ne=Math.max(...Object.values(p).map(X=>Object.keys(X).length));return{runInfo:Y,maxGraphSize:ne,memoryMonitor:re}}),{connectionManager:V,platform:q}=await P("get backend platform",()=>fae(G,t,lie(L,d),!1,b));return await P("run deploy pipeline",()=>pei({allWorkspaceData:H.runDetails.fromWorkspaceData,connectionManager:V,logContext:b,platform:q,renderer:ex(U),runID:g,runInfo:H,nodesInRun:hAe(p),teamInfoAndFirebase:t,workspaceID:A,memoryMonitor:W},j))}catch(U){if(j)try{await j()}catch(G){Wa.errorContext(b,"Unable to clean up heartbeat after handling error",U,"innerError",G)}throw U}finally{w.logMetric("deploy-execution",{orgID:_,workspaceID:A,planID:f,runID:g,kubernetesJobUuid:r}),z()}},T6m=async(r,t,n,i,o)=>{Wa.infoContext(o,`Starting refresh job coa-${r}`);let a=uZu.assert(n,{logContext:o,logArea:"CLI",errorMessage:"failed to validate request body"}),u=Hot(a.runDetails.environmentID),l=Oce(i,`Unable to parse runID: ${i}`),c={...o,runID:l,workspaceID:u},{teamInfo:{fbTeamID:d,fbUserID:p},rootRepository:f}=t,A=f.org(d),g=await Rne(A.workspace(u).workspaceUser(p),c),b=vu().featureFlags;await SNe(d,p,u,a.userCredentials,g,b);let _=await b6(f,d,p,u,DNe(a.userCredentials),c);a.runTimeParameters=await MEe(f,d,u,a.runTimeParameters),aAa(a);let v=uAa(a,_,p,r);v.id=l;let O=A.run(l);await O.updateHeartbeat({runStatus:"initializing"});let R=REe(v.runType,O),w=new wU;try{let P=await g3e(u,A,w),z=tGe(v.runDetails,P);v.runDetails.refreshDescription=KQe(v.runDetails,P.jobs),await O.merge({runDetails:v.runDetails});let j=HNe(_,p);P.userConnections[u][p]=j;let{connectionManager:U,platform:G}=await fae(_,t,lie(z.size,a.runDetails.parallelism),!1,c);return eGe({allWorkspaceData:P,connectionManager:U,logContext:c,platform:G,renderer:ex(b),runID:l,runInfo:v,nodesInRun:z,teamInfoAndFirebase:t,workspaceID:u,memoryMonitor:w},R)}catch(P){try{await R()}catch(z){Wa.error("Unable to clean up hearbeat after handling error",P,"innerError",z)}throw P}},I6m=async(r,t,n,i,o)=>{let s="[CloudReRun]";Wa.infoContext(o,`Starting re-run job coa-${r}`);let a=lZu.assert(n,{logContext:o,logArea:"CLI",errorMessage:"failed to validate request body"}),u=new jFe(a);B3(u);let{teamInfo:l,teamInfo:{fbTeamID:c,fbUserID:d},rootRepository:p}=t,f=p.org(c),A=Shd(u.runDetails.runID),g=await f.run(A).fetch();if(!g)throw new Error(`Could not find runInfo for teamID=${c}, oldRunID=${A}`);if(!ggc(g))throw new Error("Run is not eligible for rerun or a dev run");let b=Hot(g.runDetails.environmentID),_=Oce(i,`Unable to parse runID: ${i}`),v={...o,runID:_,workspaceID:b},O=await Rne(f.workspace(b).workspaceUser(d),v),R=vu().featureFlags;await SNe(c,d,b,u.userCredentials,O,R);let w=await b6(p,c,d,b,DNe(u.userCredentials),v),P=await cAa(p,u,g,w,l,r);if(P.id=_,!mgc(P)){let H=`Invalid rerun ID ${P.reRunID}`;throw Wa.errorContext(v,s,H),new mo(H)}let z=Hot(P.runDetails.environmentID);Dp("RUNNER_BACKEND",z===b,v,"Unexpected mismatch between workspace IDs for re-run and original run; workspace for re-run:",z,"workspace for original run:",b);let j=f.run(_);await j.updateHeartbeat({runStatus:"initializing"});let U=REe(P.runType,j),G=new wU;try{let H=await g3e(z,f,G),L=KQe(P.runDetails,H.jobs);await j.merge({runDetails:{...P.runDetails,refreshDescription:L}});let W=await fei(f,P,H),V=HNe(w,d);H.userConnections[z][d]=V;let{connectionManager:q,platform:Y}=await fae(w,t,lie(W.size,P.runDetails.parallelism),!1,v);return eGe({allWorkspaceData:H,connectionManager:q,logContext:v,platform:Y,renderer:ex(R),runID:_,runInfo:P,nodesInRun:W,teamInfoAndFirebase:t,workspaceID:z,memoryMonitor:G},U)}catch(H){try{await U()}catch(L){Wa.error("Unable to clean up hearbeat after handling error",H,"innerError",L)}throw H}},O6m=async(r,t,n,i,o)=>{let s="CloudDevRun:";Wa.infoContext(o,s,`Starting dev run job coa-${r}`);let a=sZu.assert(n,{logContext:o,logArea:"CLI",errorMessage:"failed to validate request body"}),u=Hot(a.runDetails.environmentID),l=Oce(i,`Unable to parse runID: ${i}`),c={...o,runID:l,workspaceID:u},{rootRepository:d,teamInfo:{fbTeamID:p,fbUserID:f}}=t,A=d.org(p),g=await Rne(A.workspace(u).workspaceUser(f),c),b=vu().featureFlags;await SNe(p,f,u,a.userCredentials,g,b);let _=await b6(d,p,f,u,DNe(a.userCredentials),c),v=A.devRun(l);await v.updateHeartbeat({runStatus:"initializing"});let O={...yhd(a,_,f,r),id:l},R=REe(O.runType,v),w=new wU;try{let P=await g3e(u,A,w);P.userConnections[u][f]=HNe(_,f);let z=tGe(O.runDetails,P),{connectionManager:j,platform:U}=await fae(_,t,lie(z.size,a.runDetails.parallelism),!1,c);return j3c({allWorkspaceData:P,connectionManager:j,logContext:c,platform:U,renderer:ex(b),runID:l,runInfo:O,nodesInRun:z,teamInfoAndFirebase:t,workspaceID:u,memoryMonitor:w},R)}catch(P){try{await R()}catch(z){Wa.errorContext(c,s,"unable to clean up heartbeat with error",z,"following run error",P)}throw P}},R6m=async(r,t,n,i,o)=>{let s="[CloudPlan]",{rootRepository:a,teamInfo:{fbTeamID:u,fbUserID:l}}=t,c=vu().featureFlags,{currentWorkspaceData:d,desiredWorkspaceData:p,disablePresync:f,parameters:A,skippedBeforeCollection:g,userCredentials:b,useRenderCache:_,workspaceID:v}=n,O={...o,planID:i,workspaceID:v},{measure:R,printSummary:w}=P1(s,O);try{let P=await R("get platform and test connection",()=>cfd(l,u,v,a,b,c,O)),z={currentWorkspaceData:{...d,platformKind:P.name},desiredWorkspaceData:{...p,platformKind:P.name},skippedBeforeCollection:g};Wa.infoContext(O,s,`Starting plan job coa-${r}`),await lfd({disablePresync:f,skipPlanContextUpload:c.isFeatureEnabled("skipPlanContextUpload"),useRenderCache:_},ex(c),i,v,l,P,A,z,a,O)}finally{w()}},Mhd=async r=>{let t="[CloudEntry]";Wa.debug("Cloud entrypoint."),g$u(()=>{try{return Wa.getCommonLogger()}catch(b){Wa.error("Failed to get common logger for starting OpenTelemetry SDK",{error:b});return}});let n=process.env.SCHEDULER_ADDRESS;if(!n){let b="No SCHEDULER_ADDRESS defined for cloud entrypoint";throw Wa.emerg(b),new et(b)}let i=process.env.COALESCE_COA_CLOUD_TOKEN;if(!i){let b="No COALESCE_COA_CLOUD_TOKEN defined for cloud entrypoint";throw Wa.emerg(b),new et(b)}let o=await Vwi(i,new URL(n)),{rootRepository:s,teamInfo:{fbTeamID:a,fbUserID:u},featureFlags:l}=o,c={kubernetesJobUuid:r,orgID:a,userID:u};Wa.infoContext(c,t,"authenticated user");let d,{action:p,id:f,cloudRunAction:A}=M6m(c);p==="plan"?c.planID=f:c.runID=Oce(f,`Unable to parse runID: ${f}`);let g=c;try{await V3c(s,a)&&(j9i(),Wa.debugContext(g,t,"super Debug enabled"));let b=process.env.COALESCE_COA_CLOUD_REQUEST_PATH;if(!b){let v="COALESCE_COA_CLOUD_REQUEST_PATH not set!";throw Wa.emergContext(g,t,v),new et(v)}let _=await w6m(b,s,g);d=TFe({userID:u,orgID:a,logContext:g,featureFlags:l},()=>(Wa.infoContext(g,t,`${p} job ${f} started, waiting for completion`),A(r,o,_,f,g))),await d,Wa.infoContext(g,t,"job completed without exception")}catch(b){return Wa.errorContext(g,t,"error starting coa run",b),p==="plan"?Wa.infoContext(g,t,"plan job failed, no run or workspace related state to clean up"):d?(Wa.infoContext(g,t,"run was initialized, cleaning up run and workspace"),await UYn(f,p,s.org(a),b,g),Wa.infoContext(g,t,"run and workspace cleaned up")):Wa.infoContext(g,t,"run was not initialized, no run related state to clean up"),await dB(1)}await dB(0)},M6m=r=>{let t="[getCloudRunAction]",n=process.env.COALESCE_COA_CLOUD_ACTION,i=()=>{let o=process.env.COALESCE_COA_CLOUD_RUN_COUNTER;if(!o)throw new et("COALESCE_COA_CLOUD_RUN_COUNTER not set!");return o};switch(n){case"deploy":return{id:i(),action:n,cloudRunAction:v6m};case"refresh":return{id:i(),action:n,cloudRunAction:T6m};case"rerun":return{id:i(),action:n,cloudRunAction:I6m};case"devRun":return{id:i(),action:n,cloudRunAction:O6m};case"plan":{let o=process.env.COALESCE_COA_CLOUD_PLAN_ID;if(!o){let s=`Plan ID was not set! planID: ${o}`;throw Wa.emergContext(r,t,s),new et(s)}return{id:o,action:n,cloudRunAction:R6m}}default:{let o=n;throw Wa.emergContext(r,t,`received unexpected COALESCE_COA_CLOUD_ACTION value ${o}`),new et(`Error: COALESCE_COA_CLOUD_ACTION is invalid! value=${o}`)}}},w6m=async(r,t,n)=>{let i="[downloadAndCleanupFile]";Wa.infoContext(n,i,"downloading request data from",r);let o=await t.storage().downloadFile(r),s=Rj(o);Wa.infoContext(n,i,"finished parsing request data as JSON completed; deleting stored request",s);try{await t.storage().deleteFile(r),Wa.infoContext(n,i,"finished deleting stored request; dispatching cloud run")}catch(a){Wa.assertContext(n,i,`error deleting stored request at ${r}...continuing`,a)}return o};var Ghd=_t(jhd(),1),{program:lgC,createCommand:dgC,createArgument:pgC,createOption:fgC,CommanderError:AgC,InvalidArgumentError:TAa,InvalidOptionArgumentError:hgC,Command:Hhd,Argument:ggC,Option:ix,Help:mgC}=Ghd.default;var rat=_t(require("fs")),fCd=_t(Yhd());var Jhd={openapi:"3.1.0",info:{version:"1.0.0",title:"Coalesce API",description:"REST API for performing operations with the Coalesce backend."},servers:[{url:"https://app.coalescesoftware.io",description:"US primary"},{url:"https://app.eu.coalescesoftware.io",description:"Europe primary"},{url:"https://app.australia-southeast1.gcp.coalescesoftware.io",description:"Australia primary"},{url:"https://app.us-east-1.aws.coalescesoftware.io",description:"US AWS US East"},{url:"https://app.us-east-1.aws.privatelink.coalescesoftware.io",description:"US AWS US East with PrivateLink"},{url:"https://app.us-west-2.aws.coalescesoftware.io",description:"US AWS US West"},{url:"https://app.us-west-2.aws.privatelink.coalescesoftware.io",description:"US AWS US West with PrivateLink"},{url:"https://app.northamerica-northeast1.gcp.coalescesoftware.io",description:"Canada Primary"},{url:"https://app.westus2.azure.coalescesoftware.io",description:"US Azure West 2"},{url:"https://app.eastus2.azure.coalescesoftware.io",description:"US Azure East 2"}],security:[{BearerAuth:[]}],"x-coa-private-pointers":["/paths/~1api~1v2~1render","/paths/~1api~1v2~1render~1health","/components/schemas/PackageDefinition","/components/schemas/RenderRequestV2"],components:{schemas:{PlatformKind:{type:"string",enum:["snowflake","fabric","databricks","bigquery"]},DatabaseInfo:{type:"object",required:["apiKey","authDomain","projectId","storageBucket","messagingSenderId","appId","measurementId"],properties:{apiKey:{type:"string"},authDomain:{type:"string"},projectId:{type:"string"},storageBucket:{type:"string"},messagingSenderId:{type:"string"},appId:{type:"string"},measurementId:{type:"string"},emulatorInfo:{type:"object",required:["auth","firestore","storage"],properties:{auth:{type:"string"},firestore:{type:"string"},storage:{type:"string"}}}}},EnvironmentsResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of environment information.",anyOf:[{type:"array",items:{$ref:"#/components/schemas/Environment"}},{type:"array",items:{$ref:"#/components/schemas/EnvironmentSummary"}}]},total:{type:"integer",description:"The size of the result set."},startingFrom:{type:"string",description:"The cursor value used in the request."},limit:{type:"integer",description:"The requested page size."},next:{type:["number","null"],description:"The field value representing the start of the next page of results."}}},FeatureFlagsClientConfig:{type:"object",description:"Information a client needs to connect to the feature flag service.",required:["launchDarklyClientID"],properties:{launchDarklyClientID:{type:"string"}}},FeatureFlagsValues:{type:"object",description:"Feature flag values.",properties:{featureFlags:{additionalProperties:{oneOf:[{type:"boolean"},{type:"string"},{type:"number"},{type:"object"},{type:"array"}]}}},required:["featureFlags"]},ProjectsResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of project information.",type:"array",items:{$ref:"#/components/schemas/Project"}}}},ProjectResponse:{type:"object",required:["data"],properties:{data:{description:"Information about a project.",$ref:"#/components/schemas/Project"}}},ProjectGitAccountResponse:{$ref:"#/components/schemas/ProjectGitAccountResponseData"},ProjectGitAccountsResponse:{type:"object",required:["data"],properties:{data:{description:"A colleciton of project git accounts",type:"array",items:{$ref:"#/components/schemas/ProjectGitAccountResponseData"}}}},TypesenseConfigResponse:{description:"Summary of configuration data for Typesense in a given org.","x-coa-private":!0,type:"object",required:["typesenseKey","typesenseHosts"],properties:{typesenseKey:{description:"The Typesense access key scoped to a users org.",type:"string"},typesenseHosts:{description:"The Typesense host address(es) for our cluster(s).",type:"array",items:{type:"string"}}}},EnvironmentSummary:{type:"object",description:"Summary information about an environment.",additionalProperties:!1,properties:{createdAt:{type:"string",format:"date-time"},createdBy:{$ref:"#/components/schemas/UserSummary"},id:{type:"string",description:"The Environment ID."},name:{type:"string",description:"Name of the Environment."},project:{type:"string",description:"The Project ID."},status:{$ref:"#/components/schemas/EnvironmentHealth",description:"Status of the Environment."}},required:["createdAt","id","name","project","status"]},ErrorResponse:{description:"Error detail in addition to the HTTP status code and text.",type:"object",required:["error"],properties:{error:{$ref:"#/components/schemas/Error"}}},NodesResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of nodes for an environment.",anyOf:[{type:"array",items:{$ref:"#/components/schemas/NodeSummary"}},{type:"array",items:{$ref:"#/components/schemas/Node"}}]},total:{type:"integer",description:"The size of the result set."},startingFrom:{type:"string",description:"The cursor value used in the request."},limit:{type:"integer",description:"The requested page size."},next:{type:["string","null"],description:"The field value representing the start of the next page of results."}}},NodeSummary:{type:"object",properties:{database:{type:"string",description:"The Snowflake database name."},id:{type:"string",description:"The Coalesce Node ID."},locationName:{type:"string",description:"The Storage Mapping location."},name:{type:"string",description:"The Node name."},nodeType:{$ref:"#/components/schemas/NodeType"},schema:{type:"string",description:"The database schema name."}},required:["database","id","locationName","name","nodeType","schema"]},OrderByDirection:{description:"The sort order for query results.",type:"string",enum:["asc","desc"]},PackageCreateEntity:{description:"A single package entity to be created.","x-coa-private":!0,type:"object",properties:{macros:{type:"string"},dependencies:{type:"object",additionalProperties:{$ref:"#/components/schemas/PackageDependency"}},nodeTypes:{type:"object",additionalProperties:{$ref:"#/components/schemas/PackageNodeType"}}},required:["macros","dependencies","nodeTypes"]},PackageDependency:{description:"A package dependency.","x-coa-private":!0,type:"object",required:["version","macros","dependencies","releaseID","alias","packageID"],properties:{packageID:{type:"string",minLength:1},alias:{type:"string"},version:{type:"string"},releaseID:{type:"string",minLength:1},macros:{type:"string"},dependencies:{type:"object",additionalProperties:{$ref:"#/components/schemas/PackageDependency"}}},examples:[{name:"foo",version:"1.2.3",macros:"{% macro bar() %}hello,{% endmacro %}",nodeTypes:{},dependencies:{dep:{name:"baz",version:"1.1.1",macros:"{% macro bar() %}world!{% endmacro %}",dependencies:{}}}}]},PackageEntityTagV1:{description:"Identifies the package from which the entity came. (Deprecated, see PackageEntityTagV2).","x-coa-private":!0,type:"object",required:["id","version"],properties:{id:{type:"string"},version:{type:"string"}}},PackageEntityTagV2:{description:"Identifies the package from which the entity came.","x-coa-private":!0,type:"object",required:["id","releaseID"],properties:{id:{type:"string"},releaseID:{type:"string"}}},PackageMacro:{description:"A macro in a package.","x-coa-private":!0,type:"string"},PackageNodeType:{description:"A node type in a collection of nodeTypes to be packaged.","x-coa-private":!0,type:"object",required:["name","version","isDisabled","metadata","id"],properties:{name:{type:"string"},version:{type:"number"},id:{type:"string"},isDisabled:{type:"boolean"},metadata:{type:"object"}}},PackageCreateReleaseInfo:{description:"Package release information for a create operation.","x-coa-private":!0,type:"object",properties:{changeLog:{type:"string"},version:{type:"string"},certified:{type:"boolean"}},required:["changeLog","version"]},PackageCreateEntities:{description:"Entities that are part of a package release.","x-coa-private":!0,required:["dependencies","nodeTypes","macros"],properties:{dependencies:{type:"object",additionalProperties:{$ref:"#/components/schemas/PackageDependency"}},nodeTypes:{type:"object",additionalProperties:{$ref:"#/components/schemas/PackageNodeType"}},macros:{type:"string"}}},RunsOrderBy:{description:"The field used to sort query results. Defaults to `id`, but must be explicitly provided when also using `startingFrom`. Make sure to match data type.",type:"string",enum:["id","runStartTime","runEndTime"]},RunsResponse:{description:"A collection of runs.",type:"object",required:["limit","next","orderBy","orderByDirection","data"],properties:{limit:{description:"The maximum number of runs returned by this query.",type:"integer"},next:{description:"The field value representing the start of the next page of results.",type:["number","string","null"]},orderByDirection:{$ref:"#/components/schemas/OrderByDirection"},orderBy:{$ref:"#/components/schemas/RunsOrderBy"},data:{description:"A collection of runs.",anyOf:[{type:"array",items:{$ref:"#/components/schemas/RunSummary"}},{type:"array",items:{$ref:"#/components/schemas/RunInfo"}}]}}},RunResultsResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of run results.",type:"array",items:{$ref:"#/components/schemas/RunResult"}}}},StoredRunResultsResponse:{type:"object",required:["data"],properties:{data:{description:"Raw run results from external storage.",type:"array",items:{$ref:"#/components/schemas/StoredRunResult"}}}},RunSummary:{type:"object",properties:{id:{description:"The run ID.",type:"integer"},reRunID:{description:"If this is a re-run, the ID of the original operation.",type:"string"},runStartTime:{description:"The datetime the run started.",type:"string",format:"date-time"},runEndTime:{description:"The datetime the run ended.",type:"string",format:"date-time"},runType:{$ref:"#/components/schemas/RunType"},runStatus:{$ref:"#/components/schemas/RunStatus"},environmentID:{description:"The environment in which the run operation was applied.",type:"string"},runFailureReason:{description:"Information about the cause of a run failure.",type:"string"}},required:["id","runType","runStatus"]},UserEnvironmentRolesResponse:{type:"array",items:{$ref:"#/components/schemas/UserEnvironmentRoles"},additionalProperties:!1},UserProjectRolesResponse:{type:"array",items:{$ref:"#/components/schemas/UserProjectRoles"},additionalProperties:!1},UserRolesResponse:{type:"array",items:{$ref:"#/components/schemas/UserOrgRoles"},additionalProperties:!1},SingleUserRoleResponseV2:{$ref:"#/components/schemas/UserOrgRolesV2"},UserRoleResponseV2:{type:"object",properties:{userRoles:{type:"array",items:{$ref:"#/components/schemas/UserOrgRolesV2"}}},required:["userRoles"],additionalProperties:!1},FivetranProjectsResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of project information.",type:"array",items:{$ref:"#/components/schemas/FivetranProject"}}}},FivetranProjectResponse:{type:"object",required:["data"],properties:{data:{description:"Fivetran project data.",$ref:"#/components/schemas/FivetranProject"}}},FivetranJobsResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of job information.",type:"array",items:{$ref:"#/components/schemas/FivetranJob"}}}},FivetranJobHistoryResponse:{type:"object",required:["data"],properties:{data:{description:"Fivetran job history data.",$ref:"#/components/schemas/FivetranJobHistory"}}},FivetranRefreshJobResponse:{type:"object",required:["data"],properties:{data:{description:"A fivetran job",$ref:"#/components/schemas/FivetranJobHistory"}}},MetricsItem:{type:"object",required:["name","tags","count"],properties:{name:{type:"string"},tags:{type:"array",items:{type:"string"}},count:{type:"integer"}}},MetricsRequest:{type:"object",required:["metrics"],properties:{metrics:{type:"array",items:{$ref:"#/components/schemas/MetricsItem"}}}},BaseEnvironment:{type:"object",description:"Environments are used for deploying your data pipelines to production, test, QA, and other environments.",additionalProperties:!0,properties:{connectionAccount:{type:"string",description:"The account name for the environment connection."},defaultStorageMapping:{type:"string",nullable:!0},description:{type:"string",description:"The Environment description."},name:{type:"string",description:"The Environment name."},oauthEnabled:{type:"boolean",description:"If OAuth is enabled."},runTimeParameters:{type:"object",additionalProperties:!0,description:"The default Environment parameters. Parameters changed during deploy will not show here."},tagColors:{$ref:"#/components/schemas/TagColor"},project:{type:"string"}},required:["name","oauthEnabled","project"]},Environment:{description:"Environments are used for deploying your data pipelines to production, test, QA, and other environments.",allOf:[{$ref:"#/components/schemas/BaseWorkspaceEnv"},{type:"object",additionalProperties:!0,properties:{runTimeParameters:{type:"object",additionalProperties:!0,description:"The default Environment parameters. Parameters changed during deploy will not show here."},currentMappings:{$ref:"#/components/schemas/EnvironmentStorageLocationMappings"}},required:["createdAt","id","status"]}]},EnvironmentCreateRequest:{"x-coa-private":!0,type:"object",description:"Initial values to set on a newly created environment.",allOf:[{$ref:"#/components/schemas/BaseEnvironment"},{type:"object",properties:{mappings:{$ref:"#/components/schemas/EnvironmentStorageLocationMappings"}},additionalProperties:!0}]},EnvironmentHealth:{type:"string",enum:["Deleting","Deploying","Failed Deploy","Failed Dev Run","Failed Refresh","Initializing","Refreshing","Running Dev Run","Waiting"]},EnvironmentStorageLocationMappings:{type:"object",description:"The Storage Mapping name.",additionalProperties:{type:"object",properties:{database:{type:"string",description:"The database name."},schema:{type:"string",description:"The database schema."}}}},BaseProject:{type:"object",description:"A project groups environments and workspaces for easier management and access control.",properties:{platformKind:{$ref:"#/components/schemas/Common.schema1"},description:{type:"string"},gitRepoURL:{type:"string"},name:{type:"string"},autoPreviewEnabled:{type:"boolean",description:"Controls whether sample data is automatically fetched after running a node. When undefined, defaults based on platformKind."}},required:["name"]},Project:{description:"A project groups environments and workspaces for easier management and access control.",allOf:[{$ref:"#/components/schemas/BaseProject"},{type:"object",additionalProperties:!0,properties:{createdAt:{type:"string",format:"date-time"},createdBy:{$ref:"#/components/schemas/UserSummary"},updatedAt:{type:"string",format:"date-time"},updatedBy:{$ref:"#/components/schemas/UserSummary"},id:{type:"string"},status:{$ref:"#/components/schemas/ProjectStatus"},workspaces:{type:"array",items:{$ref:"#/components/schemas/WorkspaceSummary"}}},required:["createdAt","updatedAt","id","status","name"]}]},ProjectCreateRequest:{type:"object",description:"A project groups environments and workspaces for easier management and access control.",properties:{platformKind:{$ref:"#/components/schemas/Common.schema1"},description:{type:"string"},gitRepoURL:{type:"string"},name:{type:"string"},autoPreviewEnabled:{type:"boolean",description:"Controls whether sample data is automatically fetched after running a node. When undefined, defaults based on platformKind."}},additionalProperties:!1,required:["name","platformKind"]},ProjectPatchRequest:{type:"object",description:"A project groups environments and workspaces for easier management and access control.",properties:{platformKind:{$ref:"#/components/schemas/Common.schema1"},description:{type:"string"},gitRepoURL:{type:"string"},name:{type:"string"},autoPreviewEnabled:{type:"boolean",description:"Controls whether sample data is automatically fetched after running a node. When undefined, defaults based on platformKind."}},additionalProperties:!1},ProjectStatus:{type:"string",enum:["active","deleted"]},ProjectGitAccountResponseData:{type:"object",required:["gitAccountID","userID"],properties:{gitAccountID:{type:"string"},userID:{type:"string"}}},ProjectGitAccountSetRequest:{required:["gitAccountID"],properties:{gitAccountID:{type:"string"}}},UserSummary:{type:"object",description:"Summary information about a user.",additionalProperties:!1,properties:{id:{type:"string",description:"The user ID."},firstName:{type:"string",description:"User first name."},lastName:{type:"string",description:"User last name."},email:{type:"string"},accountType:{type:"string",enum:["SSO","normal"]}},required:["id"]},FirestoreWebTimestamp:{type:"object",description:"Timestamp from the web Firestore SDK.",additionalProperties:!1,properties:{seconds:{type:"number"},nanoseconds:{type:"number"}},required:["seconds","nanoseconds"]},FirestoreAdminTimestamp:{type:"object",description:"Timestamp from the admin Firestore SDK.",additionalProperties:!1,properties:{_seconds:{type:"number"},_nanoseconds:{type:"number"}},required:["_seconds","_nanoseconds"]},FirestoreTimestamp:{type:"object",description:"Timestamp from either the web admin Firestore SDKs.",oneOf:[{$ref:"#/components/schemas/FirestoreWebTimestamp"},{$ref:"#/components/schemas/FirestoreAdminTimestamp"}]},"Common.schema1":{type:"string",enum:["snowflake","databricks","fabric","bigquery"]},Error:{type:"object",additionalProperties:!1,properties:{errorString:{description:"The error message.",type:"string"},errorDetail:{description:"Additional detail about the error.",type:"string"}},required:["errorString"]},Node:{type:"object",oneOf:[{$ref:"#/components/schemas/SourceNode"},{$ref:"#/components/schemas/SQLNode"}]},NodeCreateRequest:{type:"object",properties:{nodeType:{$ref:"#/components/schemas/NodeType"},predecessorNodeIDs:{default:[],type:"array",items:{type:"string"},description:"The IDs of the nodes that are predecessors to this node. It can also be empty if it has no predecessors"}},additionalProperties:!1,required:["nodeType","predecessorNodeIDs"]},AliasToStepIDMapping:{type:"object",additionalProperties:{type:"string"}},AppliedColumnTests:{type:"object",description:"Will return `hasNull` or `isDistinct` as true or false if testing is enabled.",additionalProperties:{type:"boolean"}},BaseNode:{type:"object",additionalProperties:!0,properties:{database:{type:"string",description:"The Snowflake database name."},description:{type:"string",description:"The Node description."},id:{type:"string",description:"The Node ID."},locationName:{type:"string",description:"The Storage Mapping location."},name:{type:"string",description:"The Node name."},nodeType:{$ref:"#/components/schemas/NodeType"},schema:{type:"string",description:"The Snowflake schema name."}},required:["database","description","id","locationName","name","nodeType","schema"]},ColumnMetadata:{type:"object",additionalProperties:!1,properties:{appliedColumnTests:{$ref:"#/components/schemas/AppliedColumnTests"},columnID:{type:"string",description:"The column ID."},columnReferences:{items:{$ref:"#/components/schemas/IntermediateColumnRefResult"},type:"array"},config:{type:"object",description:"Returns any configuration options from the Node Config Tab.",additionalProperties:!0},dataType:{type:"string",description:"Column data type."},defaultValue:{type:"string",description:"The default column value."},description:{type:"string",description:"The column description."},hashDetails:{$ref:"#/components/schemas/HashMetadata"},hashedColumns:{type:"array",items:{$ref:"#/components/schemas/ColumnReference"}},isBusinessKey:{type:"boolean",description:"Tags the column as a business key."},isChangeTracking:{type:"boolean",description:"Tags the column as a change tracking column in type 2 dimensions."},isSurrogateKey:{type:"boolean",description:"Tags the column as a surrogate key, e.g. DIM_CUSTOMER_KEY."},keyColumnType:{type:"string",enum:["None","primaryBusinessKey","surrogateKey"]},name:{type:"string",description:"The column name."},nullable:{type:"boolean",description:"If the column can contain null values."},primaryKey:{description:"Tags the column as a primary key.",type:"boolean"},sources:{items:{$ref:"#/components/schemas/SourceColumnReferenceV1"},type:"array"},systemColumnType:{type:"string",enum:["None","sysCreateDate","sysCurrentFlag","sysEndDate","sysStartDate","sysUpdateDate","sysVersion"]},transform:{type:"string"},uniqueKey:{type:"boolean"},isSystemCreateDate:{type:"boolean"},isSystemUpdateDate:{type:"boolean"},isSystemStartDate:{type:"boolean"},isSystemEndDate:{type:"boolean"},isSystemVersion:{type:"boolean"},isSystemCurrentFlag:{type:"boolean"}},required:["columnID","dataType","description","name","nullable"]},ColumnReference:{type:"object",additionalProperties:!1,properties:{columnID:{type:"string",description:"Column ID of the source column."},nodeID:{type:"string",description:"Node ID of the source columm."}},required:["columnID","nodeID"]},CustomSQL:{type:"object",additionalProperties:!1,properties:{customSQL:{type:"string"}},required:["customSQL"]},HashAlgorithm:{type:"string",enum:["MD5","SHA1","SHA256"]},HashMetadata:{type:"object",additionalProperties:!1,properties:{hashAlgorithm:{$ref:"#/components/schemas/HashAlgorithm"},hashType:{enum:["ChangeHash","Hash","HubHash","LinkHash","None"],type:"string"},hubHashes:{items:{$ref:"#/components/schemas/ColumnReference"},type:"array"}},required:["hashAlgorithm"]},IntermediateColumnRefResult:{additionalProperties:!1,properties:{columnName:{type:"string"},tableName:{type:"string",nullable:!0}},required:["columnName","tableName"],type:"object"},JoinCondition:{type:"object",additionalProperties:!1,properties:{joinCondition:{type:"string"}},required:["joinCondition"]},NodeType:{anyOf:[{type:"string",enum:["Dimension","Fact","Hub","Link","Satellite","Source","Stage","View","persistentStage"]},{type:"string"}]},RefLink:{type:"object",additionalProperties:!1,properties:{locationName:{type:"string"},nodeName:{type:"string"}},required:["locationName","nodeName"]},SourceColumnReference:{anyOf:[{$ref:"#/components/schemas/SourceColumnReferenceV1"},{$ref:"#/components/schemas/SourceColumnReferenceV2"}]},SourceColumnReferenceV1:{type:"object",additionalProperties:!1,properties:{columnReferences:{items:{$ref:"#/components/schemas/ColumnReference"},type:"array"},transform:{type:"string",description:"Returns the SQL of any column transformations."}},required:["columnReferences","transform"]},SourceColumnReferenceV2:{type:"object",additionalProperties:!1,properties:{transform:{type:"string",description:"Returns the SQL of any column transformations."}},required:["transform"]},SourceMap:{additionalProperties:!1,properties:{aliases:{$ref:"#/components/schemas/AliasToStepIDMapping"},customSQL:{$ref:"#/components/schemas/CustomSQL"},dependencies:{items:{$ref:"#/components/schemas/RefLink"},type:"array"},join:{$ref:"#/components/schemas/JoinCondition"},name:{type:"string"},noLinkRefs:{items:{$ref:"#/components/schemas/RefLink"},type:"array"}},required:["dependencies","join","name","noLinkRefs"],type:"object"},RunStatus:{enum:["canceled","completed","failed","initializing","rendering","running","waitingToRun"],type:"string"},RunType:{enum:["deploy","refresh"],type:"string"},BigQueryUserConnectionType:{type:"string",enum:["ServiceAccount","OAuth"]},DatabricksUserConnectionType:{type:"string",enum:["Token","Cloud","OAuthU2M","OAuthM2M"]},FabricUserConnectionType:{type:"string",enum:["oauth"]},SnowflakeUserConnectionType:{type:"string",enum:["Basic","Cloud","KeyPair","OAuth"]},DeployRunDetails:{type:"object",additionalProperties:!1,description:"Deployment run details.",properties:{canceled:{type:"boolean",description:"If the run was canceled."},deployCommit:{type:"string",description:"The full commit hash."},deployCommitMessage:{type:"string",description:"The commit message."},environmentID:{type:"string",description:"The Environment ID for this run."},parallelism:{type:"integer",description:"The parallelism parameter determines how many nodes are processed simultaneously (in parallel) by the Snowflake compute warehouse."},nodesInRun:{type:"integer",description:"The number of Nodes deployed."}},required:["deployCommit","environmentID"]},RefreshRunDetails:{type:"object",additionalProperties:!1,description:"Refresh run details.",properties:{canceled:{type:"boolean",description:"If the run was canceled."},environmentID:{type:"string",description:"The Environment ID for this run."},excludeNodesSelector:{type:"string",description:"A selector string of nodes to exclude."},forceIgnoreEnvironmentStatus:{type:"boolean"},includeNodesSelector:{type:"string",description:"A selector string of nodes to include."},jobID:{type:"integer",description:"The Job ID."},parallelism:{type:"integer",description:"The parallelism parameter determines how many nodes are processed simultaneously (in parallel) by the Snowflake compute warehouse."},refreshDescription:{type:"string",description:"The Job name."},nodesForRefresh:{type:"integer"},nodesInRun:{type:"integer",description:"The number of Nodes deployed."},executor:{type:"string"}},required:["environmentID"]},RunDetails:{description:"Detailed information about a run.",anyOf:[{$ref:"#/components/schemas/DeployRunDetails"},{$ref:"#/components/schemas/RefreshRunDetails"}]},RunInfo:{description:"The full details of a run, without the run results.",type:"object",additionalProperties:!1,properties:{id:{type:"integer"},reRunID:{type:"string",description:"If this is a re-run, the ID of the original operation."},runDetails:{$ref:"#/components/schemas/RunDetails"},runEndTime:{format:"date-time",type:"string",description:"The datetime when the run ended."},runFailureReason:{type:"string",description:"The reason the run failed."},runHistory:{items:{type:"integer"},type:"array"},runStartTime:{format:"date-time",type:"string",description:"The datetime the run started."},runStatus:{$ref:"#/components/schemas/RunStatus"},runTimeParameters:{type:"object",description:"The default Environment parameters. Parameters changed during deploy will not show here.",additionalProperties:!0},runType:{$ref:"#/components/schemas/RunType"},userCredentials:{oneOf:[{$ref:"#/components/schemas/SnowflakeUserCredentials"},{$ref:"#/components/schemas/DatabricksUserCredentials"},{$ref:"#/components/schemas/FabricUserCredentials"},{$ref:"#/components/schemas/BigQueryUserCredentials"}]},userID:{type:"string"},projectID:{type:"string"},hasTestFailures:{type:"boolean",description:"Whether the run has test failures."},version:{type:"integer"},renderingProgress:{type:"object",description:"Progress information for the rendering phase",properties:{totalNodes:{type:"integer",minimum:0,description:"Total number of nodes to render"},completedNodes:{type:"integer",minimum:0,description:"Number of nodes completed so far"}},required:["totalNodes","completedNodes"]}},required:["id","runDetails","runStatus","runTimeParameters","runType","projectID"]},BigQueryUserCredentials:{description:"Information about the BigQuery account used to perform a run.",type:"object",additionalProperties:!1,properties:{bigQueryAuthType:{$ref:"#/components/schemas/BigQueryUserConnectionType"}},required:["bigQueryAuthType"]},FabricUserCredentials:{description:"Information about the Fabric account used to perform a run.",type:"object",additionalProperties:!1,properties:{fabricConnectionString:{type:"string"},fabricAuthType:{$ref:"#/components/schemas/FabricUserConnectionType"},platformKind:{type:"string"}},required:["fabricConnectionString","fabricAuthType"]},DatabricksUserCredentials:{description:"Information about the Databricks account used to perform a run.",type:"object",additionalProperties:!1,properties:{databricksHost:{type:"string"},databricksAuthType:{$ref:"#/components/schemas/DatabricksUserConnectionType"},databricksPath:{type:"string"}},required:["databricksHost","databricksAuthType","databricksPath"]},SnowflakeUserCredentials:{description:"Information about the Snowflake account used to perform a run.",type:"object",additionalProperties:!1,properties:{snowflakeAccount:{type:"string"},snowflakeAuthType:{$ref:"#/components/schemas/SnowflakeUserConnectionType"},snowflakeRole:{type:"string"},snowflakeUsername:{type:"string"},snowflakeWarehouse:{type:"string"}},required:["snowflakeAccount","snowflakeAuthType","snowflakeUsername"]},QueryResult:{type:"object",additionalProperties:!1,properties:{endTime:{type:"string",format:"date-time"},error:{$ref:"#/components/schemas/Error"},isRunning:{type:"boolean",description:"If the queried run is still running."},name:{type:"string",description:"The name of the Stage the query ran on."},queryID:{type:"string"},rowsDeleted:{type:"integer"},rowsInserted:{type:"integer"},rowsUpdated:{type:"integer"},sql:{type:"string",description:"The SQL query run during the stage."},startTime:{type:"string",format:"date-time"},status:{type:"string",description:"The query status."},success:{type:"boolean",description:"If the query results were run successfully."},type:{type:"string",enum:["sql","sqlTest"]},warehouse:{type:"string",description:"Name of the warehouse."}},required:["isRunning","name","sql","status","success"]},RunResult:{type:"object",additionalProperties:!1,description:"The result output describing each query processed during a run.",properties:{isRunning:{type:"boolean",description:"If the queried run is still running."},name:{type:"string"},nodeID:{type:"string"},runState:{type:"string"},hasTestFailures:{type:"boolean"},origin:{$ref:"#/components/schemas/RunOrigins"},queryResults:{description:"The query result returns the status of different stages such as Delete Table or Rename Table. See the queryResults name for the stage.",items:{$ref:"#/components/schemas/QueryResult"},type:"array"},renderQueryResult:{$ref:"#/components/schemas/QueryResult"}},required:["isRunning","name","nodeID","queryResults"]},RunOrigins:{type:"string",enum:["API","CLI","UI","fivetranAPI"]},StoredRunResult:{type:"object",additionalProperties:!0,description:"Raw run result from external storage matching the core-types RunResult",properties:{id:{type:"string",description:"The node ID"},dataResult:{description:"Data result - can be a record of values or a completed query result",oneOf:[{type:"object",nullable:!0,additionalProperties:{oneOf:[{type:"number"},{type:"string"},{type:"boolean"}]}},{$ref:"#/components/schemas/CompletedQueryResult"}]},name:{type:"string",description:"The name of the node"},queryResultSequence:{$ref:"#/components/schemas/QueryResultSequence"},runExecutionSequenceID:{type:"integer",description:"The execution sequence ID"},hasTestFailures:{type:"boolean",description:"Whether the run has test failures"},runResultVersion:{type:"integer",enum:[2],default:2,description:"Version of the run result format"},runState:{type:"string",enum:["waiting","queued","running","complete","error","skipped","canceled"],description:"The state of the run"},stepRunState:{type:"string",enum:["None","Error","Validated","Created","DataLoaded","Skipped"],description:"The state of the step run"},version:{type:"integer",enum:[2],default:2,description:"Version field"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"}},required:["id","name","queryResultSequence","runState","stepRunState","version","createdAt","updatedAt"]},QueryResultSequence:{type:"object",additionalProperties:!0,properties:{name:{type:"string"},queryResults:{type:"array",items:{oneOf:[{$ref:"#/components/schemas/CompletedQueryResult"},{$ref:"#/components/schemas/RunningQueryResult"}]}},isRunning:{type:"boolean"},renderQueryResults:{$ref:"#/components/schemas/CompletedQueryResult",description:"Legacy field - unused"}},required:["name","queryResults","isRunning"]},CompletedQueryResult:{type:"object",additionalProperties:!0,properties:{endTime:{type:"string",format:"date-time"},error:{type:"object",properties:{errorString:{type:"string"},errorDetail:{type:"string"}},required:["errorString","errorDetail"],nullable:!0},fields:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}},isRunning:{type:"boolean"},name:{type:"string"},sql:{type:"string"},startTime:{type:"string",format:"date-time"},status:{type:"string",enum:["Success","Failure","Canceled","Queued","Running","Transaction exceeded data limit, returned a subset of rows"]},success:{type:"boolean"},type:{type:"string",enum:["sql","sqlTest"]},exportedRefs:{type:"array",items:{type:"object",properties:{locationName:{type:"string"},nodeName:{type:"string"}},required:["locationName","nodeName"]}},invalidExportedRefs:{type:"array",items:{type:"object",properties:{locationName:{type:"string"},nodeName:{type:"string"}},required:["locationName","nodeName"]}}},required:["name","isRunning","status","success","type","exportedRefs","invalidExportedRefs","startTime","endTime","sql","fields"]},RunningQueryResult:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},isRunning:{type:"boolean",enum:[!0]}},required:["name","isRunning"]},OrgRoles:{type:"object",description:"Specifies role assignments.",required:["organizationRoles","projects"],properties:{organizationRoles:{description:"The organization roles assigned to the user.",type:"array",items:{type:"string"}},projects:{description:"A dictionary of project role assignments keyed by project ID.",type:"object",additionalProperties:{$ref:"#/components/schemas/ProjectRoles"}}},additionalProperties:!0},ProjectRoles:{type:"object",description:"Specifies project role assignments.",required:["projectRoles","environments"],properties:{projectRoles:{type:"array",items:{type:"string"}},environments:{description:"A dictionary of environment role assignments keyed by environment ID.",type:"object",additionalProperties:{$ref:"#/components/schemas/EnvironmentRoles"}}},additionalProperties:!0},EnvironmentRoles:{type:"object",description:"Specifies environment role assignments.",required:["environmentRoles"],properties:{environmentRoles:{description:"The environment roles assigned to the user.",type:"array",items:{type:"string"}}},additionalProperties:!0},UserOrgRoles:{description:"The roles assigned to a user.",allOf:[{$ref:"#/components/schemas/OrgRoles"},{type:"object",required:["user","organizationRoles","projects"],properties:{user:{$ref:"#/components/schemas/UserSummary"}},additionalProperties:!0}]},UserProjectRoles:{description:"The project roles assigned to the user.",allOf:[{$ref:"#/components/schemas/ProjectRoles"},{type:"object",required:["user","projectRoles","environments"],properties:{user:{$ref:"#/components/schemas/UserSummary"}},additionalProperties:!0}]},UserEnvironmentRoles:{description:"The environment roles assigned to the user.",allOf:[{$ref:"#/components/schemas/EnvironmentRoles"},{type:"object",required:["user"],properties:{user:{$ref:"#/components/schemas/UserSummary"}},additionalProperties:!0}]},UserOrgRolesV2:{description:"The roles assigned to a user.",type:"object",properties:{userID:{type:"string"},organizationRole:{description:`The user role for the org. If the user's organization role does not grant any project permissions and an
10370
+ `+c:c;break;case"event":n.event=c;break;case"id":r(n.id=c);break}}}}function QBm(r,t){let n=new Uint8Array(r.length+t.length);return n.set(r),n.set(t,r.length),n}function kAd(){return{data:"",event:"",id:""}}var Gv=class extends cP{constructor(n,i,o,s,a,u,l){super(n,n,[],i,s,l);this.dataTransform=o;this.EntityRepositoryConstructor=a;this.hostname=u;this.eventManager=this.serviceOperations.eventManager.getCollection(n)}eventManager;async addAuthHeader(n={}){let i=await this.getToken();return i&&(n.Authorization=`Bearer ${i}`),n}get path(){return`${this.parent.path}/${this.id}`}get bulkUri(){throw new Yp("This entity does not support bulk operations")}get(n){return new this.EntityRepositoryConstructor(n,this.parent,this.serviceOperations,this.logContext)}encodeQueryComponent(n){if(n!==void 0)return Buffer.from(JSON.stringify(n)).toString("base64")}async select(n,i){let o=!1,s=0,a=[],u;n?.startingFrom&&(v0(n.startingFrom)?u=n.startingFrom:u=[n.startingFrom]);let l=this.encodeQueryComponent(u),c=n?.where?n?.where.map(_=>({field:_[0],operation:_[1],value:_[2]})):void 0,d=this.encodeQueryComponent(c),p;n?.orderBy&&(n.orderBy.length===0?p=[{field:"id",direction:"asc"}]:p=n?.orderBy.map(_=>({field:_[0],direction:_[1]})));let f=this.encodeQueryComponent(p),A=500,g=n?.limit??1/0;for(;!o;){let _=Math.min(A,g-s),v=await this.addAuthHeader(),O=await fd.get(`${this.hostname}${this.baseUri}`,{headers:v,params:{limit:_,startAfter:l,where:d,orderBy:f}}),R=O.data.data.map(w=>this.dataTransform.fromStorage(w.id.toString(),this.path,w,i));a.push(...R),s+=_,l=O.data.nextCursor,(R.length<_||s>=g)&&(o=!0)}let b=n?.selectFields;return b?a.map(_=>ub(_,b)):a}async selectIDs(n,i){return(await this.select({...n,selectFields:["id"]},i)).map(s=>s.id)}async selectInBatches(n,i,o,s=[]){return this.select({where:[...s,[n,i,o]]})}async createEntity(n,i){let o=await this.generateID(n),s=this.dataTransform.toStorage(o.toString(),`${this.path}/${o}`,n,i),a=await this.addAuthHeader(),l=(await fd.post(`${this.hostname}${this.baseUri}`,s,{headers:a,method:"post"})).data,c=this.dataTransform.fromStorage(String(l.id),`${this.path}/${l.id}`,l,i);return this.eventManager.publishEvents([{type:"added",value:c,id:String(l.id),hasPendingWrites:!1}]),new this.EntityRepositoryConstructor(l.id,this.parent,this.serviceOperations,this.logContext)}listenCollection(n,i,o){let s=this.eventManager.registerListener(n),a;try{console.log(`start subscription ${this.baseSSEUri}`),a=pfa(new URL(this.baseSSEUri,window.location.origin),{auth:async()=>{let u=await this.getToken();return ed(!!u,"Cookie-based auth is not yet supported for service-backed repositories","COMMON"),"Bearer "+u},onMessage:u=>{try{switch(u.event){case"entity":{let l=JSON.parse(u.data);if(l.type==="added"||l.type==="modified"){let c=this.dataTransform.fromStorage(l.id,`${this.path}/${l.id}`,l.value,o);this.eventManager.publishEvents([{type:l.type,value:c,id:l.id,hasPendingWrites:!1}])}else this.eventManager.publishEvents([{type:"removed",value:{},id:l.id,hasPendingWrites:!1}]);break}case"error":{if(i){let l=JSON.parse(u.data),c=new et(l.error.errorString,l.error.errorDetail);i(c)}break}case"connected":case"ready":case"disconnect":default:}}catch(l){We("COMMON").errorContext(this.logContext,"Failed to interpret SSE message",l),l instanceof Error&&i&&i(l)}},onError:u=>{u instanceof Error&&i&&i(u)}}),console.log(`subscription started ${this.baseSSEUri}`),this.select().then(u=>{this.eventManager.publishEvents(u.map(l=>({type:"added",value:l,id:String(l.id),hasPendingWrites:!1})))})}catch(u){if(u instanceof Error&&i)i(u);else throw u}return()=>{s(),a?.()}}listenQuery(n,i,o,s){throw new Yp("Not used by supported entities")}async generateID(n){return n.id??Za()}async bulkSave(n){We("COMMON").warnContext(this.logContext,"Using default bulk save operation",{path:this.path});for(let i of n)try{await this.createEntity(i)}catch(o){i&&i.id&&Ag(o)&&o.status===409?await this.get(i.id).save(i):We("COMMON").errorContext(this.logContext,"Failed to bulk save entity using default operation",{path:this.path},o)}}async bulkUpdate(n){We("COMMON").warnContext(this.logContext,"Using default bulk update operation",{path:this.path});for(let i of n)try{if(!i.id)throw We("COMMON").errorContext(this.logContext,"Tried to bulk update entity without entity ID",{path:this.path}),new et("Tried to bulk update entity without entity ID");await this.get(i.id).merge(i)}catch(o){We("COMMON").errorContext(this.logContext,"Failed to bulk update entity using default operation",{path:this.path},o)}}async bulkDelete(n){We("COMMON").warnContext(this.logContext,"Using default bulk delete operation",{path:this.path});for(let i of n)try{if(!i.id)throw We("COMMON").errorContext(this.logContext,"Tried to bulk delete entity without entity ID",{path:this.path}),new et("Tried to bulk delete entity without entity ID");await this.get(i.id).delete()}catch(o){We("COMMON").errorContext(this.logContext,"Failed to bulk delete entity using default operation",{path:this.path},o)}}async getCount(){throw new Yp}};var UBm=zi.merge(SK),jBm=Os("Job",UBm),LAd=vR(jBm,new Got("jobCounter")),ffa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/jobs`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/jobs`}get wsQuery(){return{}}getCollection(){return new Cxt(this.parent,this.serviceOperations,this.logContext)}constructor(t,n,i,o){super(t,"jobs",LAd,n,o,[],i.hostnames.metadataService,i)}},Cxt=class extends Gv{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/jobs`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/jobs`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("jobs",t,LAd,i,ffa,n.hostnames.metadataService,n)}async generateID(t){if(t.id)return t.id;if(t.jobCounter)return t.jobCounter;let n=await this.select();if(n.length<1)return 1;let o=n.sort((a,u)=>u.id-a.id)[0];return o?o.id+1:1}};var Afa=class r extends GZ{static ID_NUMBER=/^\d+$/;transformToStorage(t,n,i){return{...GS(i,["macroCounter","name","packageInfo"])}}mergeTransformToStorage(t,n,i){return i}transformFromStorage(t,n,i){return r.ID_NUMBER.test(i.id)?{...i,macroCounter:+i.id}:{...i}}},GBm=zi.merge(aL),HBm=Os("Macro",GBm),qAd=vR(HBm,new Afa),hfa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/macros`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/macros`}get wsQuery(){return{}}getCollection(){return new Sxt(this.parent,this.serviceOperations,this.logContext)}constructor(t,n,i,o){super(t,"macros",qAd,n,o,[],i.hostnames.metadataService,i)}},Sxt=class extends Gv{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/macros`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/macros`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("macros",t,qAd,i,hfa,n.hostnames.metadataService,n)}};var gfa=class extends GZ{transformToStorage(t,n,i){return{...GS(i,["templateCounter"])}}mergeTransformToStorage(t,n,i){return i}transformFromStorage(t,n,i){return i}},WBm=zi.merge(xFe),VBm=Os("NodeType",WBm),zAd=vR(VBm,new gfa),mfa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/templates`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/templates`}get wsQuery(){return{}}getCollection(){return new _xt(this.parent,this.serviceOperations,this.logContext)}constructor(t,n,i,o){super(t,"templates",zAd,n,o,[],i.hostnames.metadataService,i)}},_xt=class extends Gv{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/templates`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/templates`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("templates",t,zAd,i,mfa,n.hostnames.metadataService,n)}};var yfa=class extends GZ{transformToStorage(t,n,i){return i}mergeTransformToStorage(t,n,i){return i}transformFromStorage(t,n,i){let o=[];return i.metadata.columns.forEach(s=>{let a;(i.type==="sourceInput"||s.isSurrogateKey||s.isSystemCreateDate||s.isSystemUpdateDate||s.isSystemStartDate||s.isSystemEndDate||s.isSystemVersion||s.isSystemCurrentFlag)&&(a={strictMatch:!0,values:[]}),o.push({...s,acceptedValues:a})}),{...i,metadata:{...i.metadata,columns:o}}}},KBm=M.discriminatedUnion("type",[zi.merge(yi.merge(EK)),zi.merge(yi.merge(CK))]),YBm=Os("Node",KBm),FAd=vR(YBm,new yfa),bfa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/nodes`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/nodes`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i,o){super(t,"nodes",FAd,n,o,[],i.hostnames.metadataService,i)}mergeMetadata(t){return this.fetchAndMerge({metadata:t})}getCollection(){return new vxt(this.parent,this.serviceOperations,this.logContext)}},vxt=class r extends Gv{static NODE_BULK_LIMIT=1e3;get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/nodes`}get bulkUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/nodes_bulk`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/nodes`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("nodes",t,FAd,i,bfa,n.hostnames.metadataService,n)}listenCollectionOverride(t,n,i,o,s){let a=this.listenCollection(t,o,s);return()=>{a&&a()}}convertFromRestAPIStorage(t,n){return this.dataTransform.fromStorage(n,`${this.path}/${n}`,t)}async getNodesLocationInfo(){let t=await this.select(),n={};return t.forEach(i=>{n[i.id]={operation:i}}),n}async bulkSave(t){let n=t.map(o=>this.dataTransform.toStorage(o.id||"",`${this.path}/${o.id}`,o));await this.bulkPostChunk(()=>this.addAuthHeader({}),n,r.NODE_BULK_LIMIT);let i=n.map(o=>this.dataTransform.fromStorage(o.id,`${this.path}/${o.id}`,o));this.eventManager.publishEvents(i.map(o=>({type:"added",value:o,id:String(o.id),hasPendingWrites:!1})))}async bulkUpdate(t){let n=t.map(o=>this.dataTransform.mergeToStorage(o.id||"",`${this.path}/${o.id}`,o));await this.bulkPostChunk(()=>this.addAuthHeader({}),n,r.NODE_BULK_LIMIT);let i=n.map(o=>this.dataTransform.fromStorage(o.id,`${this.path}/${o.id}`,o));this.eventManager.publishEvents(i.map(o=>({type:"added",value:o,id:String(o.id),hasPendingWrites:!1})))}async bulkDelete(t){let n=t.map(o=>o.id),i;for(let o of T7(n,1e3))try{let s=await this.addAuthHeader();await fd.delete(`${this.hostname}${this.bulkUri}`,{headers:s,data:o})}catch(s){i=s}if(i)throw i;this.eventManager.publishEvents(n.map(o=>({type:"removed",value:{},id:o,hasPendingWrites:!1})))}async bulkPostChunk(t,n,i){let o;for(let s of T7(n,i)){let a=await t();try{await fd.post(`${this.hostname}${this.bulkUri}`,{nodes:s},{headers:a})}catch(u){if(i>1&&Ag(u)&&u.response?.status===ECa.PayloadTooLarge){await this.bulkPostChunk(t,s,Math.max(i/10,1));continue}o=u}}if(o)throw o}};var JBm=zi.merge(VIe),$Bm=Os("Subgraph",JBm),QAd=vR($Bm,new Got("folderCounter")),Efa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/subgraphs`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/subgraphs`}get wsQuery(){return{}}getCollection(){return new Txt(this.parent,this.serviceOperations,this.logContext)}constructor(t,n,i,o){super(t,"subgraphs",QAd,n,o,[],i.hostnames.metadataService,i)}},Txt=class extends Gv{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/subgraphs`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/subgraphs`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("subgraphs",t,QAd,i,Efa,n.hostnames.metadataService,n)}};var XBm=M.union([zi.merge(smt),zi.merge(amt),zi.merge(umt),zi.merge(cmt)]),ZBm=Os("WorkspaceUser",XBm),UAd=vR(ZBm),Cfa=class extends yC{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/platform-authentications`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/platform-authentications`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i,o){super(t,"users",UAd,n,o,[],i.hostnames.metadataService,i)}getCollection(){return new Ixt(this.parent,this.serviceOperations,this.logContext)}},Ixt=class extends Gv{get baseUri(){return`/api/metadata/v1/workspaces/${this.parent.id}/platform-authentications`}get baseSSEUri(){return`/api/metadata/sse/v1/workspaces/${this.parent.id}/platform-authentications`}get wsQuery(){return{workspaceID:this.parent.id}}constructor(t,n,i){super("users",t,UAd,i,Cfa,n.hostnames.metadataService,n)}};var e5m=zi.merge(iWn),t5m=Os("Workspace",e5m),jAd=vR(t5m,new nwi("latestCommitDate")),Sfa=class extends yC{get baseUri(){return"/api/metadata/v1/workspaces"}get baseSSEUri(){return"/api/metadata/sse/v1/workspaces"}get wsQuery(){return{}}getCollection(){return new Oxt(this.parent,this.serviceOperations,this.logContext)}constructor(t,n,i,o){super(t,"workspaces",jAd,n,o,["jobs","macros","nodes","nodeTypes","subgraphs","workspaceUsers","installedPackages","nodesLastRefreshed"],i.hostnames.metadataService,i)}get nodes(){return this.getSubCollection("nodes",vxt)}node(t){return this.nodes.get(t)}installedPackages=void 0;installedPackage=void 0;get jobs(){return this.getSubCollection("jobs",Cxt)}job(t){return this.jobs.get(t)}get macros(){return this.getSubCollection("macros",Sxt)}macro(t){return this.macros.get(t)}nodesLastRefreshed=void 0;nodeLastRefreshed=void 0;get nodeTypes(){return this.getSubCollection("templates",_xt)}nodeType(t){return this.nodeTypes.get(t)}get subgraphs(){return this.getSubCollection("subgraphs",Txt)}subgraph(t){return this.subgraphs.get(t)}get workspaceUsers(){return this.getSubCollection("users",Ixt)}workspaceUser(t){return this.workspaceUsers.get(t)}isDevEnv=void 0;removeDeletedSteps=void 0},Oxt=class extends Gv{get baseUri(){return"/api/metadata/v1/workspaces"}get baseSSEUri(){return"/api/metadata/sse/v1/workspaces"}get wsQuery(){return{}}async fetchWorkspacesForPermissions(t){return this.select({where:[["devEnv","==",t]],selectFields:["id","project"]})}constructor(t,n,i){super("workspaces",t,jAd,i,Sfa,n.hostnames.metadataService,n)}};var r5m=zi.merge(OWn),n5m=Os("Org",r5m),GAd=vR(n5m),_fa=class extends yC{constructor(t,n,i,o){super(t,"orgs",GAd,n,{...o,orgID:t},["devRuns","globalUsersSettings","projects","runs","userRoles","workspaces"],"NOT_SERVICE_BACKED",i)}get baseUri(){return"orgs"}getCollection(){return new Rxt(this.parent,this.serviceOperations,this.logContext)}get baseSSEUri(){return"orgs"}get wsQuery(){return{}}get workspaces(){return this.getSubCollection("workspaces",Oxt)}workspace(t){return this.workspaces.get(t)}devRuns=void 0;devRun=void 0;globalUsersSettings=void 0;globalUsersSetting=void 0;projects=void 0;project=void 0;runs=void 0;run=void 0;userRoles=void 0;userRole=void 0;getNextCounter=void 0;releaseWorkspaceStatusAndEndRun=void 0;updateLastLoginTime=void 0;writePlanAnalytics=void 0;writeRunAnalyticsSummary=void 0},Rxt=class extends Gv{get baseUri(){return"orgs"}get baseSSEUri(){return"orgs"}get wsQuery(){return{}}constructor(t,n,i){super("orgs",t,GAd,i,_fa,"NOT_SERVICE_BACKED",n)}};var iwi=class extends cP{constructor(t,n){super("root","root",["orgs","users","packagesRegistry","events"],void 0,n,t)}get path(){return"root"}get baseUri(){return"root"}get baseSSEUri(){return"root"}get wsQuery(){return{}}get orgs(){return this.getSubCollection("orgs",Rxt)}org(t){return this.orgs.get(t)}orgsPublic=void 0;orgPublic=void 0;users=void 0;user=void 0;packagesRegistry=void 0;registryPackage=void 0;events=void 0;event=void 0;oauthStates=void 0;oauthState=void 0;activePrompts=void 0;activePrompt=void 0;promptVersions=void 0;promptVersion=void 0;storage=void 0;batch=()=>new rwi;getRepositoryFromPath(t){let n=t.split("/"),i,o;if(n.length){n[0].length||n.shift();for(let s of n)if(i)o=i.get(s),i=void 0;else{if(i=(o??this)[s],!i)return;o=void 0}}return i||o||this}};var Ma=class extends IEe{constructor(n,i,o,s,a,u){super(n.id,n,[],o,s,a);this.collectionRef=n;this.dataTransform=i;this.EntityRepositoryConstructor=u}get path(){return this.collectionRef.path}get(n){let i=this.firestoreOperations.docRef(this.collectionRef,n.toString());return new this.EntityRepositoryConstructor(n,i,this.parent,this.logContext,this.firestoreOperations)}async select(n,i){let o=i?.transaction,s=this.firestoreOperations.createQuery(this.collectionRef,n),a;return o?a=await tx(o.getQuery(s)):a=await tx(this.firestoreOperations.runQuery(s)),a.docs.map(u=>this.transformDataFromStorage(u.ref,this.firestoreOperations.data(u),i))}async selectIDs(n,i){let o=i?.transaction,s=this.firestoreOperations.createQuery(this.collectionRef,n),a;return o?a=await tx(o.getQuery(s)):a=await tx(this.firestoreOperations.runQuery(s)),a.docs.map(u=>u.id)}async createEntity(n,i){let o=i?.transaction,s=await this.generateID(n),a=this.firestoreOperations.docRef(this.collectionRef,s?.toString()),u=await this.prepareDataForCreate(n,s??a.id,i);return o?o.set(a,u):await tx(this.firestoreOperations.addDoc(a,u)),new this.EntityRepositoryConstructor(s||a.id,a,this.parent,this.logContext,this.firestoreOperations)}listenCollection(n,i,o){let[s,a]=this.getListenCallbacks(n,i,o);return this.firestoreOperations.onCollectionSnapshot(this.collectionRef,s,a)}listenQuery(n,i,o,s){let[a,u]=this.getListenCallbacks(i,o,s);return this.firestoreOperations.onQuerySnapshot(this.firestoreOperations.createQuery(this.collectionRef,n),a,u)}async prepareDataForCreate(n,i,o){let s=n.createdBy??this.firestoreOperations.currentUser(),a={...Vc(n),id:i,createdAt:Mk(),createdBy:s,updatedAt:Mk(),updatedBy:s};return this.dataTransform.toStorage(i.toString(),`${this.path}/${i}`,a,this.firestoreOperations,o)}getListenCallbacks(n,i,o){return[s=>{let a=this.firestoreOperations.snapShotChanges(s).reduce((u,l)=>{try{let c=this.transformDataFromStorage(l.doc.ref,l.doc.data(),o);u.push({type:l.type==="added"?"added":l.type==="removed"?"removed":"modified",value:c,id:c.id.toString(),hasPendingWrites:this.firestoreOperations.hasPendingWrites(l.doc)})}catch(c){i&&i(c)}return u},[]);Tc().debug(`Listener notification for ${a.length} changes in collection ${this.path}`),n(a)},s=>{Tc().error(`Firestore error listening to collection ${this.path}`,s),i&&i(dxt(s))}]}transformDataFromStorage(n,i,o){return this.dataTransform.fromStorage(n.id,n.path,i,this.firestoreOperations,o)}async generateID(n){return n.id}async getCount(){return this.firestoreOperations.getCount(this.collectionRef)}async selectInBatches(n,i,o,s=[]){return(await this.firestoreOperations.selectInBatches(this.collectionRef,n,i,o,s)).map(l=>l.docs).flat().map(l=>this.transformDataFromStorage(l.ref,this.firestoreOperations.data(l)))}};var i5m=M.discriminatedUnion("type",[zi.merge(yi.merge(Iy)),zi.merge(yi.merge(AWn)),zi.merge(yi.merge(yWn)),zi.merge(yi.merge(oWn)),zi.merge(yi.merge(bWn)),zi.merge(yi.merge(dWn)),zi.merge(yi.merge(sWn)),zi.merge(yi.merge(aWn)),zi.merge(yi.merge(hWn)),zi.merge(yi.merge(gWn)),zi.merge(yi.merge(mWn))]),o5m=Os("Event",i5m),HAd=Au(o5m),vfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,HAd,i,o,s)}},owi=class extends Ma{constructor(t,n,i,o){super(t,HAd,n,i,o,vfa)}createEventCore(t,n,i,o,s,a,u){return{type:"core",orgID:t,event:n,resourceType:i,resourceID:o,fromID:s,requestedBy:a,requestedByUserAgent:u}}async createDuplicatePkgNodeTypeEvent(t,n,i,o,s,a,u,l){let d={...this.createEventCore(t,"workspaces.nodeType.duplicate","NodeType",n,i,o,l),type:"duplicate",packageID:s,releaseID:a,workspaceID:u};return(await this.createEntity(d)).id}async createInstallPkgNodeTypeEvent(t,n,i,o,s,a){let l={...this.createEventCore(t,"workspaces.nodeType.install","NodeType",n,"",s,a),type:"install",packageID:n,releaseID:i,workspaceID:o};return(await this.createEntity(l)).id}async createEnableTotpTypeEvent(t,n,i){let o=this.createEventCore(t,"users.auth.enableTotp","Auth","Totp","",n,i);return(await this.createEntity(o)).id}async createDisableTotpTypeEvent(t,n,i,o){let s=this.createEventCore(t,"users.auth.disableTotp","Auth","Totp",i,n,o);return(await this.createEntity(s)).id}async createAIColumnDescriptionsTypeEvent(t,n,i,o,s,a,u,l){let d={...this.createEventCore(t,"ai.description.columnDescriptions","AI","Description",n,n,l),type:"update",workspaceID:i,nodeID:o,acceptedDescriptionsCount:s,modifiedDescriptionsCount:a,rejectedDescriptionsCount:u};return(await this.createEntity(d)).id}async createNewWorkspaceWizardTypeEvent(t,n,i,o,s,a,u,l,c,d){let p=this.createEventCore(t,"workspaces.create.newWorkspace","NewWorkspace",i.toString(),c?.toString()??"",l,d),f=typeof s=="string"?new Date(s):s,A={...p,type:"create",projectID:n,stepNumber:o,startTime:f,endTime:a,status:u};return(await this.createEntity(A)).id}async createAINodeDescriptionTypeEvent(t,n,i,o,s,a){let l={...this.createEventCore(t,"ai.description.nodeDescription","AI",o,"",n,a),type:"update_node_description",workspaceID:i,nodeID:o,action:s};return(await this.createEntity(l)).id}async createAIGitCommitMessageRequestEvent(t,n,i,o,s,a,u){let c={...this.createEventCore(t,"ai.git.commit","AI",u,"",n),type:"request",fileCount:i,diffContent:o,charCount:s,latencyMs:a,aiGitRequestId:u};return(await this.createEntity(c)).id}async createAIGitCommitMessageActionEvent(t,n,i,o,s,a,u){let c={...this.createEventCore(t,"ai.git.commit","AI","",n,u),type:"action",aiMessage:i,finalMessage:o,editDistance:s,action:a,aiGitRequestId:u};return(await this.createEntity(c)).id}async createMinimapEvent(t,n,i,o,s,a){let l={...this.createEventCore(t,"workspaces.graph.minimap",n,i,o.toString(),s),type:"minimap",isEnabled:a,time:new Date};return(await this.createEntity(l)).id}async createFilterToggleEvent(t,n,i,o,s){let u={...this.createEventCore(t,"workspaces.graph.filter",n.includes("subgraph")?"Subgraph":"BrowserGraph",n,i.toString(),o),type:"filterToggle",isVisible:s,time:new Date};return(await this.createEntity(u)).id}async createGraphContextFilterEvent(t,n,i,o,s,a){let l={...this.createEventCore(t,"workspaces.graph.contextMenu",i,n,o.toString(),s),type:"graphContextMenu",filter:a,time:new Date};return(await this.createEntity(l)).id}};var s5m=Os("Event",yXu),WAd=Au(s5m),Tfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,WAd,i,o,s)}},swi=class extends Ma{constructor(t,n,i,o){super(t,WAd,n,i,o,Tfa)}};var a5m=We("FIREBASE"),awi=class extends Q_{transformFromStorage(t,n,i){let o=[];i.orgName||(o.push("Adding property orgName with default value"),i.orgName="");let s=i.licenseDetails;return typeof s=="object"&&(s.trialActivator||(o.push("Adding property licenseDetails.trialActivator with default value"),s.trialActivator=""),s.companyName||(o.push("Adding property licenseDetails.companyName with default value"),s.companyName="")),o.length>0&&a5m.debug(`Patched org ${n}`,o),i}};var u5m=zi.merge(J$u),c5m=Os("GitAccount",u5m),VAd=Au(c5m),Ifa=class extends Ra{constructor(t,n,i,o,s){super(t,n,VAd,i,o,s)}},uwi=class extends Ma{constructor(t,n,i,o){super(t,VAd,n,i,o,Ifa)}async generateID(t){return t.id??Za()}};var l5m=zi.merge(TXu),d5m=Os("ProjectGitAccount",l5m),KAd=Au(d5m),Ofa=class extends Ra{constructor(t,n,i,o,s){super(t,n,KAd,i,o,s)}},cwi=class extends Ma{constructor(t,n,i,o){super(t,KAd,n,i,o,Ofa)}async generateID(t){return t.id??Za()}};var p5m=zi.merge(X$u),f5m=Os("GlobalUserSettings",p5m),YAd=Au(f5m),Rfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,YAd,i,o,s,["gitAccounts","projectGitAccounts"])}get gitAccounts(){return this.getSubCollection("gitAccounts",uwi)}gitAccount(t){return this.gitAccounts.get(t)}get projectGitAccounts(){return this.getSubCollection("projectGitAccounts",cwi)}projectGitAccount(t){return this.projectGitAccounts.get(t)}},lwi=class extends Ma{constructor(t,n,i,o){super(t,YAd,n,i,o,Rfa)}listUsers(){return this.firestoreOperations.getChildren(this.collectionRef)}};var A5m=zi.merge(U0s),h5m=Os("Project",A5m),JAd=Au(h5m),Mfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,JAd,i,o,s)}},dwi=class extends Ma{constructor(t,n,i,o){super(t,JAd,n,i,o,Mfa)}async generateID(t){return t.id??Za()}};var pwi=(r,t,n)=>{let i=typeof r=="string"?parseInt(r):r;if(isNaN(i)||i===void 0)throw new t(`Missing or invalid environment ID '${r}' context=${JSON.stringify(n)}`);return i};var g5m=We("FIREBASE"),fwi=class extends Q_{transformFromStorage(t,n,i){let o=i,s=[];return"endTime"in o&&(s.push("Removing property 'endTime'"),delete o.endTime),(!o.version||o.version<qFe)&&(s.push(`Updating version ${o.version} to ${qFe}`),o.version=qFe),o.runDetails&&!o.runDetails.environmentID&&("toWorkspaceID"in o.runDetails&&o.runDetails.toWorkspaceID!=null?(s.push(`Found runDetails.toWorkspaceID with value ${o.runDetails.toWorkspaceID}; setting to runDetails.environmentID`),o.runDetails.environmentID=o.runDetails.toWorkspaceID.toString()):(s.push('Setting missing runDetails.environmentID to "0"'),o.runDetails.environmentID="0")),o.runDetails&&"toWorkspaceID"in o.runDetails&&(s.push("Deleting runDetails.toWorkspaceID"),delete o.runDetails.toWorkspaceID),g5m.debug(`Patched run ${n}`,s),o}};var m5m=We("FIREBASE"),Awi=class extends Q_{transformFromStorage(t,n,i){let o=[];return!i.queryResultSequence&&Array.isArray(i.history)&&i.history.length>0&&(o.push("Moving 'history[0]' to 'queryResultSequence'"),i.queryResultSequence=i.history[0]?.queryResultSequence,delete i.history),(i.runExecutionSequenceID===void 0||i.runExecutionSequenceID===null)&&(o.push("Setting 'runExecutionSequenceID' to zero"),i.runExecutionSequenceID=0),(i.name===void 0||i.name===null)&&(o.push("Setting 'name' to 'unknown'"),i.name="unknown"),i.queryResultSequence?.queryResults?.map((s,a)=>{s.isRunning!==!0&&typeof s=="object"&&(s.status||(o.push(`Setting 'status' to 'Failure' for query result ${a}`),s.status="Failure"),s.type||(o.push(`Setting 'type' to 'sql' for query result ${a}`),s.type="sql"),s.exportedRefs||(o.push(`Setting 'exportedRefs' to empty array for query result ${a}`),s.exportedRefs=[]),s.invalidExportedRefs||(o.push(`Setting 'invalidExportedRefs' to empty array for query result ${a}`),s.invalidExportedRefs=[]),s.fields||(o.push(`Setting 'fields' to empty array for query result ${a}`),s.fields=[]),s.sql||(o.push(`Setting 'sql' to empty string for query result ${a}`),s.sql=""),s.rows||(o.push(`Setting 'rows' to empty array for query result ${a}`),s.rows=[]),s.startTime||(o.push(`Setting 'startTime' to ${ofe.toISOString} for query result ${a}`),s.startTime=ofe),s.endTime||(o.push(`Setting 'endTime' to ${ofe.toISOString} for query result ${a}`),s.endTime=ofe),s.fields?.map((u,l)=>{o.push(`Setting 'type' to 'unknown' for field ${l} of query result ${a}`),u.type||(u.type="unknown")}),s.error?.message&&(s.error.errorString||(o.push(`Setting 'error.errorString' to 'error.message' for query result ${a}`),s.error.errorString=s.error.message),o.push(`Removing 'error.message' for query result ${a}`),delete s.error.message),s.error?.originalError&&(o.push(`Removing 'error.originalError' from query result ${a}`),delete s.error.originalError))}),i.runResultVersion=2,i.version=2,o.length>0&&m5m.debug(`Patched run result ${n}`,o),i}};var y5m=zi.merge(RWn),b5m=Os("QueryResult",y5m),mwi=Au(b5m),wfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,mwi,i,o,s)}},Pfa=class extends Ma{constructor(t,n,i,o){super(t,mwi,n,i,o,wfa)}},Nfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,mwi,i,o,s)}},Dfa=class extends Ma{constructor(t,n,i,o){super(t,mwi,n,i,o,Nfa)}},E5m=zi.merge(PWn),C5m=Os("RunResult",E5m),ywi=Au(C5m,new Awi),xfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ywi,i,o,s,["queryResults"])}get queryResults(){return this.getSubCollection("queryResults",Pfa)}queryResult(t){return this.queryResults.get(t)}},hwi=class extends Ma{constructor(t,n,i,o){super(t,ywi,n,i,o,xfa)}},Bfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ywi,i,o,s,["queryResults"])}get queryResults(){return this.getSubCollection("queryResults",Dfa)}queryResult(t){return this.queryResults.get(t)}},gwi=class extends Ma{constructor(t,n,i,o){super(t,ywi,n,i,o,Bfa)}};var OEe=We("FIREBASE"),S5m=M.discriminatedUnion("runType",[zi.merge(J0s),zi.merge(QXu),zi.merge($0s)]),_5m=Os("Run",S5m),Cwi=Au(_5m,new fwi,!0),kfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,Cwi,i,{...o,runID:t},s,["runResults"])}get runResults(){return this.getSubCollection("runResults",hwi)}runResult(t){return this.runResults.get(t)}async updateHeartbeat(t={},n){return this.merge({...t,runHeartbeat:Mk()},{...n,retryOptions:{attempts:3,tags:["[FirestoreRunRepo.updateHeartbeat()]"],waitSeconds:5}})}},bwi=class extends Ma{constructor(t,n,i,o){super(t,Cwi,n,i,o,kfa)}async createDeployRun(t,n){let i=pwi(t.runDetails.environmentID,mo,this.logContext),o={...this.logContext,environmentID:i},s=(l,c)=>(Z1s(l,"deploy",t.runDetails.forcedDeployment,o),{status:"Deploying",currentlyRunningJobs:l.currentlyRunningJobs?l.currentlyRunningJobs.concat(c):[c]}),a={...t,runDetails:{...t.runDetails}};for(let l of BXu)delete a.runDetails[l];let u=await qfa(this,i,a,s,n);return FBe(o,u.id),OEe.infoContext(o,"FirestoreOrgRepo createDeployRun: finished securing workspace"),u}async createRefreshRun(t,n){let i=pwi(t.runDetails.environmentID,mo,this.logContext),o={...this.logContext,environmentID:i},a=await qfa(this,i,t,(u,l)=>(Z1s(u,"refresh",t.runDetails.forceIgnoreWorkspaceStatus,o),{status:u.status==="Failed Deploy"?u.status:"Refreshing",currentlyRunningJobs:u.currentlyRunningJobs?u.currentlyRunningJobs.concat(l):[l]}),n);return FBe(o,a.id),OEe.infoContext(o,"FirestoreOrgRepo createRefreshRun: finished securing workspace"),a}},Lfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,Cwi,i,{...o,runID:t},s,["runResults"])}get runResults(){return this.getSubCollection("runResults",gwi)}runResult(t){return this.runResults.get(t)}async updateHeartbeat(t={}){let n=this.prepareDataForMerge(t);n.runHeartbeat=this.firestoreOperations.getServerTimestampSentinel(),await this.firestoreOperations.updateDoc(this.docRef,n)}},Ewi=class extends Ma{constructor(t,n,i,o){super(t,Cwi,n,i,o,Lfa)}async createDevRun(t){let n=pwi(t.runDetails.environmentID,mo,this.logContext),i={...this.logContext,environmentID:n},o=(a,u)=>{if(!a.devEnv)throw new mo(`Unable to secure ${a.name}`,`${a.name} is a not a development workspace, context=${JSON.stringify(i)}`);return{currentlyRunningDevJobs:a.currentlyRunningDevJobs?a.currentlyRunningDevJobs.concat(u):[u]}};delete t.runDetails.dependencies;let s=await qfa(this,n,t,o);return FBe(i,s.id),OEe.infoContext(i,"FirestoreOrgRepo createDevRun: finished securing workspace"),s}},qfa=(r,t,n,i,o)=>{let s=r.parent.workspace(t),a={...r.logContext,environmentID:t};return r.runTransaction(o,async u=>{OEe.infoContext(a,"securing workspace status");let[l,c]=await Promise.all([FYn(s,vu().featureFlags,a,"FirestoreDevRunsRepo - createRun",u,vu().authToken),r.parent.getNextCounter(r.id.substring(0,r.id.length-1),1,u)]);FBe(a,c),OEe.infoContext(a,"got workspace doc data, updating workspace",{status:l?.status,jobs:l?.currentlyRunningJobs});let d=()=>{try{return i(l,c)}catch(A){if(OEe.errorContext(a,"createRun: error updating workspace",{error:A}),A instanceof cfe){let g=A.detail??`${l.name} is in state ${l.status},`;throw new y3(A.message,g+` context=${JSON.stringify(a)}.`)}throw A}};await s.merge(d(),u),OEe.infoContext(a,`Run ${c} will use the following mappings:`,l.mappingsV1),OEe.infoContext(a,"reserving run");let p=await r.prepareDataForCreate(n,c);p.runStartTime=r.firestoreOperations.getServerTimestampSentinel(),p.runHeartbeat=r.firestoreOperations.getServerTimestampSentinel();let f=r.get(c);return u.transaction.set(f.docRef,p),f})};var v5m=We("FIREBASE"),Swi=class extends Q_{transformFromStorage(t,n,i){let o=i,s=[];o.projects||(o.projects={},s.push("Changing userRoles.projects from undefined to empty object"));let a=(u,l,c,d)=>{let p=l.indexOf(c);p>=0&&(s.push(`Changing ${u} role '${c}' to '${d}'`),l[p]=d)};for(let u of Object.values(o?.projects)){u.projectRoles?(a("project",u.projectRoles,"reader","member"),a("project",u.projectRoles,"owner","admin")):(u.projectRoles=[],s.push("Changing project.projectRoles from undefined to empty array"));for(let l of Object.values(u?.environments))l.environmentRoles?a("env",l.environmentRoles,"owner","admin"):(l.environmentRoles=[],s.push("Changing env.environmentRoles from undefined to empty array"))}return s.length>0&&v5m.debug(`Patched userRoles ${n}`,s),i}};var GNe=We("USER_MANAGEMENT"),T5m=zi.merge(GXu),I5m=Os("UserRoles",T5m),$Ad=Au(I5m,new Swi),zfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,$Ad,i,o,s)}async upsertProjectRoles(t,n,i){return await this.runTransaction(i,async o=>{await this.parent.project(n).fetch(o);let s=await this.fetch(o);(s.projects[n]?.projectRoles.includes("admin")??!1)&&!t.projectRoles.includes("admin")&&await this.throwIfLastProjectAdmin(n,o);let l=Vc(s.projects[n]);return Object.values(t.environments).forEach(c=>{t.projectRoles.includes("member")?c.environmentRoles=[]:t.projectRoles.includes("admin")?c.environmentRoles=["admin"]:c.environmentRoles=["reader"]}),s.projects[n]=t,await this.save(s,o),GNe.infoContext(this.logContext,`User project roles updated for user ${s.id} at project ${n}. Previous roles:`,l,"New roles:",s.projects[n]),s})}async upsertProjectRole(t,n,i){return await this.runTransaction(i,async o=>{await this.parent.project(n).fetch(o);let s=await this.fetch(o);(s.projects[n]?.projectRoles.includes("admin")??!1)&&t!=="admin"&&await this.throwIfLastProjectAdmin(n,o);let l=Vc(s.projects[n]),c=s.projects[n];return c?c.projectRoles=[t]:s.projects[n]={projectRoles:[t],environments:{}},await this.save(s,o),GNe.infoContext(this.logContext,`User project roles updated for user ${s.id} at project ${n}. Previous roles:`,l,"New roles:",s.projects[n]),s})}async upsertUserOrganizationRoles(t,n){return await this.runTransaction(n,async i=>{let o;try{o=await this.fetch(i)}catch(c){if(y1(c)&&(c instanceof Ya||c instanceof m3))o={id:this.id,organizationRoles:[],projects:{}};else throw c}let s=o.organizationRoles.includes("admin"),a=t.includes("admin");s&&!a&&await this.throwIfLastOrgAdmin(i);let l=Vc(o.organizationRoles);return o.organizationRoles=t,await this.save(o,i),GNe.infoContext(this.logContext,`User org roles updated for user ${o.id}. Previous roles:`,l,"New roles:",o.organizationRoles),o})}async upsertEnvironmentRoles(t,n,i,o){return await this.runTransaction(o,async s=>{let a=await this.parent.workspace(i).fetch(s);if(a.project!==n||a.devEnv)throw new Ya(`Environment ${i} not found`);let u=await this.fetch(s);if(!u.projects[n]?.projectRoles.length)throw new m3("User must have a project role before being granted any environment roles therein");(u.projects[n]?.environments[i]?.environmentRoles.includes("admin")??!1)&&!t.environmentRoles.includes("admin")&&await this.throwIfLastEnvironmentAdmin(n,i,s);let d=Vc(u.projects[n].environments[i]);return u.projects[n].environments[i]=t,await this.save(u,s),GNe.infoContext(this.logContext,`User env roles updated for user ${u.id} at envID ${i} in project ${n}. Previous roles:`,d,"New roles:",u.projects[n].environments[i]),u})}async upsertEnvironmentRole(t,n,i,o,s){return await this.runTransaction(s,async a=>{let u=await this.parent.workspace(i).fetch(a);if(u.project!==n||u.devEnv)throw new Ya(`Environment ${i} not found`);let l=await this.fetch(a);if((l.projects[n]?.environments[i]?.environmentRoles.includes("admin")??!1)&&t!=="admin"&&await this.throwIfLastEnvironmentAdmin(n,i,a),!l.projects[n]?.projectRoles.length)if(o?.setDefaultProjectRole)l.projects[n]?l.projects[n].projectRoles=[o.setDefaultProjectRole]:l.projects[n]={projectRoles:[o.setDefaultProjectRole],environments:{}};else throw new m3("User must have a project role before being granted any environment roles therein");let p=Vc(l.projects[n].environments[i]),f=l.projects[n].environments[i];return f?f.environmentRoles=[t]:l.projects[n].environments[i]={environmentRoles:[t]},await this.save(l,a),GNe.infoContext(this.logContext,`User env roles updated for user ${l.id} at envID ${i} in project ${n}. Previous roles:`,p,"New roles:",l.projects[n].environments[i]),l})}async deleteUserProjectRoles(t,n){return await this.runTransaction(n,async i=>{let o=await this.fetch(i);(o.projects[t]?.projectRoles.includes("admin")??!1)&&await this.throwIfLastProjectAdmin(t,i);let a=Vc(o.projects[t]);delete o.projects[t],await this.save(o,i),GNe.infoContext(this.logContext,`User project roles deleted for user ${o.id} at projectID ${t}. Previous roles:`,a)})}async deleteUserEnvironmentRoles(t,n,i){return await this.runTransaction(i,async o=>{let s=await this.fetch(o);(s?.projects[t]?.environments[n]?.environmentRoles.includes("admin")??!1)&&await this.throwIfLastEnvironmentAdmin(t,n,o);let u=Vc(s.projects[t].environments[n]);delete s.projects[t].environments[n],await this.save(s,o),GNe.infoContext(this.logContext,`User environment roles deleted for user ${s.id} at envID ${n} in project ${t}. Previous roles:`,u)})}async throwIfLastOrgAdmin(t){return await this.runTransaction(t,async n=>{if((await this.parent.userRoles.select({where:[["organizationRoles","array-contains","admin"]]},n)).length<2)throw new y3("Role change failed, at least one org admin is required")})}async throwIfLastProjectAdmin(t,n){return await this.runTransaction(n,async i=>{if((await this.parent.userRoles.select({where:[[`projects.${t}.projectRoles`,"array-contains","admin"]]},i)).length<2)throw new y3("Role change failed, at least one project admin is required")})}async throwIfLastEnvironmentAdmin(t,n,i){return await this.runTransaction(i,async o=>{let s=await this.parent.userRoles.select({where:[[`projects.${t}.environments.${n}.environmentRoles`,"array-contains","admin"]]},o),a=await this.parent.userRoles.select({where:[[`projects.${t}.projectRoles`,"array-contains","admin"]]},o),u=s.length<2;if(!a.length&&u)throw new y3("Role change failed, at least one environment admin is required")})}},_wi=class extends Ma{constructor(t,n,i,o){super(t,$Ad,n,i,o,zfa)}};var O5m=We("FIREBASE"),vwi=class extends Q_{transformFromStorage(t,n,i){let o=i,s=[];return o.status||(s.push("setting missing 'status' property to 'initializing'"),o.status="Initializing"),o.version||(s.push(`setting missing 'version' property to '${PFe}'`),o.version=PFe),o.tagColors||(s.push("Setting missing 'tagColors' property to default"),o.tagColors={backgroundColor:Ahs,textColor:"#e5e5e5"}),o.mappingsV1||(s.push("Setting missing 'mappingsV1' property to '{}'"),o.mappingsV1="{}"),o.version===0&&(o.mappings||(s.push("Setting missing 'mappings' property to empty object"),o.mappings={}),o.deployedWorkspaces||(s.push("Setting missing 'deployedWorkspaces' property to empty object"),o.deployedWorkspaces={})),(o.mappingsV1===null||o.mappingsV1===void 0)&&(s.push("Settings missing 'mappingsV1' property to an empty string"),o.mappingsV1=""),o.name||(o.name=`Workspace${t}`,s.push(`Setting missing 'name' property to '${o.name}`)),s.length>0&&O5m.debug(`Patched workspace ${n}:`,s),o}};var R5m=zi.merge(BFe),M5m=Os("InstalledPackage",R5m),XAd=Au(M5m),Ffa=class extends Ra{constructor(t,n,i,o,s){super(t,n,XAd,i,o,s)}},Twi=class extends Ma{constructor(t,n,i,o){super(t,XAd,n,i,o,Ffa)}};var w5m=zi.merge(SK),P5m=Os("Job",w5m),ZAd=Au(P5m),Qfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ZAd,i,o,s)}async fetchAndMerge(t,n){return n?.uniquenessConstraints?this.runTransaction(n,async i=>{let o=await this.fetch(i);if(o.name!==t.name&&(await this.parent.jobs.select({where:[[n.uniquenessConstraints.field,"in",n.uniquenessConstraints.values]]},i)).length>0)throw new y3(`${n.uniquenessConstraints.field} must be unique`);return super.save(super.mergeWithDeletes(o,t),i)}):super.fetchAndMerge(t,n)}},Iwi=class extends Ma{constructor(t,n,i,o){super(t,ZAd,n,i,o,Qfa)}async generateID(t){return t.id??this.parent.parent.getNextCounter("job")}createEntity(t,n){return n?.uniquenessConstraints?this.runTransaction(n,async i=>{if((await this.select({where:[[n.uniquenessConstraints.field,"in",n.uniquenessConstraints.values]]},i)).length>0)throw new y3(`${n.uniquenessConstraints.field} must be unique`);return await super.createEntity(t,i)}):super.createEntity(t,n)}};var N5m=zi.merge(aL),D5m=Os("Macro",N5m),ehd=Au(D5m,void 0,!0),Ufa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ehd,i,o,s)}},Owi=class extends Ma{constructor(t,n,i,o){super(t,ehd,n,i,o,Ufa)}};var x5m=zi.merge(xFe),B5m=Os("NodeType",x5m),thd=Au(B5m),jfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,thd,i,o,s)}},Rwi=class extends Ma{constructor(t,n,i,o){super(t,thd,n,i,o,jfa)}async generateID(t){return t.id??(await this.parent.parent.getNextCounter("template")).toString()}};var k5m=M.discriminatedUnion("type",[zi.merge(yi.merge(EK)),zi.merge(yi.merge(CK))]),L5m=Os("Node",k5m),rhd=Au(L5m,new XKn),Gfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,rhd,i,{...o,nodeID:t},s)}async delete(t){if(await super.delete(t),this.docRef.parent.id==="steps"){let n=this.firestoreOperations.collectionRef(this.docRef.parent.parent,"deletedSteps"),i=this.firestoreOperations.docRef(n,this.id);await this.firestoreOperations.saveDoc(i,{deletedAt:this.firestoreOperations.getServerTimestampSentinel()})}}mergeMetadata(t,n){return this.merge(Object.fromEntries(Object.entries(t).map(([i,o])=>[`metadata.${i}`,o])),n)}},Mwi=class extends Ma{constructor(t,n,i,o){super(t,rhd,n,i,o,Gfa)}async generateID(t){return t.id??Za()}listenCollection(t,n,i){throw new Yp("The firestore nodes repository listener is not implemented. Use listenCollectionOverride")}listenCollectionOverride(t,n,i,o,s){let[a,u]=this.getListenCallbacks(t,o,s),l=this.firestoreOperations.onCollectionSnapshot(this.collectionRef.orderBy("updatedAt").startAfter(n),a,u),c=p=>{let A=[...p.docChanges()].map(g=>({type:"removed",id:g.doc.id,doc:g.doc,oldIndex:-1,newIndex:-1})).filter(g=>{let b=g.doc.data(),_=i[g.doc.id];if(_)if(_.updatedAt){let v=new Date(_.updatedAt),O=b.deletedAt?b.deletedAt.toDate():v;return v<=O}else return!0;return!1}).map(g=>({type:"removed",value:{id:g.doc.id},id:g.doc.id,hasPendingWrites:!1}));t(A)},d=this.firestoreOperations.onCollectionSnapshot(this.collectionRef.parent.collection("deletedSteps").orderBy("deletedAt").startAfter(n),c,u);return()=>{l(),d()}}convertFromRestAPIStorage(t,n){return this.transformDataFromStorage({id:n},t)}async getNodesLocationInfo(){let t=this.firestoreOperations.createQuery(this.collectionRef,{selectFields:["id","name","locationName","sqlType","type"]}),n=await this.firestoreOperations.runQuery(t),i={};return n.forEach(o=>{let s=H$u.verify({operation:{...o.data()}});i[o.id]=s}),i}};var q5m=zi.merge(mXu),z5m=Os("NodeLastRefreshed",q5m),nhd=Au(z5m,void 0,!0),Hfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,nhd,i,{...o,nodeID:t},s)}},wwi=class extends Ma{constructor(t,n,i,o){super(t,nhd,n,i,o,Hfa)}async generateID(t){return t.id??Za()}};var F5m=zi.merge(VIe),Q5m=Os("Subgraph",F5m),ihd=Au(Q5m),Wfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ihd,i,o,s)}fetchAndMerge(t,n){return n?.uniquenessConstraints?this.runTransaction(n,async i=>{if((await this.fetch(i)).name!==t.name&&(await this.parent.subgraphs.select({where:[[n.uniquenessConstraints.field,"in",n.uniquenessConstraints.values]]},i)).length>0)throw new y3(`${n.uniquenessConstraints.field} must be unique`);let a=this.prepareDataForMerge(t,n);return i.transaction.update(this.docRef,a)}):super.fetchAndMerge(t,n)}},Pwi=class extends Ma{constructor(t,n,i,o){super(t,ihd,n,i,o,Wfa)}async generateID(t){return t.id??(await this.parent.parent.getNextCounter("subgraph")).toString()}async createEntity(t,n){let i=await this.generateID(t);return n?.uniquenessConstraints?this.runTransaction(n,async o=>{if((await this.select({where:[[n.uniquenessConstraints.field,"in",n.uniquenessConstraints.values]]},o)).length>0)throw new y3(`${n.uniquenessConstraints.field} must be unique`);return super.createEntity({...t,id:i},o)}):super.createEntity({...t,id:i},n)}};var U5m=We("FIREBASE"),Nwi=class extends Q_{transformFromStorage(t,n,i){let o=[];return["connectionDetails","authenticator"].forEach(s=>{i?.connectionDetails?.hasOwnProperty(s)&&(o.push(`deleting property 'connectionDetails.${s}']`),delete i.connectionDetails[s])}),o.length>0&&U5m.debug(`Patched workspace user ${n}`,o),i}};var j5m=M.union([zi.merge(smt),zi.merge(amt),zi.merge(umt),zi.merge(cmt)]),G5m=Os("WorkspaceUser",j5m),ohd=Au(G5m,new Nwi),Vfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ohd,i,o,s)}},Dwi=class extends Ma{constructor(t,n,i,o){super(t,ohd,n,i,o,Vfa)}};var H5m=zi.merge(iWn),W5m=Os("Workspace",H5m),shd=Au(W5m,new vwi,!0),Kfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,shd,i,o,s,["jobs","macros","nodes","nodeTypes","subgraphs","workspaceUsers","installedPackages","nodesLastRefreshed"])}get installedPackages(){return this.getSubCollection("installedPackages",Twi)}installedPackage(t){return this.installedPackages.get(t)}get jobs(){return this.getSubCollection("jobs",Iwi)}job(t){return this.jobs.get(t)}get macros(){return this.getSubCollection("macros",Owi)}macro(t){return this.macros.get(t)}get nodes(){return this.getSubCollection("steps",Mwi)}node(t){return this.nodes.get(t)}get nodesLastRefreshed(){return this.getSubCollection("nodesLastRefreshed",wwi)}nodeLastRefreshed(t){return this.nodesLastRefreshed.get(t)}get nodeTypes(){return this.getSubCollection("templates",Rwi)}nodeType(t){return this.nodeTypes.get(t)}get subgraphs(){return this.getSubCollection("folders",Pwi)}subgraph(t){return this.subgraphs.get(t)}get workspaceUsers(){return this.getSubCollection("users",Dwi)}workspaceUser(t){return this.workspaceUsers.get(t)}async isDevEnv(){return!!(await this.fetch()).devEnv}async removeDeletedSteps(){let n=this.firestoreOperations.collectionRef(this.docRef,"deletedSteps").orderBy("__name__").limit(100),i=async(o,s)=>{try{let a=this.parent.parent.batch(),u=await n.get();if(u.size===0){o();return}let c=[...u.docs].map(d=>({docRef:d.ref}));for(let d of c)await a.delete(d,{});await a.commit(),process.nextTick(()=>{i(o,s)})}catch(a){s(a)}};return new Promise((o,s)=>i(o,s))}},xwi=class extends Ma{constructor(t,n,i,o){super(t,shd,n,i,o,Kfa)}async generateID(t){return t.id??this.parent.getNextCounter("workspace")}async fetchWorkspacesForPermissions(t){let n=this.firestoreOperations.createQuery(this.collectionRef,{selectFields:["id","project"],where:[["devEnv","==",t]]});return(await this.firestoreOperations.runQuery(n)).docs.map(s=>s.data())}};var V5m=zi.merge(OWn),K5m=Os("Org",V5m),ahd=Au(K5m,new awi),Y5m={gitRepo:"gitRepo",workspace:"workspace",job:"job",subgraph:"folder",location:"location",connection:"connection",template:"template",run:"run",devRun:"devRun"},Yfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,ahd,i,{...o,orgID:t},s,["devRuns","globalUsersSettings","projects","runs","userRoles","workspaces"])}get devRuns(){return this.getSubCollection("devRuns",Ewi)}devRun(t){return this.devRuns.get(t)}get globalUsersSettings(){return this.getSubCollection("globalUsersSettings",lwi)}globalUsersSetting(t){return this.globalUsersSettings.get(t)}get projects(){return this.getSubCollection("projects",dwi)}project(t){return this.projects.get(t)}get runs(){return this.getSubCollection("runs",bwi)}run(t){return this.runs.get(t)}get userRoles(){return this.getSubCollection("userRoles",_wi)}userRole(t){return this.userRoles.get(t)}get workspaces(){return this.getSubCollection("workspaces",xwi)}workspace(t){return this.workspaces.get(t)}async getNextCounter(t,n=1,i){if(!n||n<=0)throw new Pee(`getNextCounter() expected reserveCount value greater than zero, received ${n}`);let o=Y5m[t];if(!o)throw new Pee(`getNextCounter() received unsupported counter name '${t}'`);return this.runTransaction(i,async s=>{let a=await this.fetch(s),u=`${o}Counter`,l=u in a?a[u]??0:0;return await this.merge({[u]:l+n},s),l+1})}async releaseWorkspaceStatusAndEndRun(t,n,i,o,s,a){return this.runTransaction(a,async u=>{let l=this.workspace(t),c=await l.fetch(u),{newStatus:d,remainingActiveRuns:p}=await o();c.status=d??c.status,i==="run"?c.currentlyRunningJobs=p:c.currentlyRunningDevJobs=p,await l.save(c,u);let f=this[i](n);return u.transaction.update(f.docRef,{...f.prepareDataForMerge(s,u),runEndTime:this.firestoreOperations.getServerTimestampSentinel()}),c.status})}async updateLastLoginTime(){let t=this.prepareDataForMerge({});t.lastLoginTime=this.firestoreOperations.getServerTimestampSentinel(),await this.firestoreOperations.updateDoc(this.docRef,t)}async writePlanAnalytics(t,n){let i=this.firestoreOperations.collectionRef(this.docRef,"planAnalytics"),o=this.firestoreOperations.docRef(i,t);await this.firestoreOperations.saveDoc(o,n)}async writeRunAnalyticsSummary(t,n,i,o,s,a){let u=this[n](t),l=this.firestoreOperations.collectionRef(u.docRef,"analyticsSummary"),c=this.firestoreOperations.docRef(l,"summary"),d=this.firestoreOperations.docRef(l,"runPhases"),p=this.firestoreOperations.batch();if(this.firestoreOperations.saveDocBatch(p,c,i),this.firestoreOperations.saveDocBatch(p,d,o),s){let f=this.firestoreOperations.docRef(l,"planPhases");this.firestoreOperations.saveDocBatch(p,f,s)}if(await this.firestoreOperations.commitBatch(p),a.length>0){let f=this.firestoreOperations.collectionRef(d,"queries"),A=500;for(let g=0;g<a.length;g+=A){let b=this.firestoreOperations.batch();a.slice(g,g+A).forEach((v,O)=>{let R=`${v.nodeId}-${v.stageName}-${g+O}`,w=this.firestoreOperations.docRef(f,R);this.firestoreOperations.saveDocBatch(b,w,v)}),await this.firestoreOperations.commitBatch(b)}}}},Bwi=class extends Ma{constructor(t,n,i,o){super(t,ahd,n,i,o,Yfa)}};var J5m=zi.merge(SXu),$5m=Os("OrgPublic",J5m),uhd=Au($5m),Jfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,uhd,i,{...o,orgID:t},s)}},kwi=class extends Ma{constructor(t,n,i,o){super(t,uhd,n,i,o,Jfa)}};var X5m=zi.merge(pWn),Z5m=Os("RegistryPackageRelease",X5m),chd=Au(Z5m),$fa=class extends Ra{constructor(t,n,i,o,s){super(t,n,chd,i,o,s)}},Lwi=class extends Ma{constructor(t,n,i,o){super(t,chd,n,i,o,$fa)}};var e6m=zi.merge(fWn),t6m=Os("RegistryPackage",e6m),lhd=Au(t6m),Xfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,lhd,i,o,s,["releases"])}get releases(){return this.getSubCollection("releases",Lwi)}release(t){return this.releases.get(t)}},qwi=class extends Ma{constructor(t,n,i,o){super(t,lhd,n,i,o,Xfa)}};var r6m=zi.merge(OXu),n6m=Os("ActivePrompt",r6m),dhd=Au(n6m),i6m=zi.merge(RXu),o6m=Os("PromptVersion",i6m),phd=Au(o6m),Zfa=class extends Ra{constructor(t,n,i,o,s){super(t,n,dhd,i,{...o,nodeID:t},s)}},eAa=class extends Ra{constructor(t,n,i,o,s){super(t,n,phd,i,{...o,nodeID:t},s)}},zwi=class extends Ma{constructor(t,n,i,o){super(t,dhd,n,i,o,Zfa)}},Fwi=class extends Ma{constructor(t,n,i,o){super(t,phd,n,i,o,eAa)}};var s6m=We("FIREBASE"),Qwi=class extends Q_{transformFromStorage(t,n,i){return i.accountType||(s6m.debug(`Patched user ${n}: Setting accountType to 'normal'`),i.accountType="normal"),i}};var a6m=zi.merge(nfs),u6m=Os("User",a6m),fhd=Au(u6m,new Qwi),tAa=class extends Ra{constructor(t,n,i,o,s){super(t,n,fhd,i,o,s)}},Uwi=class extends Ma{constructor(t,n,i,o){super(t,fhd,n,i,o,tAa)}};var jwi=class extends IEe{constructor(t){super("root",t.db,["orgs","users","packagesRegistry","events"],void 0,t.currentLogContext(),t)}get path(){return""}get orgs(){return this.getSubCollection("orgs",Bwi)}org(t){return this.orgs.get(t)}get orgsPublic(){return this.getSubCollection("orgsPublic",kwi)}orgPublic(t){return this.orgsPublic.get(t)}get users(){return this.getSubCollection("users",Uwi)}user(t){return this.users.get(t)}get packagesRegistry(){return this.getSubCollection("packagesRegistry",qwi)}registryPackage(t){return this.packagesRegistry.get(t)}get events(){return this.getSubCollection("events",owi)}event(t){return this.events.get(t)}get oauthStates(){return this.getSubCollection("oauthState",swi)}oauthState(t){return this.oauthStates.get(t)}get activePrompts(){return this.getSubCollection("activePrompts",zwi)}activePrompt(t){return this.activePrompts.get(t)}get promptVersions(){return this.getSubCollection("promptVersions",Fwi)}promptVersion(t){return this.promptVersions.get(t)}batch(){return new $Mi(this.firestoreOperations)}getRepositoryFromPath(t){let n=t.split("/"),i,o;if(n.length){n[0].length||n.shift();for(let s of n)if(i)o=i.get(s),i=void 0;else{if(i=(o??this)[s],!i)return;o=void 0}}return i||o||this}storage(){return new XMi(this.firestoreOperations)}};var Gwi=(r,t,n)=>{let i=new ZMi,o=new jwi(r),s=new iwi({...t,eventManager:i},{});return BAd(o,{firebase:o,service:s},n,()=>new twi(o,s,()=>n("",{}).shouldMutateBoth))};var d6m=_t(Fgi());var hhd=()=>{let r=process.env.VITEST_HEARTBEAT_WORKER_PATH_OVERRIDE;if(r&&r!=="undefined")return r;let t="heartbeat-worker.js",n=s=>(0,nAa.join)(s,t),i=s=>(0,nAa.join)(s,"..","build-coa",t),o=n(__dirname);if((0,rAa.existsSync)(o))return o;for(let s of module.paths)for(let a of[n,i]){let u=a(s);if((0,rAa.existsSync)(u))return u}throw new et("Could not find a worker path")};var ghd=(0,Ahd.promisify)(setTimeout),iAa=r=>{if(!r)return;let t=parseInt(r);return isNaN(t)?void 0:t};var p6m=fB.getTracer(Ukt()??"unknown-context"),Hwi=class{logTag="[ManagedHeartbeatWorker]";logContext;task;worker;triggerExit;exitPromise;constructor(t,n,i,o){let{HEARTBEAT_CHECKIN_TIME:s,HEARTBEAT_MAX_LIFESPAN:a}=process.env,u=iAa(s)||5,l=iAa(a)||1/0;this.task={orgID:t,runID:n,runType:i,interval:u,lifespan:l,modality:o},this.logContext={...this.task};let{promise:c,resolve:d}=aT();this.exitPromise=c,this.triggerExit=d}start(){let{runType:t}=this.task,n=p6m.startSpan("run-heartbeat",{attributes:{runType:t}}),i=hhd();We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Starting worker, using path:",i),this.worker=new mhd.Worker(i,{env:process.env,workerData:this.task}),this.worker.on("online",()=>{We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Worker online")}),this.worker.on("exit",o=>{We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Worker exited with code",o),this.triggerExit(),n.end()}),this.worker.on("message",o=>{We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Worker message:",o)}),this.worker.on("error",o=>{We("HEARTBEAT").fatalContext(this.logContext,this.logTag,"Worker error:",o)})}async stop(){if(!this.worker)throw new et("Worker was never started!");We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Shutting down worker"),this.worker.postMessage("shutdown"),await Promise.race([this.exitPromise,ghd(1e3).then(()=>this.worker?.terminate())]),We("HEARTBEAT").infoContext(this.logContext,this.logTag,"Finished shutting down worker")}};var REe=(r,t,n="nonCLI")=>{let i=new Hwi(t.parent.id,t.id,r,n);return i.start(),()=>i.stop()};var yhd=(r,t,n,i)=>{if(t.kind==="none")throw new Aue(t.kind,"CreateActiveRunInfoFromDevRun");let o=ije(r.userCredentials,t),s={userID:n,userCredentials:o,runTimeParameters:r.runTimeParameters,runDetails:{...r.runDetails,jobID:pmt(r.runDetails.jobID)},runStatus:i?"waitingToRun":"initializing",runType:"devRun",kubernetesJobUuid:i,origin:r.origin};return B3(s),s};var nx=We("RUNNER_BACKEND");var oAa=r=>r.map(t=>t.toLowerCase()),qAC=new Set(["accesstoken","authcode","clientsecret","code","codeverifier","id_token","keypair","newpassword","password","refresh_token","snowflakekeypair","snowflakepassword","token","uid","serviceaccountkey",...oAa(wFe),...oAa(EWn),...oAa(LFe),"snowflakekeypairprivatekey","keypairkey"]);var sAa=(r,t,n,i)=>{let o=ije(r.userCredentials,t);return{runTimeParameters:r.runTimeParameters,runDetails:r.runDetails,userCredentials:o,runStatus:i?"waitingToRun":"initializing",userID:n,runType:"deploy",kubernetesJobUuid:i,origin:r.origin}},bhd=async(r,t,n,i,o,s)=>{let a=new cT(nx,o),{measure:u,printSummary:l}=P1("[BECLI_HandleDeploy] end-to-end execution",o),{teamInfo:{fbTeamID:c,fbUserID:d},rootRepository:p}=t,{runDetails:{environmentID:f,parallelism:A,phasedNodeEdits:g,planID:b}}=r,_=p.org(c),v=parseInt(f);nx.infoContext(o,"Initializing deploy! planId:",b);let O;try{let R=await u("create user context",()=>b6(p,c,d,v,n,o)),w=await u("prepare deploy configuration",()=>{let H=HNe(R,d);return r.runDetails.fromWorkspaceData.userConnections={[v]:{[d]:H}},nx.appContext(o,Yyt(R),"BECLI_HandleDeploy"),sAa(r,R,d,s)}),{connectionManager:P,platform:z}=await u("get backend platform",()=>{let H=Math.max(...Object.values(g).map(L=>Object.keys(L).length));return fae(R,t,lie(H,s?1:A),!0,o)}),j=(H,L,W)=>pei({allWorkspaceData:w.runDetails.fromWorkspaceData,connectionManager:P,logContext:L,platform:z,renderer:i,runID:H,runInfo:w,nodesInRun:hAe(g),teamInfoAndFirebase:t,workspaceID:v,memoryMonitor:new BB},W),U=await u("create run and setup pipeline",()=>lAa(!!s,w,_,P,j,o));O=U.runCounter;let G={...o,runID:O};return await u("save pre-deploy workspace",()=>f6m(p,t,O,v,d,G)),U}catch(R){throw nx.errorContext(o,`Error during deploy for plan ${b}:`,R,R instanceof Error?R.stack:void 0),R}finally{if(!s){let R=performance.now();a.logMetric("deploy-execution",{orgID:c,planID:b,runID:O,workspaceID:v});let w=performance.now()-R;nx.infoContext(o,`[BECLI_HandleDeploy] logMetric took ${(w/1e3).toFixed(3)} seconds`),l()}}},f6m=async(r,t,n,i,o,s)=>{try{let a=`run-${n}.predeploy`,u=`user/${o}/environment/${i}/workspacePreDeploy/${a}`,l=await r.org(t.teamInfo.fbTeamID).workspace(i).fetch();nx.appContext(s,"saving workspace data",l),await r.storage().uploadFile(u,l),nx.appContext(s,`Run ${n}: Saved pre-deploy workspace state to ${u}`)}catch(a){nx.errorContext(s,"Error while saving preDeploy workspace state: ",a)}},aAa=r=>{let{runDetails:t}=r;if(t.jobID&&(t.includeNodesSelector||t.excludeNodesSelector))throw new Error("Unable to process, don't provide a JobID and Node Include/Exclude Selector(s) for 1 Refresh Run")},uAa=(r,t,n,i)=>{let o=ije(r.userCredentials,t),s={runTimeParameters:r.runTimeParameters,runDetails:{...r.runDetails,jobID:pmt(r.runDetails.jobID)},userCredentials:o,runStatus:i?"waitingToRun":"initializing",userID:n,runType:"refresh",kubernetesJobUuid:i,origin:r.origin};return B3(s),s},HNe=(r,t)=>TB(r,{snowflake:n=>{let i={connectionDetails:{userID:t,user:n.user,role:n.role,warehouse:n.warehouse},connectionType:n.authenticator};return n.authenticator==="KeyPair"&&(i.connectionDetails.keyPair=n.keyPairKey),i},databricks:n=>({connectionKind:"databricks",connectionType:n.authenticator,connectionDetails:{userID:t,path:n.path}}),fabric:n=>({connectionKind:"fabric",connectionType:n.authenticator,connectionDetails:{userID:t,connectionString:n.connectionString}}),bigquery:n=>({connectionKind:"bigquery",connectionType:n.authenticator,connectionDetails:{userID:t,clientEmail:n.clientEmail??""}})}),Ehd=async(r,t,n,i,o,s)=>{let{rootRepository:a,teamInfo:{fbTeamID:u,fbUserID:l}}=t,{runDetails:{environmentID:c,jobID:d,parallelism:p}}=r,f=parseInt(c),A=a.org(u);aAa(r);let g=pmt(d);if(!g)nx.infoContext(o,"No job ID, refreshing all steps");else{nx.infoContext(o,"Refreshing job:",g);try{await A.workspace(f).job(g).fetch()}catch(j){throw nx.errorContext(o,`Failed to fetch job ${g}:`,j),j instanceof Ya?JPn(400,`Unable to start job ${g}`,`Job ${g} did not exist`):j}}let b=await b6(a,u,l,f,n,o),_=HNe(b,l);nx.appContext(o,Yyt(b),"BECLI_HandleRefresh"),r.runTimeParameters=await MEe(a,u,f,r.runTimeParameters);let v=uAa(r,b,l,s),O={steps:{},folders:{},jobs:{},macros:{},stepTypes:{}},R=new Set;s||(O=await g3e(f,A,new BB),O.userConnections[f][l]=_,R=tGe(v.runDetails,O)),v.runDetails.refreshDescription=KQe(v.runDetails,O.jobs);let{connectionManager:w,platform:P}=await fae(b,t,s?1:lie(R.size,p),!0,o);return lAa(!!s,v,A,w,(j,U,G)=>eGe({allWorkspaceData:O,connectionManager:w,logContext:U,platform:P,renderer:i,runID:j,runInfo:v,nodesInRun:R,teamInfoAndFirebase:t,workspaceID:f,memoryMonitor:new BB},G),o)};var A6m=async(r,t,n)=>{let o=(await r.org(t).workspace(n).fetch()).runTimeParameters??"";return LKn(o)},MEe=async(r,t,n,i)=>i?qKn(i):A6m(r,t,n),cAa=async(r,t,n,i,o,s)=>{let a=ije(t.userCredentials,i),u=await MEe(r,o.fbTeamID,parseInt(n.runDetails.environmentID),t.runTimeParameters);return n.runType==="refresh"&&(t.runDetails.forceIgnoreWorkspaceStatus!==void 0?n.runDetails.forceIgnoreWorkspaceStatus=t.runDetails.forceIgnoreWorkspaceStatus:n.runDetails.forceIgnoreWorkspaceStatus!==void 0&&delete n.runDetails.forceIgnoreWorkspaceStatus,n.runDetails.executor=t.runDetails.executor),{kubernetesJobUuid:s,origin:t.origin,reRunID:t.runDetails.runID,runDetails:n.runDetails,runStatus:s?"waitingToRun":"initializing",runTimeParameters:u,runType:"refresh",userCredentials:a,userID:o.fbUserID,version:3}},Chd=async(r,t,n,i,o,s,a)=>{let{runDetails:{environmentID:u,parallelism:l},runStatus:c,runType:d}=t,{runDetails:{runID:p}}=r;if(c!=="failed")throw new et(`Run status '${c}' is not eligible for re-run. Only failed jobs can be re-run!`);if(d!=="refresh")throw new et(`Run type '${d}' is not eligible for re-run`);if(!p)throw new et(`Invalid rerun ID '${p}'`);let{rootRepository:f,teamInfo:A,teamInfo:{fbTeamID:g,fbUserID:b}}=n,_=f.org(g),v=parseInt(u),O=await b6(f,g,b,v,i,s),R=HNe(O,b),w=await cAa(f,r,t,O,A,a),P=await g3e(v,_,new BB);w.runDetails.refreshDescription=KQe(w.runDetails,P.jobs),P.userConnections[v][b]=R;let z=await fei(_,w,P),{platform:j,connectionManager:U}=await fae(O,n,lie(z.size,a?1:l),!0,s);return lAa(!!a,w,_,U,(H,L,W)=>eGe({allWorkspaceData:P,connectionManager:U,logContext:L,platform:j,renderer:o,runID:H,runInfo:w,nodesInRun:z,teamInfoAndFirebase:n,workspaceID:v,memoryMonitor:new BB},W),s)},Shd=r=>_hd(r,"runCounter"),Hot=r=>_hd(r,"environment ID"),_hd=(r,t)=>{let n=typeof r=="number"?r:parseInt(r||"");if(!r||isNaN(n))throw new mo(`Specify a valid ${t}`,`400: ${n} is not valid`);return n},lAa=async(r,t,n,i,o,s)=>{if(r){try{nx.appContext(s,`tearing down connection manager for cloud ${t.runType} run`),await i.teardown()}catch(f){nx.errorContext(s,`error tearing down connection manager for cloud ${t.runType} run. Swallowing error.`,f)}let{runRepository:d,logContext:p}=await aCs(t,n,s);return{runCounter:d.id,logContext:p,runCompletion:Promise.resolve()}}let{runRepository:a,logContext:u}=await aCs(t,n,s),l=a.id,c=REe(t.runType,a,t.origin==="CLI"?"CLI":"nonCLI");return{runCounter:l,logContext:u,runCompletion:o(l,u,c)}};var h6m=new Map([["securetoken.googleapis.com",{path:"/securetoken",featureFlagName:"proxyGoogleAuth",enableByDefault:!1}],["identitytoolkit.googleapis.com",{path:"/identitytoolkit",featureFlagName:"proxyGoogleAuth",enableByDefault:!1}]]),vhd=r=>{let t=h6m.get(r.hostname);if(t&&fSe(t.enableByDefault,t.featureFlagName)){let n=new URL(OBe()),i=n.pathname;i.endsWith("/")&&(i=i.slice(0,-1)),r.pathname=i+t.path+r.pathname,r.hostname=n.hostname,r.protocol=n.protocol,r.port=n.port}return r};var Thd=async()=>{let r=fd.interceptors.request.use(t=>(typeof t.url=="string"&&(t.url=vhd(new URL(t.url)).toString()),t));return()=>fd.interceptors.request.eject(r)};var Ihd=_t(gUe());var Wot=We("FIREBASE"),g6m=3,Wwi=class extends jot{_backendUrl;_bucketPath;_forceBypassProxy;_baseStorageUrl;_axiosClient;constructor(t){super(t.storage),this._bucketPath=`v0/b/${t.bucket}/o`,this._backendUrl=t?.backendUrl??mm(),this._forceBypassProxy=!!t?.forceBypassProxy,this._axiosClient=t?.axiosClient,this._baseStorageUrl=t.emulatorStorageHost?`http://${t.emulatorStorageHost}`:"https://firebasestorage.googleapis.com"}async uploadToStorage(t,n){if(!this.isProxyEnabled)return super.uploadToStorage(t,n);Wot.info(`Uploading file to '${t}' via proxy`);let i=(0,Ihd.gzip)(new TextEncoder().encode(JSON.stringify(n))),o=await this.axios();try{let s=await o.post(this.determineProxyUrl(this._bucketPath,{name:t}),{contentEncoding:"gzip",contentType:"application/json",name:t},{headers:{Authorization:`Firebase ${await this.token()}`,"X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${i.length}`,"X-Goog-Upload-Header-Content-Type":"application/json","X-Goog-Upload-Protocol":"resumable"}}),a=s.headers["x-goog-upload-url"];ed(a,"Missing upload URL in firebase cloud storage upload response","FIREBASE"),a=await this.determineProxyUrl(a);let u=+s.headers["x-goog-upload-chunk-granularity"]||262144,c=i.length,d=0;for(;c>u;){let p=Math.min(c,u),f=d+p,A=i.slice(d,f);await this.uploadChunk(a,A,d,!1),c-=p,d+=p}await this.uploadChunk(a,i.slice(d),d,!0)}catch(s){throw this.handleAxiosError(s)}}async downloadFromStorage(t){if(!this.isProxyEnabled)return super.downloadFromStorage(t);Wot.info(`Downloading file from '${t}' via proxy`);let n=await this.axios();try{return(await n.get(this.determineProxyUrl(`${this._bucketPath}/${encodeURIComponent(t)}`,{alt:"media"}),{headers:{Authorization:`Firebase ${await this.token()}`}})).data}catch(i){throw this.handleAxiosError(i)}}async deleteFileFromStorage(t){if(!this.isProxyEnabled)return super.deleteFileFromStorage(t);Wot.info(`Deleting file at '${t}' via proxy`);let n=await this.axios();try{await n.delete(this.determineProxyUrl(`${this._bucketPath}/${encodeURIComponent(t)}`,{alt:"media"}),{headers:{Authorization:`Firebase ${await this.token()}`}})}catch(i){throw this.handleAxiosError(i)}}async checkIfStorageReferenceExists(t){if(!this.isProxyEnabled)return super.checkIfStorageReferenceExists(t);Wot.info(`Checking if file at '${t}' exists via proxy`);let n=await this.axios();try{return await n.get(this.determineProxyUrl(`${this._bucketPath}/${encodeURIComponent(t)}`),{headers:{Authorization:`Firebase ${await this.token()}`}}),!0}catch(i){if(Ag(i)&&i.status===404)return!1;throw this.handleAxiosError(i)}}determineProxyUrl(t,n){t=t.replace(/^https:\/\/firebasestorage\.googleapis\.com\//,"");let i="?";if(n)for(let o in n){let s=n[o];s!==void 0&&(t+=`${i}${o}=${encodeURIComponent(s)}`,i="&")}return`${this.proxyUrl}?gcsforward=${encodeURIComponent(t)}`}get isProxyEnabled(){let t=!1;return typeof window<"u"&&(t=window.location.hostname==="localhost"||/(^|\.)local\./.test(window.location.hostname)),!t&&!this._forceBypassProxy&&this._baseStorageUrl==="https://firebasestorage.googleapis.com"&&vu().featureFlags.isFeatureEnabled("proxyGoogleStorage")}async uploadChunk(t,n,i,o){await IA(async()=>{Wot.info(`Uploading ${n.length} bytes at offset ${i} to '${t}'`),await(await this.axios()).post(t,n,{headers:{Authorization:`Firebase ${await this.token()}`,"X-Goog-Upload-Command":`upload${o?", finalize":""}`,"X-Goog-Upload-Offset":`${i}`}})},g6m,Wot,{})}get proxyUrl(){return`${this._backendUrl}/gcs`}async token(){return Mf.instance.getFirebaseIDToken()}async axios(){return this._axiosClient||(this._axiosClient=fd),this._axiosClient}handleAxiosError(t){if(Ag(t)){let i=t.response?.data?.message??t.message;switch(t.status){case 403:return new m3(i);case 404:return new Ya(i);default:return new et(i)}}return t}};var dAa=new Map,m6m=r=>process.env.COALESCE_FORCE_FIREBASE_REPOSITORY==="true"?"firebase":vu().featureFlags.getStringValue("serviceBackedRepositories","").split(",").includes(r)?"service":"firebase",y6m=()=>vu().featureFlags.isFeatureEnabled("mutateAllRepositories",!0),b6m=r=>({providerId:m6m(r),shouldMutateBoth:y6m()}),Ohd=({app:r,storage:t,hostname:n="localhost",token:i})=>{r||(r=X0.app());let o=dAa.get(r.name);if(!o){let s;try{s=$ut()}catch(a){throw a instanceof Nee?(We("CLI_INTERNAL").error("Deploy Service configuration error",a.diagnostics),new et("Unable to connect to Coalesce services. Please check your configuration and ensure you are properly authenticated.")):a}o=Gwi(new bxt(r,t),{getToken:async()=>typeof i=="string"?i:i(),hostnames:{schedulerService:mm(),deployService:s,metadataService:jkt(n)}},b6m),dAa.set(r.name,o)}return o},Rhd=()=>{dAa.clear()};var Mxt=We("RUNNER_BACKEND"),E6m=async r=>{try{return await Zjs(r),X0.app()}catch(t){throw Mxt.error("GetOrSetupFirebase",t),t}},C6m=async(r,t,n)=>{let i;return J6()||(i=new Wwi({storage:X0.storage(),backendUrl:t.emulatorInfo?.storage,bucket:t.storageBucket})),Ohd({app:r,storage:i,hostname:n.origin,token:Mf.instance.getFirebaseIDToken})},S6m=async(r,t,n)=>{let i,o=new lxt(Tc(),n.apiKey,!!n.emulatorInfo,t,void 0,b9e());await o.initialize(),Mf.setInstance(o),MMi(r)?i=await o.loginWithIdToken(r):i=await o.loginWithRefreshToken(r);let s=await X0.firestore().collection("users").doc(i.id).get();if(!s.exists)throw N0a("Authorization failed: User not found in firebase",{userId:i.id},{warning:(l,c)=>Mxt.warn(l,c)});let{currentTeam:a,hasSuperUserAccess:u}=s.data();if(!a)throw N0a("Authorization failed: Firestore user is missing 'currentTeam'",{userID:i.id},{warning:(l,c)=>Mxt.warn(l,c)});return{token:await o.getAuthToken(),context:{userID:i.id,orgID:a,hasSuperUserAccess:!!u}}},_6m=async(r,t,n,i)=>{let o=S9e().instance;return r&&(t.subdomain={id:r}),DP&&(t.version={id:DP.version}),o.isInitialized||await o.initialize({context:t,rootRepository:()=>n,apiClient:X3(void 0,i,{timeout:b9e()})}),o.currentFlags},Vwi=async(r,t)=>{let n=X3(t.origin,void 0,{timeout:b9e()}),i=await IA(async()=>await n.GetDatabase(),4,Mxt,{},{alterRetryStrategy:()=>({name:"backoff",base:1}),logOnRetry:"Retrying to get Firebase configuration",logOnFailure:"Failed to get Firebase configuration",failureLogLevel:"error"}),o=S9e().instance,s=oxa(t.hostname);return process.env.SCHEDULER_ADDRESS=t.origin,o.isInitialized||await IA(async()=>{await o.initializeDefaultFlags(s)},4,Mxt,{},{logOnFailure:"Failed to initialize feature flags service",failureLogLevel:"error",logOnRetry:"Retrying to initialize feature flags service",alterRetryStrategy:()=>({name:"backoff",base:1})}),TFe({logContext:vu().logContext,featureFlags:o.currentFlags},async()=>(await Thd(),pCl(()=>E6m(i),a=>S6m(r,a,i),(a,u)=>C6m(a,i,t),(a,u,l)=>_6m(s,a,u,l))))};var v6m=async(r,t,n,i,o)=>{Wa.infoContext(o,`Starting deploy job coa-${r}`);let s=oZu.assert(n,{logContext:o,logArea:"CLI",errorMessage:"failed to validate request body"}),a=new UFe(s),{runDetails:u,userCredentials:l}=a,{environmentID:c,parallelism:d,phasedNodeEdits:p,planID:f}=u,A=Hot(c),g=Oce(i,`Unable to parse runID: ${i}`),b={...o,planID:f,runID:g,workspaceID:A},{teamInfo:{fbTeamID:_,fbUserID:v},rootRepository:O}=t,R=O.org(_),w=new cT(Wa,b),{measure:P,printSummary:z}=P1("[CloudDeploy] end-to-end execution",b),j;try{let U=await P("get user connection and adjust credentials",async()=>{let Y=await Rne(R.workspace(A).workspaceUser(v),b),J=vu().featureFlags;return await SNe(_,v,A,l,Y,J),J}),G=await P("create user context",()=>b6(O,_,v,A,DNe(l),b)),{runInfo:H,maxGraphSize:L,memoryMonitor:W}=await P("prepare deploy configuration",async()=>{let Y=sAa(a,G,v,r);Y.id=g;let J=R.run(g);await J.updateHeartbeat({runStatus:"initializing"}),j=REe(Y.runType,J);let re=new wU,ne=Math.max(...Object.values(p).map(X=>Object.keys(X).length));return{runInfo:Y,maxGraphSize:ne,memoryMonitor:re}}),{connectionManager:V,platform:q}=await P("get backend platform",()=>fae(G,t,lie(L,d),!1,b));return await P("run deploy pipeline",()=>pei({allWorkspaceData:H.runDetails.fromWorkspaceData,connectionManager:V,logContext:b,platform:q,renderer:ex(U),runID:g,runInfo:H,nodesInRun:hAe(p),teamInfoAndFirebase:t,workspaceID:A,memoryMonitor:W},j))}catch(U){if(j)try{await j()}catch(G){Wa.errorContext(b,"Unable to clean up heartbeat after handling error",U,"innerError",G)}throw U}finally{w.logMetric("deploy-execution",{orgID:_,workspaceID:A,planID:f,runID:g,kubernetesJobUuid:r}),z()}},T6m=async(r,t,n,i,o)=>{Wa.infoContext(o,`Starting refresh job coa-${r}`);let a=uZu.assert(n,{logContext:o,logArea:"CLI",errorMessage:"failed to validate request body"}),u=Hot(a.runDetails.environmentID),l=Oce(i,`Unable to parse runID: ${i}`),c={...o,runID:l,workspaceID:u},{teamInfo:{fbTeamID:d,fbUserID:p},rootRepository:f}=t,A=f.org(d),g=await Rne(A.workspace(u).workspaceUser(p),c),b=vu().featureFlags;await SNe(d,p,u,a.userCredentials,g,b);let _=await b6(f,d,p,u,DNe(a.userCredentials),c);a.runTimeParameters=await MEe(f,d,u,a.runTimeParameters),aAa(a);let v=uAa(a,_,p,r);v.id=l;let O=A.run(l);await O.updateHeartbeat({runStatus:"initializing"});let R=REe(v.runType,O),w=new wU;try{let P=await g3e(u,A,w),z=tGe(v.runDetails,P);v.runDetails.refreshDescription=KQe(v.runDetails,P.jobs),await O.merge({runDetails:v.runDetails});let j=HNe(_,p);P.userConnections[u][p]=j;let{connectionManager:U,platform:G}=await fae(_,t,lie(z.size,a.runDetails.parallelism),!1,c);return eGe({allWorkspaceData:P,connectionManager:U,logContext:c,platform:G,renderer:ex(b),runID:l,runInfo:v,nodesInRun:z,teamInfoAndFirebase:t,workspaceID:u,memoryMonitor:w},R)}catch(P){try{await R()}catch(z){Wa.error("Unable to clean up hearbeat after handling error",P,"innerError",z)}throw P}},I6m=async(r,t,n,i,o)=>{let s="[CloudReRun]";Wa.infoContext(o,`Starting re-run job coa-${r}`);let a=lZu.assert(n,{logContext:o,logArea:"CLI",errorMessage:"failed to validate request body"}),u=new jFe(a);B3(u);let{teamInfo:l,teamInfo:{fbTeamID:c,fbUserID:d},rootRepository:p}=t,f=p.org(c),A=Shd(u.runDetails.runID),g=await f.run(A).fetch();if(!g)throw new Error(`Could not find runInfo for teamID=${c}, oldRunID=${A}`);if(!ggc(g))throw new Error("Run is not eligible for rerun or a dev run");let b=Hot(g.runDetails.environmentID),_=Oce(i,`Unable to parse runID: ${i}`),v={...o,runID:_,workspaceID:b},O=await Rne(f.workspace(b).workspaceUser(d),v),R=vu().featureFlags;await SNe(c,d,b,u.userCredentials,O,R);let w=await b6(p,c,d,b,DNe(u.userCredentials),v),P=await cAa(p,u,g,w,l,r);if(P.id=_,!mgc(P)){let H=`Invalid rerun ID ${P.reRunID}`;throw Wa.errorContext(v,s,H),new mo(H)}let z=Hot(P.runDetails.environmentID);Dp("RUNNER_BACKEND",z===b,v,"Unexpected mismatch between workspace IDs for re-run and original run; workspace for re-run:",z,"workspace for original run:",b);let j=f.run(_);await j.updateHeartbeat({runStatus:"initializing"});let U=REe(P.runType,j),G=new wU;try{let H=await g3e(z,f,G),L=KQe(P.runDetails,H.jobs);await j.merge({runDetails:{...P.runDetails,refreshDescription:L}});let W=await fei(f,P,H),V=HNe(w,d);H.userConnections[z][d]=V;let{connectionManager:q,platform:Y}=await fae(w,t,lie(W.size,P.runDetails.parallelism),!1,v);return eGe({allWorkspaceData:H,connectionManager:q,logContext:v,platform:Y,renderer:ex(R),runID:_,runInfo:P,nodesInRun:W,teamInfoAndFirebase:t,workspaceID:z,memoryMonitor:G},U)}catch(H){try{await U()}catch(L){Wa.error("Unable to clean up hearbeat after handling error",H,"innerError",L)}throw H}},O6m=async(r,t,n,i,o)=>{let s="CloudDevRun:";Wa.infoContext(o,s,`Starting dev run job coa-${r}`);let a=sZu.assert(n,{logContext:o,logArea:"CLI",errorMessage:"failed to validate request body"}),u=Hot(a.runDetails.environmentID),l=Oce(i,`Unable to parse runID: ${i}`),c={...o,runID:l,workspaceID:u},{rootRepository:d,teamInfo:{fbTeamID:p,fbUserID:f}}=t,A=d.org(p),g=await Rne(A.workspace(u).workspaceUser(f),c),b=vu().featureFlags;await SNe(p,f,u,a.userCredentials,g,b);let _=await b6(d,p,f,u,DNe(a.userCredentials),c),v=A.devRun(l);await v.updateHeartbeat({runStatus:"initializing"});let O={...yhd(a,_,f,r),id:l},R=REe(O.runType,v),w=new wU;try{let P=await g3e(u,A,w);P.userConnections[u][f]=HNe(_,f);let z=tGe(O.runDetails,P),{connectionManager:j,platform:U}=await fae(_,t,lie(z.size,a.runDetails.parallelism),!1,c);return j3c({allWorkspaceData:P,connectionManager:j,logContext:c,platform:U,renderer:ex(b),runID:l,runInfo:O,nodesInRun:z,teamInfoAndFirebase:t,workspaceID:u,memoryMonitor:w},R)}catch(P){try{await R()}catch(z){Wa.errorContext(c,s,"unable to clean up heartbeat with error",z,"following run error",P)}throw P}},R6m=async(r,t,n,i,o)=>{let s="[CloudPlan]",{rootRepository:a,teamInfo:{fbTeamID:u,fbUserID:l}}=t,c=vu().featureFlags,{currentWorkspaceData:d,desiredWorkspaceData:p,disablePresync:f,parameters:A,skippedBeforeCollection:g,userCredentials:b,useRenderCache:_,workspaceID:v}=n,O={...o,planID:i,workspaceID:v},{measure:R,printSummary:w}=P1(s,O);try{let P=await R("get platform and test connection",()=>cfd(l,u,v,a,b,c,O)),z={currentWorkspaceData:{...d,platformKind:P.name},desiredWorkspaceData:{...p,platformKind:P.name},skippedBeforeCollection:g};Wa.infoContext(O,s,`Starting plan job coa-${r}`),await lfd({disablePresync:f,skipPlanContextUpload:c.isFeatureEnabled("skipPlanContextUpload"),useRenderCache:_},ex(c),i,v,l,P,A,z,a,O)}finally{w()}},Mhd=async r=>{let t="[CloudEntry]";Wa.debug("Cloud entrypoint."),g$u(()=>{try{return Wa.getCommonLogger()}catch(b){Wa.error("Failed to get common logger for starting OpenTelemetry SDK",{error:b});return}});let n=process.env.SCHEDULER_ADDRESS;if(!n){let b="No SCHEDULER_ADDRESS defined for cloud entrypoint";throw Wa.emerg(b),new et(b)}let i=process.env.COALESCE_COA_CLOUD_TOKEN;if(!i){let b="No COALESCE_COA_CLOUD_TOKEN defined for cloud entrypoint";throw Wa.emerg(b),new et(b)}let o=await Vwi(i,new URL(n)),{rootRepository:s,teamInfo:{fbTeamID:a,fbUserID:u},featureFlags:l}=o,c={kubernetesJobUuid:r,orgID:a,userID:u};Wa.infoContext(c,t,"authenticated user");let d,{action:p,id:f,cloudRunAction:A}=M6m(c);p==="plan"?c.planID=f:c.runID=Oce(f,`Unable to parse runID: ${f}`);let g=c;try{await V3c(s,a)&&(j9i(),Wa.debugContext(g,t,"super Debug enabled"));let b=process.env.COALESCE_COA_CLOUD_REQUEST_PATH;if(!b){let v="COALESCE_COA_CLOUD_REQUEST_PATH not set!";throw Wa.emergContext(g,t,v),new et(v)}let _=await w6m(b,s,g);d=TFe({userID:u,orgID:a,logContext:g,featureFlags:l},()=>(Wa.infoContext(g,t,`${p} job ${f} started, waiting for completion`),A(r,o,_,f,g))),await d,Wa.infoContext(g,t,"job completed without exception")}catch(b){return Wa.errorContext(g,t,"error starting coa run",b),p==="plan"?Wa.infoContext(g,t,"plan job failed, no run or workspace related state to clean up"):d?(Wa.infoContext(g,t,"run was initialized, cleaning up run and workspace"),await UYn(f,p,s.org(a),b,g),Wa.infoContext(g,t,"run and workspace cleaned up")):Wa.infoContext(g,t,"run was not initialized, no run related state to clean up"),await dB(1)}await dB(0)},M6m=r=>{let t="[getCloudRunAction]",n=process.env.COALESCE_COA_CLOUD_ACTION,i=()=>{let o=process.env.COALESCE_COA_CLOUD_RUN_COUNTER;if(!o)throw new et("COALESCE_COA_CLOUD_RUN_COUNTER not set!");return o};switch(n){case"deploy":return{id:i(),action:n,cloudRunAction:v6m};case"refresh":return{id:i(),action:n,cloudRunAction:T6m};case"rerun":return{id:i(),action:n,cloudRunAction:I6m};case"devRun":return{id:i(),action:n,cloudRunAction:O6m};case"plan":{let o=process.env.COALESCE_COA_CLOUD_PLAN_ID;if(!o){let s=`Plan ID was not set! planID: ${o}`;throw Wa.emergContext(r,t,s),new et(s)}return{id:o,action:n,cloudRunAction:R6m}}default:{let o=n;throw Wa.emergContext(r,t,`received unexpected COALESCE_COA_CLOUD_ACTION value ${o}`),new et(`Error: COALESCE_COA_CLOUD_ACTION is invalid! value=${o}`)}}},w6m=async(r,t,n)=>{let i="[downloadAndCleanupFile]";Wa.infoContext(n,i,"downloading request data from",r);let o=await t.storage().downloadFile(r),s=Rj(o);Wa.infoContext(n,i,"finished parsing request data as JSON completed; deleting stored request",s);try{await t.storage().deleteFile(r),Wa.infoContext(n,i,"finished deleting stored request; dispatching cloud run")}catch(a){Wa.assertContext(n,i,`error deleting stored request at ${r}...continuing`,a)}return o};var Ghd=_t(jhd(),1),{program:lgC,createCommand:dgC,createArgument:pgC,createOption:fgC,CommanderError:AgC,InvalidArgumentError:TAa,InvalidOptionArgumentError:hgC,Command:Hhd,Argument:ggC,Option:ix,Help:mgC}=Ghd.default;var rat=_t(require("fs")),fCd=_t(Yhd());var Jhd={openapi:"3.1.0",info:{version:"1.0.0",title:"Coalesce API",description:"REST API for performing operations with the Coalesce backend."},servers:[{url:"https://app.coalescesoftware.io",description:"US primary"},{url:"https://app.eu.coalescesoftware.io",description:"Europe primary"},{url:"https://app.australia-southeast1.gcp.coalescesoftware.io",description:"Australia primary"},{url:"https://app.us-east-1.aws.coalescesoftware.io",description:"US AWS US East"},{url:"https://app.us-east-1.aws.privatelink.coalescesoftware.io",description:"US AWS US East with PrivateLink"},{url:"https://app.us-west-2.aws.coalescesoftware.io",description:"US AWS US West"},{url:"https://app.us-west-2.aws.privatelink.coalescesoftware.io",description:"US AWS US West with PrivateLink"},{url:"https://app.northamerica-northeast1.gcp.coalescesoftware.io",description:"Canada Primary"},{url:"https://app.westus2.azure.coalescesoftware.io",description:"US Azure West 2"},{url:"https://app.eastus2.azure.coalescesoftware.io",description:"US Azure East 2"}],security:[{BearerAuth:[]}],"x-coa-private-pointers":["/paths/~1api~1v2~1render","/paths/~1api~1v2~1render~1health","/components/schemas/PackageDefinition","/components/schemas/RenderRequestV2"],components:{schemas:{PlatformKind:{type:"string",enum:["snowflake","fabric","databricks","bigquery"]},DatabaseInfo:{type:"object",required:["apiKey","authDomain","projectId","storageBucket","messagingSenderId","appId","measurementId"],properties:{apiKey:{type:"string"},authDomain:{type:"string"},projectId:{type:"string"},storageBucket:{type:"string"},messagingSenderId:{type:"string"},appId:{type:"string"},measurementId:{type:"string"},emulatorInfo:{type:"object",required:["auth","firestore","storage"],properties:{auth:{type:"string"},firestore:{type:"string"},storage:{type:"string"}}}}},EnvironmentsResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of environment information.",anyOf:[{type:"array",items:{$ref:"#/components/schemas/Environment"}},{type:"array",items:{$ref:"#/components/schemas/EnvironmentSummary"}}]},total:{type:"integer",description:"The size of the result set."},startingFrom:{type:"string",description:"The cursor value used in the request."},limit:{type:"integer",description:"The requested page size."},next:{type:["number","null"],description:"The field value representing the start of the next page of results."}}},FeatureFlagsClientConfig:{type:"object",description:"Information a client needs to connect to the feature flag service.",required:["launchDarklyClientID"],properties:{launchDarklyClientID:{type:"string"}}},FeatureFlagsValues:{type:"object",description:"Feature flag values.",properties:{featureFlags:{additionalProperties:{oneOf:[{type:"boolean"},{type:"string"},{type:"number"},{type:"object"},{type:"array"}]}}},required:["featureFlags"]},ProjectsResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of project information.",type:"array",items:{$ref:"#/components/schemas/Project"}}}},ProjectResponse:{type:"object",required:["data"],properties:{data:{description:"Information about a project.",$ref:"#/components/schemas/Project"}}},ProjectGitAccountResponse:{$ref:"#/components/schemas/ProjectGitAccountResponseData"},ProjectGitAccountsResponse:{type:"object",required:["data"],properties:{data:{description:"A colleciton of project git accounts",type:"array",items:{$ref:"#/components/schemas/ProjectGitAccountResponseData"}}}},TypesenseConfigResponse:{description:"Summary of configuration data for Typesense in a given org.","x-coa-private":!0,type:"object",required:["typesenseKey","typesenseHosts"],properties:{typesenseKey:{description:"The Typesense access key scoped to a users org.",type:"string"},typesenseHosts:{description:"The Typesense host address(es) for our cluster(s).",type:"array",items:{type:"string"}}}},EnvironmentSummary:{type:"object",description:"Summary information about an environment.",additionalProperties:!1,properties:{createdAt:{type:"string",format:"date-time"},createdBy:{$ref:"#/components/schemas/UserSummary"},id:{type:"string",description:"The Environment ID."},name:{type:"string",description:"Name of the Environment."},project:{type:"string",description:"The Project ID."},status:{$ref:"#/components/schemas/EnvironmentHealth",description:"Status of the Environment."}},required:["createdAt","id","name","project","status"]},ErrorResponse:{description:"Error detail in addition to the HTTP status code and text.",type:"object",required:["error"],properties:{error:{$ref:"#/components/schemas/Error"}}},NodesResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of nodes for an environment.",anyOf:[{type:"array",items:{$ref:"#/components/schemas/NodeSummary"}},{type:"array",items:{$ref:"#/components/schemas/Node"}}]},total:{type:"integer",description:"The size of the result set."},startingFrom:{type:"string",description:"The cursor value used in the request."},limit:{type:"integer",description:"The requested page size."},next:{type:["string","null"],description:"The field value representing the start of the next page of results."}}},NodeSummary:{type:"object",properties:{database:{type:"string",description:"The Snowflake database name."},id:{type:"string",description:"The Coalesce Node ID."},locationName:{type:"string",description:"The Storage Mapping location."},name:{type:"string",description:"The Node name."},nodeType:{$ref:"#/components/schemas/NodeType"},schema:{type:"string",description:"The database schema name."}},required:["database","id","locationName","name","nodeType","schema"]},OrderByDirection:{description:"The sort order for query results.",type:"string",enum:["asc","desc"]},PackageCreateEntity:{description:"A single package entity to be created.","x-coa-private":!0,type:"object",properties:{macros:{type:"string"},dependencies:{type:"object",additionalProperties:{$ref:"#/components/schemas/PackageDependency"}},nodeTypes:{type:"object",additionalProperties:{$ref:"#/components/schemas/PackageNodeType"}}},required:["macros","dependencies","nodeTypes"]},PackageDependency:{description:"A package dependency.","x-coa-private":!0,type:"object",required:["version","macros","dependencies","releaseID","alias","packageID"],properties:{packageID:{type:"string",minLength:1},alias:{type:"string"},version:{type:"string"},releaseID:{type:"string",minLength:1},macros:{type:"string"},dependencies:{type:"object",additionalProperties:{$ref:"#/components/schemas/PackageDependency"}}},examples:[{name:"foo",version:"1.2.3",macros:"{% macro bar() %}hello,{% endmacro %}",nodeTypes:{},dependencies:{dep:{name:"baz",version:"1.1.1",macros:"{% macro bar() %}world!{% endmacro %}",dependencies:{}}}}]},PackageEntityTagV1:{description:"Identifies the package from which the entity came. (Deprecated, see PackageEntityTagV2).","x-coa-private":!0,type:"object",required:["id","version"],properties:{id:{type:"string"},version:{type:"string"}}},PackageEntityTagV2:{description:"Identifies the package from which the entity came.","x-coa-private":!0,type:"object",required:["id","releaseID"],properties:{id:{type:"string"},releaseID:{type:"string"}}},PackageMacro:{description:"A macro in a package.","x-coa-private":!0,type:"string"},PackageNodeType:{description:"A node type in a collection of nodeTypes to be packaged.","x-coa-private":!0,type:"object",required:["name","version","isDisabled","metadata","id"],properties:{name:{type:"string"},version:{type:"number"},id:{type:"string"},isDisabled:{type:"boolean"},metadata:{type:"object"}}},PackageCreateReleaseInfo:{description:"Package release information for a create operation.","x-coa-private":!0,type:"object",properties:{changeLog:{type:"string"},version:{type:"string"},certified:{type:"boolean"}},required:["changeLog","version"]},PackageCreateEntities:{description:"Entities that are part of a package release.","x-coa-private":!0,required:["dependencies","nodeTypes","macros"],properties:{dependencies:{type:"object",additionalProperties:{$ref:"#/components/schemas/PackageDependency"}},nodeTypes:{type:"object",additionalProperties:{$ref:"#/components/schemas/PackageNodeType"}},macros:{type:"string"}}},RunsOrderBy:{description:"The field used to sort query results. Defaults to `id`, but must be explicitly provided when also using `startingFrom`. Make sure to match data type.",type:"string",enum:["id","runStartTime","runEndTime"]},RunsResponse:{description:"A collection of runs.",type:"object",required:["limit","next","orderBy","orderByDirection","data"],properties:{limit:{description:"The maximum number of runs returned by this query.",type:"integer"},next:{description:"The field value representing the start of the next page of results.",type:["number","string","null"]},orderByDirection:{$ref:"#/components/schemas/OrderByDirection"},orderBy:{$ref:"#/components/schemas/RunsOrderBy"},data:{description:"A collection of runs.",anyOf:[{type:"array",items:{$ref:"#/components/schemas/RunSummary"}},{type:"array",items:{$ref:"#/components/schemas/RunInfo"}}]}}},RunResultsResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of run results.",type:"array",items:{$ref:"#/components/schemas/RunResult"}}}},StoredRunResultsResponse:{type:"object",required:["data"],properties:{data:{description:"Raw run results from external storage.",type:"array",items:{$ref:"#/components/schemas/StoredRunResult"}}}},RunSummary:{type:"object",properties:{id:{description:"The run ID.",type:"integer"},reRunID:{description:"If this is a re-run, the ID of the original operation.",type:"string"},runStartTime:{description:"The datetime the run started.",type:"string",format:"date-time"},runEndTime:{description:"The datetime the run ended.",type:"string",format:"date-time"},runType:{$ref:"#/components/schemas/RunType"},runStatus:{$ref:"#/components/schemas/RunStatus"},environmentID:{description:"The environment in which the run operation was applied.",type:"string"},runFailureReason:{description:"Information about the cause of a run failure.",type:"string"}},required:["id","runType","runStatus"]},UserEnvironmentRolesResponse:{type:"array",items:{$ref:"#/components/schemas/UserEnvironmentRoles"},additionalProperties:!1},UserProjectRolesResponse:{type:"array",items:{$ref:"#/components/schemas/UserProjectRoles"},additionalProperties:!1},UserRolesResponse:{type:"array",items:{$ref:"#/components/schemas/UserOrgRoles"},additionalProperties:!1},SingleUserRoleResponseV2:{$ref:"#/components/schemas/UserOrgRolesV2"},UserRoleResponseV2:{type:"object",properties:{userRoles:{type:"array",items:{$ref:"#/components/schemas/UserOrgRolesV2"}}},required:["userRoles"],additionalProperties:!1},FivetranProjectsResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of project information.",type:"array",items:{$ref:"#/components/schemas/FivetranProject"}}}},FivetranProjectResponse:{type:"object",required:["data"],properties:{data:{description:"Fivetran project data.",$ref:"#/components/schemas/FivetranProject"}}},FivetranJobsResponse:{type:"object",required:["data"],properties:{data:{description:"A collection of job information.",type:"array",items:{$ref:"#/components/schemas/FivetranJob"}}}},FivetranJobHistoryResponse:{type:"object",required:["data"],properties:{data:{description:"Fivetran job history data.",$ref:"#/components/schemas/FivetranJobHistory"}}},FivetranRefreshJobResponse:{type:"object",required:["data"],properties:{data:{description:"A fivetran job",$ref:"#/components/schemas/FivetranJobHistory"}}},MetricsItem:{type:"object",required:["name","tags","count"],properties:{name:{type:"string"},tags:{type:"array",items:{type:"string"}},count:{type:"integer"}}},MetricsRequest:{type:"object",required:["metrics"],properties:{metrics:{type:"array",items:{$ref:"#/components/schemas/MetricsItem"}}}},BaseEnvironment:{type:"object",description:"Environments are used for deploying your data pipelines to production, test, QA, and other environments.",additionalProperties:!0,properties:{connectionAccount:{type:"string",description:"The account name for the environment connection."},defaultStorageMapping:{type:"string",nullable:!0},description:{type:"string",description:"The Environment description."},name:{type:"string",description:"The Environment name."},oauthEnabled:{type:"boolean",description:"If OAuth is enabled."},runTimeParameters:{type:"object",additionalProperties:!0,description:"The default Environment parameters. Parameters changed during deploy will not show here."},tagColors:{$ref:"#/components/schemas/TagColor"},project:{type:"string"}},required:["name","oauthEnabled","project"]},Environment:{description:"Environments are used for deploying your data pipelines to production, test, QA, and other environments.",allOf:[{$ref:"#/components/schemas/BaseWorkspaceEnv"},{type:"object",additionalProperties:!0,properties:{runTimeParameters:{type:"object",additionalProperties:!0,description:"The default Environment parameters. Parameters changed during deploy will not show here."},currentMappings:{$ref:"#/components/schemas/EnvironmentStorageLocationMappings"}},required:["createdAt","id","status"]}]},EnvironmentCreateRequest:{"x-coa-private":!0,type:"object",description:"Initial values to set on a newly created environment.",allOf:[{$ref:"#/components/schemas/BaseEnvironment"},{type:"object",properties:{mappings:{$ref:"#/components/schemas/EnvironmentStorageLocationMappings"}},additionalProperties:!0}]},EnvironmentHealth:{type:"string",enum:["Deleting","Deploying","Failed Deploy","Failed Dev Run","Failed Refresh","Initializing","Refreshing","Running Dev Run","Waiting"]},EnvironmentStorageLocationMappings:{type:"object",description:"The Storage Mapping name.",additionalProperties:{type:"object",properties:{database:{type:"string",description:"The database name."},schema:{type:"string",description:"The database schema."}}}},BaseProject:{type:"object",description:"A project groups environments and workspaces for easier management and access control.",properties:{platformKind:{$ref:"#/components/schemas/Common.schema1"},description:{type:"string"},gitRepoURL:{type:"string"},name:{type:"string"},autoPreviewEnabled:{type:"boolean",description:"Controls whether sample data is automatically fetched after running a node. When undefined, defaults based on platformKind."}},required:["name"]},Project:{description:"A project groups environments and workspaces for easier management and access control.",allOf:[{$ref:"#/components/schemas/BaseProject"},{type:"object",additionalProperties:!0,properties:{createdAt:{type:"string",format:"date-time"},createdBy:{$ref:"#/components/schemas/UserSummary"},updatedAt:{type:"string",format:"date-time"},updatedBy:{$ref:"#/components/schemas/UserSummary"},id:{type:"string"},status:{$ref:"#/components/schemas/ProjectStatus"},workspaces:{type:"array",items:{$ref:"#/components/schemas/WorkspaceSummary"}}},required:["createdAt","updatedAt","id","status","name"]}]},ProjectCreateRequest:{type:"object",description:"A project groups environments and workspaces for easier management and access control.",properties:{platformKind:{$ref:"#/components/schemas/Common.schema1"},description:{type:"string"},gitRepoURL:{type:"string"},name:{type:"string"},autoPreviewEnabled:{type:"boolean",description:"Controls whether sample data is automatically fetched after running a node. When undefined, defaults based on platformKind."}},additionalProperties:!1,required:["name","platformKind"]},ProjectPatchRequest:{type:"object",description:"A project groups environments and workspaces for easier management and access control.",properties:{platformKind:{$ref:"#/components/schemas/Common.schema1"},description:{type:"string"},gitRepoURL:{type:"string"},name:{type:"string"},autoPreviewEnabled:{type:"boolean",description:"Controls whether sample data is automatically fetched after running a node. When undefined, defaults based on platformKind."}},additionalProperties:!1},ProjectStatus:{type:"string",enum:["active","deleted"]},ProjectGitAccountResponseData:{type:"object",required:["gitAccountID","userID"],properties:{gitAccountID:{type:"string"},userID:{type:"string"}}},ProjectGitAccountSetRequest:{required:["gitAccountID"],properties:{gitAccountID:{type:"string"}}},UserSummary:{type:"object",description:"Summary information about a user.",additionalProperties:!1,properties:{id:{type:"string",description:"The user ID."},firstName:{type:"string",description:"User first name."},lastName:{type:"string",description:"User last name."},email:{type:"string"},accountType:{type:"string",enum:["SSO","normal"]}},required:["id"]},FirestoreWebTimestamp:{type:"object",description:"Timestamp from the web Firestore SDK.",additionalProperties:!1,properties:{seconds:{type:"number"},nanoseconds:{type:"number"}},required:["seconds","nanoseconds"]},FirestoreAdminTimestamp:{type:"object",description:"Timestamp from the admin Firestore SDK.",additionalProperties:!1,properties:{_seconds:{type:"number"},_nanoseconds:{type:"number"}},required:["_seconds","_nanoseconds"]},FirestoreTimestamp:{type:"object",description:"Timestamp from either the web admin Firestore SDKs.",oneOf:[{$ref:"#/components/schemas/FirestoreWebTimestamp"},{$ref:"#/components/schemas/FirestoreAdminTimestamp"}]},"Common.schema1":{type:"string",enum:["snowflake","databricks","fabric","bigquery"]},Error:{type:"object",additionalProperties:!1,properties:{errorString:{description:"The error message.",type:"string"},errorDetail:{description:"Additional detail about the error.",type:"string"}},required:["errorString"]},Node:{type:"object",oneOf:[{$ref:"#/components/schemas/SourceNode"},{$ref:"#/components/schemas/SQLNode"}]},NodeCreateRequest:{type:"object",properties:{nodeType:{$ref:"#/components/schemas/NodeType"},predecessorNodeIDs:{default:[],type:"array",items:{type:"string"},description:"The IDs of the nodes that are predecessors to this node. It can also be empty if it has no predecessors"}},additionalProperties:!1,required:["nodeType","predecessorNodeIDs"]},AliasToStepIDMapping:{type:"object",additionalProperties:{type:"string"}},AppliedColumnTests:{type:"object",description:"Will return `hasNull` or `isDistinct` as true or false if testing is enabled.",additionalProperties:{type:"boolean"}},BaseNode:{type:"object",additionalProperties:!0,properties:{database:{type:"string",description:"The Snowflake database name."},description:{type:"string",description:"The Node description."},id:{type:"string",description:"The Node ID."},locationName:{type:"string",description:"The Storage Mapping location."},name:{type:"string",description:"The Node name."},nodeType:{$ref:"#/components/schemas/NodeType"},schema:{type:"string",description:"The Snowflake schema name."}},required:["database","description","id","locationName","name","nodeType","schema"]},ColumnMetadata:{type:"object",additionalProperties:!1,properties:{appliedColumnTests:{$ref:"#/components/schemas/AppliedColumnTests"},columnID:{type:"string",description:"The column ID."},columnReferences:{items:{$ref:"#/components/schemas/IntermediateColumnRefResult"},type:"array"},config:{type:"object",description:"Returns any configuration options from the Node Config Tab.",additionalProperties:!0},dataType:{type:"string",description:"Column data type."},defaultValue:{type:"string",description:"The default column value."},description:{type:"string",description:"The column description."},hashDetails:{$ref:"#/components/schemas/HashMetadata"},hashedColumns:{type:"array",items:{$ref:"#/components/schemas/ColumnReference"}},isBusinessKey:{type:"boolean",description:"Tags the column as a business key."},isChangeTracking:{type:"boolean",description:"Tags the column as a change tracking column in type 2 dimensions."},isSurrogateKey:{type:"boolean",description:"Tags the column as a surrogate key, e.g. DIM_CUSTOMER_KEY."},keyColumnType:{type:"string",enum:["None","primaryBusinessKey","surrogateKey"]},name:{type:"string",description:"The column name."},nullable:{type:"boolean",description:"If the column can contain null values."},primaryKey:{description:"Tags the column as a primary key.",type:"boolean"},sources:{items:{$ref:"#/components/schemas/SourceColumnReferenceV1"},type:"array"},systemColumnType:{type:"string",enum:["None","sysCreateDate","sysCurrentFlag","sysEndDate","sysStartDate","sysUpdateDate","sysVersion"]},transform:{type:"string"},uniqueKey:{type:"boolean"},isSystemCreateDate:{type:"boolean"},isSystemUpdateDate:{type:"boolean"},isSystemStartDate:{type:"boolean"},isSystemEndDate:{type:"boolean"},isSystemVersion:{type:"boolean"},isSystemCurrentFlag:{type:"boolean"}},required:["columnID","dataType","description","name","nullable"]},ColumnReference:{type:"object",additionalProperties:!1,properties:{columnID:{type:"string",description:"Column ID of the source column."},nodeID:{type:"string",description:"Node ID of the source columm."}},required:["columnID","nodeID"]},CustomSQL:{type:"object",additionalProperties:!1,properties:{customSQL:{type:"string"}},required:["customSQL"]},HashAlgorithm:{type:"string",enum:["MD5","SHA1","SHA256"]},HashMetadata:{type:"object",additionalProperties:!1,properties:{hashAlgorithm:{$ref:"#/components/schemas/HashAlgorithm"},hashType:{enum:["ChangeHash","Hash","HubHash","LinkHash","None"],type:"string"},hubHashes:{items:{$ref:"#/components/schemas/ColumnReference"},type:"array"}},required:["hashAlgorithm"]},IntermediateColumnRefResult:{additionalProperties:!1,properties:{columnName:{type:"string"},tableName:{type:"string",nullable:!0}},required:["columnName","tableName"],type:"object"},JoinCondition:{type:"object",additionalProperties:!1,properties:{joinCondition:{type:"string"}},required:["joinCondition"]},NodeType:{anyOf:[{type:"string",enum:["Dimension","Fact","Hub","Link","Satellite","Source","Stage","View","persistentStage"]},{type:"string"}]},RefLink:{type:"object",additionalProperties:!1,properties:{locationName:{type:"string"},nodeName:{type:"string"}},required:["locationName","nodeName"]},SourceColumnReference:{anyOf:[{$ref:"#/components/schemas/SourceColumnReferenceV1"},{$ref:"#/components/schemas/SourceColumnReferenceV2"}]},SourceColumnReferenceV1:{type:"object",additionalProperties:!1,properties:{columnReferences:{items:{$ref:"#/components/schemas/ColumnReference"},type:"array"},transform:{type:"string",description:"Returns the SQL of any column transformations."}},required:["columnReferences","transform"]},SourceColumnReferenceV2:{type:"object",additionalProperties:!1,properties:{transform:{type:"string",description:"Returns the SQL of any column transformations."}},required:["transform"]},SourceMap:{additionalProperties:!1,properties:{aliases:{$ref:"#/components/schemas/AliasToStepIDMapping"},customSQL:{$ref:"#/components/schemas/CustomSQL"},dependencies:{items:{$ref:"#/components/schemas/RefLink"},type:"array"},join:{$ref:"#/components/schemas/JoinCondition"},name:{type:"string"},noLinkRefs:{items:{$ref:"#/components/schemas/RefLink"},type:"array"}},required:["dependencies","join","name","noLinkRefs"],type:"object"},RunStatus:{enum:["canceled","completed","failed","initializing","rendering","running","waitingToRun"],type:"string"},RunType:{enum:["deploy","refresh"],type:"string"},BigQueryUserConnectionType:{type:"string",enum:["ServiceAccount","OAuth"]},DatabricksUserConnectionType:{type:"string",enum:["Token","Cloud","OAuthU2M","OAuthM2M"]},FabricUserConnectionType:{type:"string",enum:["oauth"]},SnowflakeUserConnectionType:{type:"string",enum:["Basic","Cloud","KeyPair","OAuth"]},DeployRunDetails:{type:"object",additionalProperties:!1,description:"Deployment run details.",properties:{canceled:{type:"boolean",description:"If the run was canceled."},deployCommit:{type:"string",description:"The full commit hash."},deployCommitMessage:{type:"string",description:"The commit message."},environmentID:{type:"string",description:"The Environment ID for this run."},parallelism:{type:"integer",description:"The parallelism parameter determines how many nodes are processed simultaneously (in parallel) by the Snowflake compute warehouse."},nodesInRun:{type:"integer",description:"The number of Nodes deployed."}},required:["deployCommit","environmentID"]},RefreshRunDetails:{type:"object",additionalProperties:!1,description:"Refresh run details.",properties:{canceled:{type:"boolean",description:"If the run was canceled."},environmentID:{type:"string",description:"The Environment ID for this run."},excludeNodesSelector:{type:"string",description:"A selector string of nodes to exclude."},forceIgnoreEnvironmentStatus:{type:"boolean"},includeNodesSelector:{type:"string",description:"A selector string of nodes to include."},jobID:{type:"integer",description:"The Job ID."},parallelism:{type:"integer",description:"The parallelism parameter determines how many nodes are processed simultaneously (in parallel) by the Snowflake compute warehouse."},refreshDescription:{type:"string",description:"The Job name."},nodesForRefresh:{type:"integer"},nodesInRun:{type:"integer",description:"The number of Nodes deployed."},executor:{type:"string"}},required:["environmentID"]},RunDetails:{description:"Detailed information about a run.",anyOf:[{$ref:"#/components/schemas/DeployRunDetails"},{$ref:"#/components/schemas/RefreshRunDetails"}]},RunInfo:{description:"The full details of a run, without the run results.",type:"object",additionalProperties:!1,properties:{id:{type:"integer"},reRunID:{type:"string",description:"If this is a re-run, the ID of the original operation."},runDetails:{$ref:"#/components/schemas/RunDetails"},runEndTime:{format:"date-time",type:"string",description:"The datetime when the run ended."},runFailureReason:{type:"string",description:"The reason the run failed."},runHistory:{items:{type:"integer"},type:"array"},runStartTime:{format:"date-time",type:"string",description:"The datetime the run started."},runStatus:{$ref:"#/components/schemas/RunStatus"},runTimeParameters:{type:"object",description:"The default Environment parameters. Parameters changed during deploy will not show here.",additionalProperties:!0},runType:{$ref:"#/components/schemas/RunType"},userCredentials:{oneOf:[{$ref:"#/components/schemas/SnowflakeUserCredentials"},{$ref:"#/components/schemas/DatabricksUserCredentials"},{$ref:"#/components/schemas/FabricUserCredentials"},{$ref:"#/components/schemas/BigQueryUserCredentials"}]},userID:{type:"string"},projectID:{type:"string"},hasTestFailures:{type:"boolean",description:"Whether the run has test failures."},version:{type:"integer"},renderingProgress:{type:"object",description:"Progress information for the rendering phase",properties:{totalNodes:{type:"integer",minimum:0,description:"Total number of nodes to render"},completedNodes:{type:"integer",minimum:0,description:"Number of nodes completed so far"}},required:["totalNodes","completedNodes"]}},required:["id","runDetails","runStatus","runTimeParameters","runType","projectID"]},BigQueryUserCredentials:{description:"Information about the BigQuery account used to perform a run.",type:"object",additionalProperties:!1,properties:{bigQueryAuthType:{$ref:"#/components/schemas/BigQueryUserConnectionType"}},required:["bigQueryAuthType"]},FabricUserCredentials:{description:"Information about the Fabric account used to perform a run.",type:"object",additionalProperties:!1,properties:{fabricConnectionString:{type:"string"},fabricAuthType:{$ref:"#/components/schemas/FabricUserConnectionType"},platformKind:{type:"string"}},required:["fabricConnectionString","fabricAuthType"]},DatabricksUserCredentials:{description:"Information about the Databricks account used to perform a run.",type:"object",additionalProperties:!1,properties:{databricksHost:{type:"string"},databricksAuthType:{$ref:"#/components/schemas/DatabricksUserConnectionType"},databricksPath:{type:"string"}},required:["databricksHost","databricksAuthType","databricksPath"]},SnowflakeUserCredentials:{description:"Information about the Snowflake account used to perform a run.",type:"object",additionalProperties:!1,properties:{snowflakeAccount:{type:"string"},snowflakeAuthType:{$ref:"#/components/schemas/SnowflakeUserConnectionType"},snowflakeRole:{type:"string"},snowflakeUsername:{type:"string"},snowflakeWarehouse:{type:"string"}},required:["snowflakeAccount","snowflakeAuthType","snowflakeUsername"]},QueryResult:{type:"object",additionalProperties:!1,properties:{endTime:{type:"string",format:"date-time"},error:{$ref:"#/components/schemas/Error"},isRunning:{type:"boolean",description:"If the queried run is still running."},name:{type:"string",description:"The name of the Stage the query ran on."},queryID:{type:"string"},rowsDeleted:{type:"integer"},rowsInserted:{type:"integer"},rowsUpdated:{type:"integer"},sql:{type:"string",description:"The SQL query run during the stage."},startTime:{type:"string",format:"date-time"},status:{type:"string",description:"The query status."},success:{type:"boolean",description:"If the query results were run successfully."},type:{type:"string",enum:["sql","sqlTest"]},warehouse:{type:"string",description:"Name of the warehouse."}},required:["isRunning","name","sql","status","success"]},RunResult:{type:"object",additionalProperties:!1,description:"The result output describing each query processed during a run.",properties:{isRunning:{type:"boolean",description:"If the queried run is still running."},name:{type:"string"},nodeID:{type:"string"},runState:{type:"string"},hasTestFailures:{type:"boolean"},origin:{$ref:"#/components/schemas/RunOrigins"},queryResults:{description:"The query result returns the status of different stages such as Delete Table or Rename Table. See the queryResults name for the stage.",items:{$ref:"#/components/schemas/QueryResult"},type:"array"},renderQueryResult:{$ref:"#/components/schemas/QueryResult"}},required:["isRunning","name","nodeID","queryResults"]},RunOrigins:{type:"string",enum:["API","CLI","UI","fivetranAPI"]},StoredRunResult:{type:"object",additionalProperties:!0,description:"Raw run result from external storage matching the core-types RunResult",properties:{id:{type:"string",description:"The node ID"},dataResult:{description:"Data result - can be a record of values or a completed query result",oneOf:[{type:"object",nullable:!0,additionalProperties:{oneOf:[{type:"number"},{type:"string"},{type:"boolean"}]}},{$ref:"#/components/schemas/CompletedQueryResult"}]},name:{type:"string",description:"The name of the node"},queryResultSequence:{$ref:"#/components/schemas/QueryResultSequence"},runExecutionSequenceID:{type:"integer",description:"The execution sequence ID"},hasTestFailures:{type:"boolean",description:"Whether the run has test failures"},runResultVersion:{type:"integer",enum:[2],default:2,description:"Version of the run result format"},runState:{type:"string",enum:["waiting","queued","running","complete","error","skipped","canceled"],description:"The state of the run"},stepRunState:{type:"string",enum:["None","Error","Validated","Created","DataLoaded","Skipped"],description:"The state of the step run"},version:{type:"integer",enum:[2],default:2,description:"Version field"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"}},required:["id","name","queryResultSequence","runState","stepRunState","version","createdAt","updatedAt"]},QueryResultSequence:{type:"object",additionalProperties:!0,properties:{name:{type:"string"},queryResults:{type:"array",items:{oneOf:[{$ref:"#/components/schemas/CompletedQueryResult"},{$ref:"#/components/schemas/RunningQueryResult"}]}},isRunning:{type:"boolean"},renderQueryResults:{$ref:"#/components/schemas/CompletedQueryResult",description:"Legacy field - unused"}},required:["name","queryResults","isRunning"]},CompletedQueryResult:{type:"object",additionalProperties:!0,properties:{endTime:{type:"string",format:"date-time"},error:{type:"object",properties:{errorString:{type:"string"},errorDetail:{type:"string"}},required:["errorString","errorDetail"],nullable:!0},fields:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}},isRunning:{type:"boolean"},name:{type:"string"},sql:{type:"string"},startTime:{type:"string",format:"date-time"},status:{type:"string",enum:["Success","Failure","Canceled","Queued","Running","Transaction exceeded data limit, returned a subset of rows"]},success:{type:"boolean"},type:{type:"string",enum:["sql","sqlTest"]},exportedRefs:{type:"array",items:{type:"object",properties:{locationName:{type:"string"},nodeName:{type:"string"}},required:["locationName","nodeName"]}},invalidExportedRefs:{type:"array",items:{type:"object",properties:{locationName:{type:"string"},nodeName:{type:"string"}},required:["locationName","nodeName"]}}},required:["name","isRunning","status","success","type","exportedRefs","invalidExportedRefs","startTime","endTime","sql","fields"]},RunningQueryResult:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},isRunning:{type:"boolean",enum:[!0]}},required:["name","isRunning"]},OrgRoles:{type:"object",description:"Specifies role assignments.",required:["organizationRoles","projects"],properties:{organizationRoles:{description:"The organization roles assigned to the user.",type:"array",items:{type:"string"}},projects:{description:"A dictionary of project role assignments keyed by project ID.",type:"object",additionalProperties:{$ref:"#/components/schemas/ProjectRoles"}}},additionalProperties:!0},ProjectRoles:{type:"object",description:"Specifies project role assignments.",required:["projectRoles","environments"],properties:{projectRoles:{type:"array",items:{type:"string"}},environments:{description:"A dictionary of environment role assignments keyed by environment ID.",type:"object",additionalProperties:{$ref:"#/components/schemas/EnvironmentRoles"}}},additionalProperties:!0},EnvironmentRoles:{type:"object",description:"Specifies environment role assignments.",required:["environmentRoles"],properties:{environmentRoles:{description:"The environment roles assigned to the user.",type:"array",items:{type:"string"}}},additionalProperties:!0},UserOrgRoles:{description:"The roles assigned to a user.",allOf:[{$ref:"#/components/schemas/OrgRoles"},{type:"object",required:["user","organizationRoles","projects"],properties:{user:{$ref:"#/components/schemas/UserSummary"}},additionalProperties:!0}]},UserProjectRoles:{description:"The project roles assigned to the user.",allOf:[{$ref:"#/components/schemas/ProjectRoles"},{type:"object",required:["user","projectRoles","environments"],properties:{user:{$ref:"#/components/schemas/UserSummary"}},additionalProperties:!0}]},UserEnvironmentRoles:{description:"The environment roles assigned to the user.",allOf:[{$ref:"#/components/schemas/EnvironmentRoles"},{type:"object",required:["user"],properties:{user:{$ref:"#/components/schemas/UserSummary"}},additionalProperties:!0}]},UserOrgRolesV2:{description:"The roles assigned to a user.",type:"object",properties:{userID:{type:"string"},organizationRole:{description:`The user role for the org. If the user's organization role does not grant any project permissions and an
10371
10371
  environment or project ID was specified, this will be omitted
10372
10372
  `,type:"string"},projectRoles:{description:`For each project, if the user has a role, the key is the project ID and the value is the user's role. If the
10373
10373
  user has a role but the role grants to environment permissions to a specified environment, it will be omitted.
10374
10374
  `,type:"object",additionalProperties:{type:"string"}},environmentRoles:{description:`For each environment, if the user has a role, the key is the environment ID and the value is the user's role.
10375
- `,type:"object",additionalProperties:{type:"string"}}},required:["userID"]},FivetranProject:{type:"object",properties:{id:{type:"string"},name:{type:"string"},createdAtUtc:{type:"string",format:"date-time"},updatedAtUtc:{type:"string",format:"date-time"},extras:{type:"object",description:"Additional data, if applicable"}},required:["id","name","createdAtUtc","updatedAtUtc"]},FivetranJob:{type:"object",properties:{id:{type:"string"},projectId:{type:"string"},name:{type:"string"},createdAtUtc:{type:"string",format:"date-time"},updatedAtUtc:{type:"string",format:"date-time"},extras:{type:"object",description:"Additional data, if applicable"}}},FivetranJobHistory:{type:"object",properties:{id:{type:"string"},jobId:{type:"string"},status:{$ref:"#/components/schemas/FivetranJobStatus"},startedAtUtc:{type:"string",format:"date-time",nullable:!0},endedAtUtc:{type:"string",format:"date-time",nullable:!0},logs:{type:"array",items:{type:"string"}},extras:{type:"object",description:"Additional data, if applicable"}}},FivetranJobStatus:{type:"string",description:"Possible statuses of jobs",enum:["SCHEDULING","RUNNING","SUCCEEDED","TERMINATING","FAILED"]},FivetranJobRunCause:{type:"string",description:"Possible run cause",enum:["Triggered by Fivetran"]},JobName:{type:"string",minLength:1,maxLength:100,description:"Name of the job"},JobRequest:{"x-coa-private":!0,type:"object",additionalProperties:!1,description:"Request body for creating or updating a job",properties:{name:{$ref:"#/components/schemas/JobName"},includeSelector:{type:"string",description:"A selector string of nodes to include"},excludeSelector:{type:"string",description:"A selector string of nodes to exclude"}},required:["name","includeSelector","excludeSelector"]},Job:{type:"object",description:"A Coalesce job.",additionalProperties:!0,properties:{id:{type:"string",description:"The Job ID."},name:{type:"string",description:"The Job name."},includeSelector:{type:"string",description:"A selector string of nodes to include."},excludeSelector:{type:"string",description:"A selector string of nodes to exclude."},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"}},required:["id","name","includeSelector","excludeSelector","createdAt","updatedAt"]},BaseGitAccount:{type:"object",description:"The core fields for a git account",properties:{gitAccountName:{type:"string"},gitAuthorEmail:{type:"string"},gitAuthorName:{type:"string"},gitUsername:{type:"string"}}},GitAccountCreateRequest:{description:"All the fields needed to create a git account",allOf:[{$ref:"#/components/schemas/GitAccountRequest"}],required:["gitAccountName","gitAuthorEmail","gitAuthorName","gitUsername","gitToken"]},GitAccountUpdateRequest:{description:"All the fields needed to update a git account",$ref:"#/components/schemas/GitAccountRequest"},GitAccountResponse:{description:"All the fields needed to create a git account",allOf:[{$ref:"#/components/schemas/BaseGitAccount"},{type:"object",properties:{id:{type:"string"},createdAt:{type:"string",format:"date-time"},createdBy:{$ref:"#/components/schemas/UserSummary"},updatedAt:{type:"string",format:"date-time"},updatedBy:{$ref:"#/components/schemas/UserSummary"},accountOwner:{$ref:"#/components/schemas/UserSummary"}},required:["id","gitAccountName","gitAuthorEmail","gitAuthorName","gitUsername"]}]},GitAccountsListResponse:{description:"A list of git accounts",type:"array",items:{$ref:"#/components/schemas/GitAccountResponse"}},GitAccountRequest:{allOf:[{$ref:"#/components/schemas/BaseGitAccount"},{type:"object",properties:{gitToken:{type:"string"}}}]},RegistryPackageReleaseResult:{description:"A single release of a package in the registry.",type:"object",properties:{createdAt:{type:"string",format:"date-time"},createdBy:{type:"string"},updatedBy:{type:"string"},updatedAt:{type:"string",format:"date-time"},version:{type:"string"},changeLog:{type:"string"},releaseID:{type:"string"},storagePath:{type:"string"},privacy:{type:"string",enum:["public","private","unlisted"]}},required:["createdAt","updatedAt","version","changeLog","releaseID","storagePath","privacy"]},RegistryPackageResult:{description:"A single package in the registry.",type:"object",properties:{updatedBy:{type:"string"},updatedAt:{type:"string",format:"date-time"},name:{type:"string"},publisherID:{type:"string"},description:{type:"string"},org:{type:"string"},latestRelease:{type:"string"},overview:{type:"string"},featured:{type:"boolean"},tags:{type:"array",minItems:0,items:{type:"string"}},certified:{type:"boolean"},packageID:{type:"string"},id:{type:"string"},platformKind:{type:"string",enum:["fabric","snowflake","databricks","bigquery"]}},required:["name","description","org","latestRelease","overview","tags","featured","certified","publisherID","packageID","id","platformKind"]},NodeDescription:{type:"object",description:"An object containing node description",properties:{description:{type:"string",description:"AI generated description of the node.",minLength:1}},required:["description"]},NodeDescriptionRequest:{type:"object",properties:{workspaceID:{type:"number",description:"The workspace ID."},nodeID:{type:"string",description:"The node ID.",minLength:1}},required:["workspaceID","nodeID"]},CreatePlanRequest:{type:"object",required:["parameters","runDetails","userCredentials"],properties:{parameters:{type:"object"},runDetails:{type:"object",required:["currentWorkspaceDataFilePath","desiredWorkspaceDataFilePath","disablePresync","environmentID","planID"],properties:{currentWorkspaceDataFilePath:{type:"string"},desiredWorkspaceDataFilePath:{type:"string"},disablePresync:{type:"boolean"},environmentID:{type:"string"},planID:{type:"string"},skippedBeforeCollection:{type:"boolean",default:!1},useRenderCache:{type:"boolean",default:!1}}},userCredentials:{type:"object"}}},PlanRequestAcceptedResponse:{type:"object",required:["message","planID"],properties:{message:{type:"string"},planID:{type:"string"}}},PlanResponse:{type:"object",required:["planStorageFilePath"],properties:{planStorageFilePath:{type:"string"}}},InFlightPlanResponse:{type:"object",required:["status"],properties:{status:{type:"string",enum:["planning"]}}},GitCommitMessageRequest:{type:"object",properties:{files:{type:"array",items:{type:"object",properties:{path:{type:"string",description:"File path relative to repository root"},before:{type:"string",description:"File content before changes"},after:{type:"string",description:"File content after changes"}},required:["path","before","after"]},description:"Array of files being committed with their before/after content",minItems:1}},required:["files"]},GitCommitMessageResponse:{type:"object",properties:{message:{type:"string",description:"AI generated git commit message (Soft max 200 chars, Hard max 400 chars)",maxLength:400}},required:["message"]},WriteInfo:{type:"object",required:["entityType","writeType","data"],properties:{entityType:{anyOf:[{type:"string",enum:["node","workspace","run","subgraph","job","macro","nodeType","installedPackage"]}]},writeType:{anyOf:[{type:"string",enum:["save","delete","merge"]}]},data:{type:"object",required:["id","version"],properties:{id:{anyOf:[{type:"string"},{type:"number"}]},version:{anyOf:[{type:"string"},{type:"number"}]}}}}},ChatRequest:{type:"object",required:["messages","threadId"],properties:{messages:{type:"array",description:"An array of message objects representing the conversation history.",items:{type:"object",required:["role","content"],properties:{role:{type:"string",enum:["user","assistant"],description:"The role of the message sender."},content:{type:"string",description:"The text content of the message."}}}},systemPrompt:{type:"string",description:"Optional system prompt"},responseSchema:{type:"object",description:"Optional schema for structuring the response format"},threadId:{type:"string",description:"Identifier for the conversation thread"}}},ChatResponse:{type:"object",required:["text"],properties:{text:{type:"string",description:"AI-generated response text"},usage:{type:"object",properties:{inputUsage:{type:"number"},outputUsage:{type:"number"},unit:{type:"string",enum:["token","char"]}}}}},LlmRequest:{type:"object",required:["model","messages"],properties:{model:{type:"string",description:"The model to use for the LLM call"},messages:{type:"array",description:"The messages to send to the LLM"},schema:{type:"object",description:"The schema to use for structured output",additionalProperties:!0},tools:{type:"object",description:"The tools to use for the LLM call",additionalProperties:!0},toolChoice:{description:"Controls which tools the model can use",oneOf:[{type:"string",enum:["auto","required","none"]},{type:"object",required:["type","toolName"],properties:{type:{type:"string",enum:["tool"]},toolName:{type:"string"}}}]}}},LlmResponse:{type:"object",description:"The response from the LLM call",additionalProperties:!0},SubgraphName:{type:"string",minLength:1,maxLength:100,description:"Name of the subgraph"},SubgraphRequest:{"x-coa-private":!0,type:"object",additionalProperties:!1,description:"Request body for creating or updating a subgraph",properties:{name:{$ref:"#/components/schemas/SubgraphName"},steps:{type:"array",description:"Array of node IDs in the subgraph",items:{type:"string",maxLength:64}}},required:["name","steps"]},Subgraph:{"x-coa-private":!0,type:"object",additionalProperties:!1,description:"A partial collection of nodes from the node graph, allowing easier viewing and editing of a portion of a large graph.",properties:{id:{type:"string",description:"Unique identifier for the subgraph"},name:{$ref:"#/components/schemas/SubgraphName"},steps:{type:"array",description:"Array of node IDs in the subgraph",items:{type:"string",maxLength:64}},version:{type:"integer",enum:[1],default:1,description:"Version of the subgraph schema"},createdAt:{type:"string",format:"date-time",description:"Date and time the subgraph was created"},updatedAt:{type:"string",format:"date-time",description:"Date and time the subgraph was last updated"},createdBy:{type:"string",description:"ID of the user who created the subgraph"},updatedBy:{type:"string",description:"ID of the user who last updated the subgraph"}},required:["id","name","steps","version"]},DatabricksWarehouse:{type:"object",description:"A minimal Databricks SQL warehouse configuration returned from GetDatabricksWarehouse.",properties:{id:{type:"string",description:"The unique identifier of the warehouse"},name:{type:"string",description:"The name of the warehouse"},odbc_params:{type:"object",description:"The connection parameters for the warehouse",properties:{path:{type:"string",description:"The path for the SQL warehouse"}},required:["path"]}},required:["id","name","odbc_params"]},DatabricksWarehouseResponse:{type:"object",description:"Response containing a list of Databricks SQL warehouses.",properties:{warehouses:{type:"array",items:{$ref:"#/components/schemas/DatabricksWarehouse"}}},required:["warehouses"]},BigQueryProject:{type:"object",description:"A minimal BigQuery project entry.",properties:{id:{type:"string",description:"The project ID"},name:{type:"string",description:"The project friendly name"}},required:["id"]},BigQueryProjectsResponse:{type:"object",description:"Response containing a list of BigQuery projects.",properties:{projects:{type:"array",items:{$ref:"#/components/schemas/BigQueryProject"}}},required:["projects"]},BigQueryDatasetsResponse:{type:"array",description:"A list of BigQuery dataset (schema) names.",items:{type:"string"}},BaseWorkspaceEnv:{type:"object",description:"A workspace is a collection of resources that are used to develop, test, and deploy code.",additionalProperties:!0,properties:{connectionAccount:{type:"string",description:"The Snowflake account name."},defaultStorageMapping:{type:"string",nullable:!0},description:{type:"string",description:"The Workspace description."},name:{type:"string",description:"The Workspace name."},oauthEnabled:{type:"boolean",description:"If Snowflake OAuth is enabled."},tagColors:{$ref:"#/components/schemas/TagColor"},project:{type:"string",description:"The Project ID."},createdAt:{type:"string",format:"date-time"},createdBy:{$ref:"#/components/schemas/UserSummary"},updatedAt:{type:"string",format:"date-time"},currentGitBranch:{type:"string",description:"The branch most recently run on this environment."},currentGitCommit:{type:"string"},currentGitURL:{type:"string"},currentlyRunningJobs:{description:"An array of any running Jobs. If there are not Jobs running, this will return empty.",type:"array",items:{type:"integer"}},id:{type:"string"},deployedCommit:{type:"string",description:"The most recently deployed commit ID."},status:{$ref:"#/components/schemas/WorkspaceEnvHealth"},platformKind:{$ref:"#/components/schemas/Common.schema1"}},required:["createdAt","updatedAt","id","name","oauthEnabled","project","status"]},Workspace:{allOf:[{$ref:"#/components/schemas/BaseWorkspaceEnv"},{type:"object",additionalProperties:!0,properties:{mappingsV1:{type:"string"},runTimeParameters:{type:"string"},jobs:{type:"array",items:{$ref:"#/components/schemas/Job"}}}}]},WorkspaceSummary:{type:"object",description:"A set of minimal workspace data.",additionalProperties:!0,properties:{id:{type:"string"},name:{type:"string"},project:{type:"string",description:"The Project ID."},status:{$ref:"#/components/schemas/WorkspaceEnvHealth"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},jobs:{type:"array",items:{$ref:"#/components/schemas/Job"}}},required:["createdAt","createdBy","updatedAt","id","name","status","project"]},WorkspaceEnvHealth:{type:"string",enum:["Deleting","Deploying","Failed Deploy","Failed Refresh","Initializing","Refreshing","Waiting"]},TagColor:{type:"object",description:"The tag color from the Environment settings.",additionalProperties:!1,properties:{backgroundColor:{type:"string"},textColor:{type:"string"}}},SourceColumnMetadata:{type:"object",additionalProperties:!1,properties:{columns:{items:{$ref:"#/components/schemas/ColumnMetadata"},type:"array"},join:{description:"The join condition of the source node.",type:"object",additionalProperties:!1,properties:{joinCondition:{type:"string",description:"Returns SQL from the Join tab."}},required:["joinCondition"]},sourceMapping:{type:"array",items:{$ref:"#/components/schemas/SourceMap"}}},required:["columns"]},SourceNode:{type:"object",description:"A source node returned by the API.",allOf:[{$ref:"#/components/schemas/BaseNode"},{type:"object",properties:{metadata:{$ref:"#/components/schemas/SourceColumnMetadata"},table:{description:"The table name of the source node.",type:"string"}},required:["metadata","table"]}]},MaterializationType:{anyOf:[{type:"string",enum:["table","view"]},{type:"string"}]},NodeTest:{type:"object",additionalProperties:!1,properties:{continueOnFailure:{type:"boolean"},description:{type:"string"},name:{type:"string"},runOrder:{$ref:"#/components/schemas/TestRunOrder"},templateString:{type:"string"}},required:["continueOnFailure","description","name","runOrder","templateString"]},SQLNode:{type:"object",description:"A SQL node returned by the API.",allOf:[{$ref:"#/components/schemas/BaseNode"},{type:"object",properties:{config:{$ref:"#/components/schemas/UserConfig"},isMultisource:{type:"boolean"},materializationType:{$ref:"#/components/schemas/MaterializationType"},metadata:{$ref:"#/components/schemas/SQLNodeMetadata"},overrideSQL:{type:"boolean"}},required:["config","isMultisource","materializationType","metadata","overrideSQL"]}]},SQLNodeMetadata:{type:"object",additionalProperties:!1,properties:{appliedNodeTests:{default:[],items:{$ref:"#/components/schemas/NodeTest"},type:"array"},columns:{default:[],items:{$ref:"#/components/schemas/ColumnMetadata"},type:"array"},cteString:{type:"string"},description:{type:"string"},destinationName:{type:"string"},enabledColumnTestIDs:{type:"array",items:{type:"string"}},mapping:{type:"object",additionalProperties:{anyOf:[{type:"object"},{type:"string"},{type:"number"},{type:"boolean"}]}},materializationOption:{type:"string"},sourceMapping:{type:"array",items:{$ref:"#/components/schemas/SourceMap"}}},required:["appliedNodeTests","columns","enabledColumnTestIDs","sourceMapping"]},TestRunOrder:{type:"string",enum:["After","Before"]},UserConfig:{type:"object",additionalProperties:{anyOf:[{type:"object"},{type:"string"},{type:"number"},{type:"boolean"}]}}},responses:{AllUsersResult:{description:"The list of users",content:{"application/json":{schema:{type:"object",properties:{total:{type:"integer",description:"The size of the result set."},startingFrom:{type:"string",description:"The cursor value used in the request."},limit:{type:"integer",description:"The requested page size."},next:{type:["string","null"],description:"The field value representing the start of the next page of results."},data:{type:"array",items:{type:"object",properties:{firstName:{type:"string"},lastName:{type:"string"},email:{type:"string"},id:{type:"string"},authDisabled:{type:"boolean"},deleted:{type:"boolean"}}}}},required:["total","limit","next","data"]}}}},CoaTagResponse:{description:"The coa image tag being used.","x-coa-private":!0,content:{"application/json":{schema:{type:"string"}}}},CoaTagReportResponse:{description:"A report of what coa image tags are being used for what orgs.","x-coa-private":!0,content:{"application/json":{schema:{type:"object",required:["defaultTag","deviatingOrgs"],properties:{defaultTag:{type:"string"},deviatingOrgs:{type:"array",items:{type:"object",required:["orgID","orgName","tag","image"],properties:{orgID:{type:"string"},orgName:{type:"string"},tag:{type:"string"},image:{type:"string"}}}}}}}}},CustomTokenResponse:{description:"The Coalesce custom token response","x-coa-private":!0,content:{"application/json":{schema:{type:"object",required:["customToken"],properties:{customToken:{description:"A Coalesce token",type:"string"}}}}}},EnvironmentResponse:{description:"Information about an environment.",content:{"application/json":{schema:{$ref:"#/components/schemas/Environment"}}}},EnvironmentsResponse:{description:"A collection of environment information.",content:{"application/json":{schema:{$ref:"#/components/schemas/EnvironmentsResponse"}}}},JobSummaryResponse:{description:"Information about a job.",content:{"application/json":{schema:{$ref:"#/components/schemas/Job"}}}},ProjectsResponse:{description:"A collection of project information.",content:{"application/json":{schema:{$ref:"#/components/schemas/ProjectsResponse"}}}},FeatureFlagsClientConfigResponse:{description:"Information used by the client to connect to feature flags service.","x-coa-private":!0,content:{"application/json":{schema:{$ref:"#/components/schemas/FeatureFlagsClientConfig"}}}},FeatureFlagsResponse:{description:"Feature flags.","x-coa-private":!0,content:{"application/json":{schema:{$ref:"#/components/schemas/FeatureFlagsValues"}}}},FivetranProjectsResponse:{description:"A collection of project information.",content:{"application/json":{schema:{$ref:"#/components/schemas/FivetranProjectsResponse"}}}},FivetranJobsResponse:{description:"A collection of Fivetran job information.",content:{"application/json":{schema:{$ref:"#/components/schemas/FivetranJobsResponse"}}}},FivetranJobHistoryResponse:{description:"Fivetran job history data.",content:{"application/json":{schema:{$ref:"#/components/schemas/FivetranJobHistoryResponse"}}}},FivetranRefreshJobResponse:{description:"The Fivetran start job refresh response.",content:{"application/json":{schema:{type:"object",required:["data"],properties:{data:{description:"Fivetran job history for the new run.",$ref:"#/components/schemas/FivetranJobHistory"}}}}}},GitAccountsListResponse:{description:"A list of git accounts for an org.",content:{"application/json":{schema:{type:"object",required:["data"],properties:{data:{$ref:"#/components/schemas/GitAccountsListResponse"}}}}}},GitAccountResponse:{description:"A list of git accounts for an org.",content:{"application/json":{schema:{type:"object",required:["data"],properties:{data:{$ref:"#/components/schemas/GitAccountResponse"}}}}}},NodeResponse:{description:"A node for an environment.",content:{"application/json":{schema:{$ref:"#/components/schemas/Node"}}}},NodesResponse:{description:"A collection of nodes for an environment.",content:{"application/json":{schema:{$ref:"#/components/schemas/NodesResponse"}}}},PackageResponse:{description:"A package registration","x-coa-private":!0,content:{"application/json":{schema:{type:"object",required:["releaseID","packageID","storePath","publisherID"],properties:{releaseID:{type:"string",minLength:1},publisherID:{type:"string"},packageID:{type:"string",minLength:1},storePath:{type:"string"}}}}}},PackageResponseV2:{description:"A package","x-coa-private":!0,content:{"application/json":{schema:{type:"object",required:["org","packageID","name","description","overview","tags","featured","certified","platformKind"],properties:{org:{type:"string"},name:{type:"string"},description:{type:"string"},overview:{type:"string"},tags:{type:"array",minItems:0,items:{type:"string"}},featured:{type:"boolean"},certified:{type:"boolean"},packageID:{type:"string"},id:{type:"string"},publisherID:{type:"string"},latestRelease:{type:"string"},platformKind:{$ref:"#/components/schemas/PlatformKind"}}}}}},PackageUpdateResponse:{description:"Successful package update","x-coa-private":!0,content:{"application/json":{schema:{type:"string"}}}},AllRegistryPackagesResult:{description:"A list of all packages in the registry.",content:{"application/json":{schema:{type:"array",minItems:0,items:{$ref:"#/components/schemas/RegistryPackageResult"}}}}},AllRegistryPackageReleasesResult:{description:"A list of all releases for a single package in the registry.",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/RegistryPackageReleaseResult"}}}}},RegistryPackageResult:{description:"A single package in the registry.",content:{"application/json":{schema:{$ref:"#/components/schemas/RegistryPackageResult"}}}},RegistryPackageReleaseResult:{description:"A single release for a single package in the registry.",content:{"application/json":{schema:{$ref:"#/components/schemas/RegistryPackageReleaseResult"}}}},ProjectResponse:{description:"Information about a project.",content:{"application/json":{schema:{$ref:"#/components/schemas/Project"}}}},RunResultsResponse:{description:"A collection of results for a deploy or refresh run.",content:{"application/json":{schema:{$ref:"#/components/schemas/RunResultsResponse"}}}},StoredRunResultsResponse:{description:"Raw run results from external storage.",content:{"application/json":{schema:{$ref:"#/components/schemas/StoredRunResultsResponse"}}}},RunResponse:{description:"A single run.",content:{"application/json":{schema:{$ref:"#/components/schemas/RunInfo"}}}},RunsResponse:{description:"A collection of runs.",content:{"application/json":{schema:{$ref:"#/components/schemas/RunsResponse"}}}},DatabaseInfoResponse:{description:"Information required to connect to the Coalesce database.",content:{"application/json":{schema:{$ref:"#/components/schemas/DatabaseInfo"}}}},secretExists:{"x-coa-private":!0,description:"Specifies whether or not a value for the secret exists.",content:{"application/json":{schema:{type:"boolean"}}}},ValidHostname:{"x-coa-private":!0,description:"A whitelisted version of the passed hostname.",content:{"application/json":{schema:{type:"string"}}}},TypesenseConfigurationResponse:{"x-coa-private":!0,description:"The typesense configuration data for a given org.",content:{"application/json":{schema:{$ref:"#/components/schemas/TypesenseConfigResponse"}}}},UserEnvironmentRoleResponse:{description:"A user's environment role information.",content:{"application/json":{schema:{$ref:"#/components/schemas/EnvironmentRoles"}}}},UserEnvironmentRolesResponse:{description:"A collection of user environment role information.",content:{"application/json":{schema:{$ref:"#/components/schemas/UserEnvironmentRolesResponse"}}}},UserProjectRoleResponse:{description:"A user's project role information.",content:{"application/json":{schema:{$ref:"#/components/schemas/ProjectRoles"}}}},UserProjectRolesResponse:{description:"A collection of user project role information.",content:{"application/json":{schema:{$ref:"#/components/schemas/UserProjectRolesResponse"}}}},UserRoleResponse:{description:"A user's role information.",content:{"application/json":{schema:{$ref:"#/components/schemas/OrgRoles"}}}},UserRolesResponse:{description:"A collection of user role information.",content:{"application/json":{schema:{$ref:"#/components/schemas/UserRolesResponse"}}}},SingleUserRoleResponseV2:{description:"A single user's role information",content:{"application/json":{schema:{$ref:"#/components/schemas/SingleUserRoleResponseV2"}}}},UserRoleResponseV2:{description:"A collection of user role information.",content:{"application/json":{schema:{$ref:"#/components/schemas/UserRoleResponseV2"}}}},NodeDescriptionResponse:{description:"The AI generated node description.",content:{"application/json":{schema:{$ref:"#/components/schemas/NodeDescription"}}}},PlanRequestAcceptedResponse:{description:"The request has been accepted for processing, but processing has not been completed.",content:{"application/json":{schema:{$ref:"#/components/schemas/PlanRequestAcceptedResponse"}}}},PlanResponse:{description:"A collection of plan information.",content:{"application/json":{schema:{oneOf:[{$ref:"#/components/schemas/PlanResponse"},{$ref:"#/components/schemas/InFlightPlanResponse"}]}}}},AlreadyExistsError:{description:"The requested resource already exists.",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}},BadGatewayError:{description:"The server received an error from an upstream system.",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}},ForbiddenError:{description:"The client is not permitted to perform the requested operation.",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}},GatewayTimeoutError:{description:"The server did not receive a response in time from an upstream system.",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}},InternalServerError:{description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}},InvalidRequestError:{description:"The request was invalid.",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}},NotFoundError:{description:"The requested resource could not be found.",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}},ServiceUnavailableError:{description:"The service is currently unavailable.",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}},Unauthorized:{description:"User lacks authorization to perform this action.",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}},GitCommitMessageResponse:{description:"AI generated git commit message",content:{"application/json":{schema:{$ref:"#/components/schemas/GitCommitMessageResponse"}}}}},parameters:{orderByDirection:{name:"orderByDirection",description:"The sort order for query results.",in:"query",schema:{description:"The sort order for query results.",type:"string",enum:["asc","desc"],default:"desc"},required:!1},secretType:{"x-coa-private":!0,description:"The name of the secret type.",name:"secretType",in:"path",schema:{type:"string"},required:!0},context:{description:"Contextual information required to identify a particular secret.",name:"context",in:"path",schema:{type:"string"},required:!0},newSecretType:{"x-coa-private":!0,description:"The name of the secret type to upgrade to.",name:"newSecretType",in:"path",schema:{type:"string"},required:!0},orgId:{"x-coa-private":!0,description:"The Organization ID of the organization that will be affected by the API call.",name:"orgId",in:"path",schema:{type:"string"},required:!0},runId:{"x-coa-private":!0,description:"The Run ID of the run that will be affected by the API call.",name:"runId",in:"path",schema:{type:"integer"},required:!0},coaTag:{"x-coa-private":!0,description:"A coa container image tag in Google Container Registry.",name:"coaTag",in:"path",schema:{type:"string"},required:!0}},securitySchemes:{BearerAuth:{type:"http",scheme:"bearer"}}},paths:{"/api/v1/customToken":{summary:"Custom Token","x-coa-private":!0,post:{summary:"Generate Custom Token",description:"Generate a Coalesce token from the provided OpenID Connect ID token",operationId:"GenerateCustomToken","x-eov-operation-handler":"SSOHandlers",requestBody:{description:"The information from the OpenID Connect authorization server required to sign into Coalesce.",required:!0,content:{"application/json":{schema:{oneOf:[{type:"object",description:"Token information for OpenID connect authorization completed on the client.",required:["type","idToken","accessToken","orgID"],properties:{type:{type:"string",enum:["token"]},idToken:{type:"string"},accessToken:{type:"string"},orgID:{type:"string"}},additionalProperties:!1},{type:"object",description:"Information for completing the authorization code grant on the backend.",required:["type","code","redirectURI","codeVerifier","orgID"],properties:{type:{type:"string",enum:["code"]},code:{type:"string"},redirectURI:{type:"string"},codeVerifier:{type:"string"},orgID:{type:"string"},extraTokenParams:{type:"object"}},additionalProperties:!1}]}}}},security:[],tags:["Authorization"],responses:{"200":{$ref:"#/components/responses/CustomTokenResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/environments":{summary:"Environments","x-coa-command-group":"environments",parameters:[{name:"overrideOrgID",description:"Runs an operation against the specified org. (Super-users only.)","x-coa-private":!0,in:"query",schema:{type:"string"},required:!1}],get:{summary:"List Environments",description:"Get a collection of Environment information.",operationId:"GetEnvironments","x-eov-operation-handler":"EnvironmentHandlers","x-coa-command":"list",parameters:[{name:"detail",description:"Include the full detail of the environments.",in:"query",schema:{type:"boolean",default:!1},required:!1},{name:"limit",description:"The maximum number of environments to return.",in:"query",schema:{type:"integer",minimum:1,maximum:500,default:100},required:!1},{name:"startingFrom",description:"The cursor point for paging the query results.",in:"query",allowReserved:!0,schema:{type:"string"},required:!1},{name:"orderBy",description:"The field to order the results by.",in:"query",schema:{type:"string",enum:["id"],default:"id"},required:!1}],security:[{BearerAuth:[]}],tags:["Environments"],responses:{"200":{$ref:"#/components/responses/EnvironmentsResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},post:{summary:"Create Environment",description:"Create a new environment.",operationId:"CreateEnvironment","x-eov-operation-handler":"EnvironmentHandlers","x-coa-private":!0,security:[{BearerAuth:[]}],tags:["Environments"],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/EnvironmentCreateRequest"}}}},responses:{"201":{$ref:"#/components/responses/EnvironmentResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/environments/{environmentID}":{summary:"Environment","x-coa-command-group":"environments",parameters:[{name:"environmentID",description:"The environment ID.",in:"path",schema:{type:"string"},required:!0},{name:"overrideOrgID",description:"Runs an operation against the specified org. (Super-users only.)","x-coa-private":!0,in:"query",schema:{type:"string"},required:!1}],delete:{summary:"Delete Environment",description:"Delete an environment.",operationId:"DeleteEnvironment","x-eov-operation-handler":"EnvironmentHandlers","x-coa-private":!0,security:[{BearerAuth:[]}],tags:["Environments"],responses:{"204":{description:"The environment was successfully deleted."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},get:{summary:"Get Environment",description:"Get information about an environment.",operationId:"GetEnvironment","x-eov-operation-handler":"EnvironmentHandlers","x-coa-command":"get",security:[{BearerAuth:[]}],tags:["Environments"],responses:{"200":{$ref:"#/components/responses/EnvironmentResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/environments/{environmentID}/nodes":{summary:"Nodes","x-coa-command-group":"nodes",parameters:[{name:"environmentID",description:"The environment ID.",in:"path",schema:{type:"string"},required:!0},{name:"overrideOrgID",description:"Runs an operation against the specified org. (Super-users only.)","x-coa-private":!0,in:"query",schema:{type:"string"},required:!1}],get:{summary:"List Nodes",description:"Get a collection of nodes for an environment",operationId:"GetNodes","x-eov-operation-handler":"NodeHandlers","x-coa-command":"list",parameters:[{name:"detail",description:"Include the full detail of the nodes.",in:"query",schema:{type:"boolean",default:!1},required:!1},{name:"limit",description:"The maximum number of nodes to return.",in:"query",schema:{type:"integer",minimum:1,maximum:500,default:100},required:!1},{name:"startingFrom",description:"The cursor point for paging the query results.",in:"query",allowReserved:!0,schema:{type:"string"},required:!1},{name:"orderBy",description:"The field to order the results by.",in:"query",schema:{type:"string",enum:["id"],default:"id"},required:!1}],security:[{BearerAuth:[]}],tags:["Nodes"],responses:{"200":{$ref:"#/components/responses/NodesResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/environments/{environmentID}/nodes/{nodeID}":{summary:"Node","x-coa-command-group":"nodes",parameters:[{name:"environmentID",description:"The environment ID.",in:"path",schema:{type:"string"},required:!0},{name:"nodeID",description:"The node ID.",in:"path",schema:{type:"string"},required:!0},{name:"overrideOrgID",description:"Runs an operation against the specified org. (Super-users only.)","x-coa-private":!0,in:"query",schema:{type:"string"},required:!1}],get:{summary:"Get Node",description:"Get information about a node in an environment.",operationId:"GetNode","x-eov-operation-handler":"NodeHandlers","x-coa-command":"get",security:[{BearerAuth:[]}],tags:["Nodes"],responses:{"200":{$ref:"#/components/responses/NodeResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/workspaces/{workspaceID}/jobs":{summary:"Jobs","x-coa-command-group":"jobs",parameters:[{name:"workspaceID",description:"The workspace ID.",in:"path",schema:{type:"string"},required:!0}],post:{summary:"Create Job",description:"Create a new job in a workspace.",operationId:"CreateJob","x-eov-operation-handler":"JobHandlers","x-coa-private":!0,security:[{BearerAuth:[]}],tags:["Jobs"],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/JobRequest"}}}},responses:{"201":{$ref:"#/components/responses/JobSummaryResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/workspaces/{workspaceID}/jobs/{jobID}":{summary:"Job","x-coa-private":!0,parameters:[{name:"workspaceID",description:"The workspace ID.",in:"path",schema:{type:"string"},required:!0},{name:"jobID",description:"The job ID.",in:"path",schema:{type:"string"},required:!0}],put:{summary:"Update Job",description:"Update all fields of an existing job in a workspace.",operationId:"UpdateJob","x-eov-operation-handler":"JobHandlers","x-coa-private":!0,security:[{BearerAuth:[]}],tags:["Jobs"],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/JobRequest"}}}},responses:{"204":{description:"Job updated successfully"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},delete:{summary:"Delete Job",description:"Delete a job from a workspace.",operationId:"DeleteJob","x-eov-operation-handler":"JobHandlers","x-coa-private":!0,security:[{BearerAuth:[]}],tags:["Jobs"],responses:{"204":{description:"Job successfully deleted"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/environments/{environmentID}/jobs/{jobID}":{summary:"Job","x-coa-command-group":"jobs",parameters:[{name:"environmentID",description:"The environment ID.",in:"path",schema:{type:"string"},required:!0},{name:"jobID",description:"The job ID.",in:"path",schema:{type:"string"},required:!0}],get:{summary:"Get Job",description:"Get information about a job in an environment.",operationId:"GetJob","x-eov-operation-handler":"JobHandlers","x-coa-command":"get",security:[{BearerAuth:[]}],tags:["Jobs"],responses:{"200":{$ref:"#/components/responses/JobSummaryResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/featureFlags/config":{summary:"Feature Flags Configuration","x-coa-private":!0,get:{summary:"Get Feature Flags Configuration",description:"Gets information the client needs to connect to the feature flags service.",operationId:"GetFeatureFlagsClientConfig","x-eov-operation-handler":"FeatureFlagsHandlers",tags:["FeatureFlags"],security:[],responses:{"200":{$ref:"#/components/responses/FeatureFlagsClientConfigResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/featureFlags/default":{summary:"Default Feature Flags","x-coa-private":!0,get:{summary:"Get Default Feature Flags",description:"Gets default feature flags for the unauthenticated users.",operationId:"GetDefaultFeatureFlags","x-eov-operation-handler":"FeatureFlagsHandlers",tags:["FeatureFlags"],security:[],responses:{"200":{$ref:"#/components/responses/FeatureFlagsResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/featureFlags":{summary:"Feature Flags","x-coa-private":!0,get:{summary:"Get Feature Flags",description:"Gets feature flags for the authenticated user.",operationId:"GetFeatureFlags","x-eov-operation-handler":"FeatureFlagsHandlers",parameters:[{name:"subdomain",description:"The customer subdomain.",in:"query",required:!1,schema:{type:"string"}}],tags:["FeatureFlags"],security:[{BearerAuth:[]},{}],responses:{"200":{$ref:"#/components/responses/FeatureFlagsResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/gitAccounts":{summary:"Git account management","x-coa-private":!1,"x-coa-command-group":"gitAccounts",parameters:[{name:"accountOwner",description:"The owner of the git accounts. If not provided will fallback to the requester's accounts.",in:"query",schema:{type:"string"},required:!1}],get:{summary:"List all org git accounts",description:"Allows for a user to view all the git accounts in their org.",operationId:"ListGitAccounts","x-eov-operation-handler":"GitAccountHandlers","x-coa-command":"list",tags:["GitAccounts"],security:[{BearerAuth:[]}],responses:{"200":{$ref:"#/components/responses/GitAccountsListResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},post:{summary:"Create a git account",description:"Users can create git accounts for their org.",operationId:"CreateGitAccount","x-eov-operation-handler":"GitAccountHandlers","x-coa-command":"create",tags:["GitAccounts"],security:[{BearerAuth:[]}],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/GitAccountCreateRequest"}}}},responses:{"201":{$ref:"#/components/responses/GitAccountResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/gitAccounts/{gitAccountID}":{summary:"Git account management","x-coa-private":!1,"x-coa-command-group":"gitAccounts",parameters:[{name:"gitAccountID",description:"The git account ID.",in:"path",schema:{type:"string"},required:!0},{name:"accountOwner",description:"The owner of the git accounts. If not provided will fallback to the requester's accounts.",in:"query",schema:{type:"string"},required:!1}],get:{summary:"Get a single git account",description:"Allows for a user to get a git account.",operationId:"GetGitAccount","x-eov-operation-handler":"GitAccountHandlers","x-coa-command":"get",tags:["GitAccounts"],security:[{BearerAuth:[]}],responses:{"200":{$ref:"#/components/responses/GitAccountResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},patch:{summary:"Update a single git account",description:"Allows for a user to update their git account.",operationId:"UpdateGitAccount","x-eov-operation-handler":"GitAccountHandlers","x-coa-command":"update",tags:["GitAccounts"],security:[{BearerAuth:[]}],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/GitAccountUpdateRequest"}}}},responses:{"200":{$ref:"#/components/responses/GitAccountResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},delete:{summary:"Delete a single git account",description:"Allows for a user to delete a git account.",operationId:"DeleteGitAccount","x-eov-operation-handler":"GitAccountHandlers","x-coa-command":"delete",tags:["GitAccounts"],security:[{BearerAuth:[]}],responses:{"204":{description:"The git account was successfully deleted."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/workspaces/{workspaceID}/nodes":{summary:"Nodes","x-coa-command-group":"workspace-nodes",parameters:[{name:"workspaceID",description:"The workspace ID.",in:"path",schema:{type:"string"},required:!0},{name:"overrideOrgID",description:"Runs an operation against the specified org. (Super-users only.)","x-coa-private":!0,in:"query",schema:{type:"string"},required:!1}],get:{summary:"List Workspace Nodes",description:"Get a collection of nodes for a workspace.",operationId:"GetWorkspaceNodes","x-eov-operation-handler":"NodeHandlers","x-coa-command":"list",parameters:[{name:"detail",description:"Include the full detail of the nodes.",in:"query",schema:{type:"boolean",default:!1},required:!1},{name:"limit",description:"The maximum number of nodes to return.",in:"query",schema:{type:"integer",minimum:1,maximum:500,default:100},required:!1},{name:"startingFrom",description:"The cursor point for paging the query results.",in:"query",allowReserved:!0,schema:{type:"string"},required:!1},{name:"orderBy",description:"The field to order the results by.",in:"query",schema:{type:"string",enum:["id"],default:"id"},required:!1}],security:[{BearerAuth:[]}],tags:["Nodes"],responses:{"200":{$ref:"#/components/responses/NodesResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},post:{summary:"Create Node",description:"Create a new node in a workspace.",operationId:"CreateNode","x-eov-operation-handler":"NodeHandlers","x-coa-command":"create",parameters:[{name:"workspaceID",description:"The workspace ID.",in:"path",schema:{type:"string"},required:!0},{name:"overrideOrgID",description:"Runs an operation against the specified org. (Super-users only.)","x-coa-private":!0,in:"query",schema:{type:"string"},required:!1}],security:[{BearerAuth:[]}],tags:["Nodes"],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NodeCreateRequest"}}}},responses:{"201":{$ref:"#/components/responses/NodeResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/workspaces/{workspaceID}/nodes/{nodeID}":{summary:"Node","x-coa-command-group":"workspace-nodes",parameters:[{name:"workspaceID",description:"The environment ID.",in:"path",schema:{type:"string"},required:!0},{name:"nodeID",description:"The node ID.",in:"path",schema:{type:"string"},required:!0},{name:"overrideOrgID",description:"Runs an operation against the specified org. (Super-users only.)","x-coa-private":!0,in:"query",schema:{type:"string"},required:!1}],get:{summary:"Get Node",description:"Get information about a node in a workspace.",operationId:"GetWorkspaceNode","x-eov-operation-handler":"NodeHandlers","x-coa-command":"get",security:[{BearerAuth:[]}],tags:["Nodes"],responses:{"200":{$ref:"#/components/responses/NodeResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},put:{summary:"Set Node",description:"Replace all fields of a node in a workspace.",operationId:"SetWorkspaceNode","x-eov-operation-handler":"NodeHandlers","x-coa-command":"put",security:[{BearerAuth:[]}],tags:["Nodes"],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/Node"}}}},responses:{"200":{$ref:"#/components/responses/NodeResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},delete:{summary:"Delete Node",description:"Delete a node in a workspace.",operationId:"DeleteWorkspaceNode","x-eov-operation-handler":"NodeHandlers","x-coa-command":"delete",security:[{BearerAuth:[]}],tags:["Nodes"],responses:{"204":{description:"The node was successfully deleted."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/projects":{summary:"Projects","x-coa-private":!1,"x-coa-command-group":"projects",get:{summary:"Get Projects",description:"Get projects in org.",operationId:"GetProjectsInOrg","x-eov-operation-handler":"ProjectHandlers","x-coa-command":"list",parameters:[{name:"includeWorkspaces",description:"Whether or not to include nested workspace data for all projects.",in:"query",schema:{type:"boolean"},required:!1},{name:"includeJobs",description:"Whether or not to include nested job data for all workspaces in the projects.",in:"query",schema:{type:"boolean"},required:!1}],security:[{BearerAuth:[]}],tags:["Projects"],responses:{"200":{$ref:"#/components/responses/ProjectsResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},post:{summary:"Create Project",description:"Create a new project.",operationId:"CreateProject","x-eov-operation-handler":"ProjectHandlers","x-coa-command":"create",security:[{BearerAuth:[]}],tags:["Projects"],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/ProjectCreateRequest"}}}},responses:{"201":{$ref:"#/components/responses/ProjectResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/projects/{projectID}":{summary:"Projects","x-coa-private":!1,"x-coa-command-group":"projects",parameters:[{name:"projectID",description:"The project ID.",in:"path",schema:{type:"string"},required:!0},{name:"includeWorkspaces",description:"Whether or not to include nested workspace data for all projects.",in:"query",schema:{type:"boolean"},required:!1},{name:"includeJobs",description:"Whether or not to include nested job data for all workspaces in the projects.",in:"query",schema:{type:"boolean"},required:!1}],get:{summary:"Get Project",description:"Get a project.",operationId:"GetProjectInOrg","x-eov-operation-handler":"ProjectHandlers","x-coa-private":!1,"x-coa-command":"get",security:[{BearerAuth:[]}],tags:["Projects"],responses:{"200":{description:"Successful response",content:{"application/json":{schema:{$ref:"#/components/schemas/ProjectResponse"}}}},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},patch:{summary:"Update a project",description:"Update a project",operationId:"UpdateProject","x-eov-operation-handler":"ProjectHandlers","x-coa-private":!1,"x-coa-command":"update",security:[{BearerAuth:[]}],tags:["Projects"],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/ProjectPatchRequest"}}}},responses:{"200":{description:"The project was successfully updated.",content:{"application/json":{schema:{$ref:"#/components/schemas/ProjectResponse"}}}},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},delete:{summary:"Delete Project",description:"Delete a project.",operationId:"DeleteProject","x-eov-operation-handler":"ProjectHandlers","x-coa-command":"delete","x-coa-private":!1,security:[{BearerAuth:[]}],tags:["Projects"],requestBody:{required:!1,content:{"application/json":{schema:{type:["object","null"]}}}},responses:{"204":{description:"The project was successfully deleted."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/projects/{projectID}/gitAccounts":{summary:"Projects Git Accounts","x-coa-private":!1,parameters:[{name:"projectID",description:"The project ID.",in:"path",schema:{type:"string"},required:!0}],get:{summary:"List Project Git Accounts",description:"List git accounts for a project",operationId:"ListProjectGitAccounts","x-eov-operation-handler":"ProjectGitAccountHandlers","x-coa-private":!1,security:[{BearerAuth:[]}],tags:["Projects","Git Accounts"],responses:{"200":{description:"Successful response",content:{"application/json":{schema:{$ref:"#/components/schemas/ProjectGitAccountsResponse"}}}},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/projects/{projectID}/gitAccounts/{userID}":{summary:"Projects Git Accounts","x-coa-private":!1,parameters:[{name:"projectID",description:"The project ID.",in:"path",schema:{type:"string"},required:!0},{name:"userID",description:"The user ID.",in:"path",schema:{type:"string"},required:!0}],get:{summary:"Get Project Git Account",description:"Get a user's git account for a project",operationId:"GetProjectGitAccount","x-eov-operation-handler":"ProjectGitAccountHandlers","x-coa-private":!1,security:[{BearerAuth:[]}],tags:["Projects","Git Accounts"],responses:{"200":{description:"Successful response",content:{"application/json":{schema:{$ref:"#/components/schemas/ProjectGitAccountResponse"}}}},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},put:{summary:"Set Project Git Account",description:"Set a user's git account for a project",operationId:"SetProjectGitAccount","x-eov-operation-handler":"ProjectGitAccountHandlers","x-coa-private":!1,security:[{BearerAuth:[]}],tags:["Projects","Git Accounts"],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/ProjectGitAccountSetRequest"}}}},responses:{"204":{description:"The user's git account for the project was set successfully."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},delete:{summary:"Remove Project Git Account",description:"Un-set a user's git account for a project",operationId:"DeleteProjectGitAccount","x-eov-operation-handler":"ProjectGitAccountHandlers","x-coa-private":!1,security:[{BearerAuth:[]}],tags:["Projects","Git Accounts"],responses:{"204":{description:"The user's git account for the project was deleted successfully."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/integrations/fivetran/projects":{summary:"Fivetran Projects","x-coa-private":!0,get:{summary:"Get Fivetran Projects",description:"Get fivetran projects in org.",operationId:"GetFivetranProjects","x-eov-operation-handler":"FivetranHandlers",security:[{BearerAuth:[]}],tags:["FivetranIntegration"],responses:{"200":{$ref:"#/components/responses/FivetranProjectsResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/integrations/fivetran/projects/{projectId}":{"x-coa-private":!0,get:{summary:"Gets a single Fivetran project.",operationId:"GetFivetranProject","x-eov-operation-handler":"FivetranHandlers",tags:["FivetranIntegration"],parameters:[{name:"projectId",in:"path",description:"The unique identifier for the project",required:!0,schema:{type:"string"}}],responses:{"200":{description:"Successful response",content:{"application/json":{schema:{$ref:"#/components/schemas/FivetranProjectResponse"}}}},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/integrations/fivetran/projects/{projectId}/jobs":{summary:"Fivetran Jobs","x-coa-private":!0,get:{summary:"Get Fivetran jobs",description:"Get Fivetran jobs.",operationId:"GetFivetranJobs","x-eov-operation-handler":"FivetranHandlers",parameters:[{name:"projectId",in:"path",description:"The unique identifier for the project",required:!0,schema:{type:"string"}}],security:[{BearerAuth:[]}],tags:["FivetranIntegration"],responses:{"200":{$ref:"#/components/responses/FivetranJobsResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/integrations/fivetran/jobs/{jobId}/history/{historyId}":{summary:"Fivetran Job History","x-coa-private":!0,get:{parameters:[{name:"jobId",description:"The Fivetran job ID.",in:"path",schema:{type:"string"},required:!0},{name:"historyId",description:"The Fivetran history ID.",in:"path",schema:{type:"string"},required:!0}],summary:"Get Fivetran Job History",description:"Get Fivetran job history in org.",operationId:"GetFivetranJobHistory","x-eov-operation-handler":"FivetranHandlers",security:[{BearerAuth:[]}],tags:["FivetranIntegration"],responses:{"200":{$ref:"#/components/responses/FivetranJobHistoryResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/integrations/fivetran/jobs/{jobId}/run":{summary:"Start a refresh job via Fivetran","x-coa-private":!0,post:{parameters:[{name:"jobId",description:"The Fivetran job ID.",in:"path",schema:{type:"string"},required:!0}],requestBody:{description:"Request body for start Fivetran run.",required:!0,content:{"application/json":{schema:{type:"object",required:["cause"],properties:{cause:{$ref:"#/components/schemas/FivetranJobRunCause"}}}}}},summary:"Start a refresh job via Fivetran",operationId:"PostFivetranJobRefresh","x-eov-operation-handler":"FivetranHandlers",security:[{BearerAuth:[]}],tags:["FivetranIntegration"],responses:{"201":{$ref:"#/components/responses/FivetranRefreshJobResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/userRoles":{summary:"User Roles","x-coa-private":!0,get:{summary:"List User Roles",description:"Get all user roles in the organization, filtered by information available based on the current user's roles and sorted alphabetically by last name, then by first name.",operationId:"GetUserRoles","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],parameters:[{name:"excludeOrgRoles",description:"Exclude organization level roles from the results.",in:"query",schema:{type:"boolean"}},{name:"projectID",description:"Return only user roles pertaining to the specified project.",in:"query",schema:{type:"string"},required:!1},{name:"environmentID",description:"Return only user roles pertaining to the specified environment.",in:"query",schema:{type:"string"},required:!1}],responses:{"200":{$ref:"#/components/responses/UserRolesResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/userRoles/{userID}/organizationRoles":{summary:"Organization User Roles","x-coa-private":!0,parameters:[{name:"userID",description:"The user ID.",in:"path",schema:{type:"string"},required:!0}],put:{summary:"Create/Update User Organization Roles",description:"Creates or updates all of a user's organization roles. Only org admins may use this API.",operationId:"UpsertUserOrganizationRoles","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],requestBody:{description:"The user's organization roles.",required:!0,content:{"application/json":{schema:{type:"array",items:{type:"string"}}}}},responses:{"200":{$ref:"#/components/responses/UserRoleResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/userRoles/{userID}/projects/{projectID}/environments/{environmentID}":{summary:"Environment User Roles","x-coa-private":!0,parameters:[{name:"userID",description:"The user ID.",in:"path",schema:{type:"string"},required:!0},{name:"projectID",description:"The project ID.",in:"path",schema:{type:"string"},required:!0},{name:"environmentID",description:"The environment ID.",in:"path",schema:{type:"string"},required:!0}],delete:{summary:"Delete Environment User Roles",description:"Deletes all of a user's environment roles.",operationId:"DeleteUserEnvironmentRoles","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],responses:{"204":{description:"The user's environment roles were successfully deleted."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},put:{summary:"Create/Update Environment User Roles",description:"Creates or updates all of a user's environment roles.",operationId:"UpsertUserEnvironmentRoles","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],requestBody:{description:"The user environment roles.",required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/EnvironmentRoles"}}}},responses:{"200":{$ref:"#/components/responses/UserEnvironmentRoleResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/userRoles/{userID}/projects/{projectID}":{summary:"Project User Roles","x-coa-private":!0,parameters:[{name:"userID",description:"The user ID.",in:"path",schema:{type:"string"},required:!0},{name:"projectID",description:"The project ID.",in:"path",schema:{type:"string"},required:!0}],delete:{summary:"Delete Project User Roles",description:"Deletes all of a user's project roles. Only org and project admins may user this API.",operationId:"DeleteUserProjectRoles","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],responses:{"204":{description:"The user's project roles were successfully deleted."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},put:{summary:"Create/Update Project User Roles",description:"Creates or updates all of a user's project roles. Only org and project admins may user this API.",operationId:"UpsertUserProjectRoles","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],requestBody:{description:"The user project roles.",required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/ProjectRoles"}}}},responses:{"200":{$ref:"#/components/responses/UserProjectRoleResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v2/userRoles":{summary:"User Roles",get:{summary:"List User Roles",description:"Get all user roles in the organization, filtered by information available based on the current user's roles",operationId:"GetUserRolesV2","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],parameters:[{name:"projectID",description:"Return only user roles pertaining to the specified project.",in:"query",schema:{type:"string"},required:!1},{name:"environmentID",description:"Return only user roles pertaining to the specified environment.",in:"query",schema:{type:"string"},required:!1}],responses:{"200":{$ref:"#/components/responses/UserRoleResponseV2"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v2/userRoles/{userID}":{summary:"Single User roles",parameters:[{name:"userID",description:"The user ID.",in:"path",schema:{type:"string"},required:!0},{name:"projectID",description:"The project ID.",in:"query",schema:{type:"string"},required:!1},{name:"environmentID",description:"The environment ID.",in:"query",schema:{type:"string"},required:!1}],get:{summary:"Get Single User Roles",description:"Get a single user's roles.",operationId:"GetSingleUserRolesV2","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],responses:{"200":{$ref:"#/components/responses/SingleUserRoleResponseV2"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v2/userRoles/{userID}/organizationRole":{summary:"Organization User Roles",parameters:[{name:"userID",description:"The user ID.",in:"path",schema:{type:"string"},required:!0}],put:{summary:"Create/Update User Organization Role",description:"Creates or updates a user's organization role. Only org admins may use this API.",operationId:"UpsertUserOrganizationRoleV2","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],requestBody:{description:"The user's organization role.",required:!0,content:{"application/json":{schema:{type:"object",properties:{organizationRole:{type:"string"}},required:["organizationRole"]}}}},responses:{"200":{$ref:"#/components/responses/SingleUserRoleResponseV2"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v2/userRoles/{userID}/projects/{projectID}":{summary:"Project User Roles",parameters:[{name:"userID",description:"The user ID.",in:"path",schema:{type:"string"},required:!0},{name:"projectID",description:"The project ID.",in:"path",schema:{type:"string"},required:!0}],delete:{summary:"Delete Project User Roles",description:"Deletes all of a user's project roles. Only org and project admins may user this API.",operationId:"DeleteUserProjectRoleV2","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],responses:{"204":{description:"The user's project roles were successfully deleted."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},put:{summary:"Create/Update Project User Role",description:"Creates or updates a user's project role. Only org and project admins may user this API.",operationId:"UpsertUserProjectRoleV2","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],requestBody:{description:"The user project role",required:!0,content:{"application/json":{schema:{type:"object",properties:{projectRole:{type:"string"}},required:["projectRole"]}}}},responses:{"200":{$ref:"#/components/responses/SingleUserRoleResponseV2"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v2/userRoles/{userID}/environments/{environmentID}":{summary:"Environment User Roles",parameters:[{name:"userID",description:"The user ID.",in:"path",schema:{type:"string"},required:!0},{name:"environmentID",description:"The environment ID.",in:"path",schema:{type:"string"},required:!0}],delete:{summary:"Delete Environment User Roles",description:"Deletes all of a user's environment roles.",operationId:"DeleteUserEnvironmentRoleV2","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],responses:{"204":{description:"The user's environment role was successfully deleted."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},put:{summary:"Create/Update Environment User Roles",description:"Creates or updates a user's environment role.",operationId:"UpsertUserEnvironmentRoleV2","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],requestBody:{description:"The user environment role.",required:!0,content:{"application/json":{schema:{type:"object",properties:{environmentRole:{description:"The environment role to set",type:"string"},setDefaultProjectRole:{description:`If set, if the user has no role for the environment's project, it will be set to this role. If this
10375
+ `,type:"object",additionalProperties:{type:"string"}}},required:["userID"]},FivetranProject:{type:"object",properties:{id:{type:"string"},name:{type:"string"},createdAtUtc:{type:"string",format:"date-time"},updatedAtUtc:{type:"string",format:"date-time"},extras:{type:"object",description:"Additional data, if applicable"}},required:["id","name","createdAtUtc","updatedAtUtc"]},FivetranJob:{type:"object",properties:{id:{type:"string"},projectId:{type:"string"},name:{type:"string"},createdAtUtc:{type:"string",format:"date-time"},updatedAtUtc:{type:"string",format:"date-time"},extras:{type:"object",description:"Additional data, if applicable"}}},FivetranJobHistory:{type:"object",properties:{id:{type:"string"},jobId:{type:"string"},status:{$ref:"#/components/schemas/FivetranJobStatus"},startedAtUtc:{type:"string",format:"date-time",nullable:!0},endedAtUtc:{type:"string",format:"date-time",nullable:!0},logs:{type:"array",items:{type:"string"}},extras:{type:"object",description:"Additional data, if applicable"}}},FivetranJobStatus:{type:"string",description:"Possible statuses of jobs",enum:["SCHEDULING","RUNNING","SUCCEEDED","TERMINATING","FAILED"]},FivetranJobRunCause:{type:"string",description:"Possible run cause",enum:["Triggered by Fivetran"]},JobName:{type:"string",minLength:1,maxLength:100,description:"Name of the job"},JobRequest:{"x-coa-private":!0,type:"object",additionalProperties:!1,description:"Request body for creating or updating a job",properties:{name:{$ref:"#/components/schemas/JobName"},includeSelector:{type:"string",description:"A selector string of nodes to include"},excludeSelector:{type:"string",description:"A selector string of nodes to exclude"}},required:["name","includeSelector","excludeSelector"]},Job:{type:"object",description:"A Coalesce job.",additionalProperties:!0,properties:{id:{type:"string",description:"The Job ID."},name:{type:"string",description:"The Job name."},includeSelector:{type:"string",description:"A selector string of nodes to include."},excludeSelector:{type:"string",description:"A selector string of nodes to exclude."},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"}},required:["id","name","includeSelector","excludeSelector","createdAt","updatedAt"]},BaseGitAccount:{type:"object",description:"The core fields for a git account",properties:{gitAccountName:{type:"string"},gitAuthorEmail:{type:"string"},gitAuthorName:{type:"string"},gitUsername:{type:"string"}}},GitAccountCreateRequest:{description:"All the fields needed to create a git account",allOf:[{$ref:"#/components/schemas/GitAccountRequest"}],required:["gitAccountName","gitAuthorEmail","gitAuthorName","gitUsername","gitToken"]},GitAccountUpdateRequest:{description:"All the fields needed to update a git account",$ref:"#/components/schemas/GitAccountRequest"},GitAccountResponse:{description:"All the fields needed to create a git account",allOf:[{$ref:"#/components/schemas/BaseGitAccount"},{type:"object",properties:{id:{type:"string"},createdAt:{type:"string",format:"date-time"},createdBy:{$ref:"#/components/schemas/UserSummary"},updatedAt:{type:"string",format:"date-time"},updatedBy:{$ref:"#/components/schemas/UserSummary"},accountOwner:{$ref:"#/components/schemas/UserSummary"}},required:["id","gitAccountName","gitAuthorEmail","gitAuthorName","gitUsername"]}]},GitAccountsListResponse:{description:"A list of git accounts",type:"array",items:{$ref:"#/components/schemas/GitAccountResponse"}},GitAccountRequest:{allOf:[{$ref:"#/components/schemas/BaseGitAccount"},{type:"object",properties:{gitToken:{type:"string"}}}]},RegistryPackageReleaseResult:{description:"A single release of a package in the registry.",type:"object",properties:{createdAt:{type:"string",format:"date-time"},createdBy:{type:"string"},updatedBy:{type:"string"},updatedAt:{type:"string",format:"date-time"},version:{type:"string"},changeLog:{type:"string"},releaseID:{type:"string"},storagePath:{type:"string"},privacy:{type:"string",enum:["public","private","unlisted"]}},required:["createdAt","updatedAt","version","changeLog","releaseID","storagePath","privacy"]},RegistryPackageResult:{description:"A single package in the registry.",type:"object",properties:{updatedBy:{type:"string"},updatedAt:{type:"string",format:"date-time"},name:{type:"string"},publisherID:{type:"string"},description:{type:"string"},org:{type:"string"},latestRelease:{type:"string"},overview:{type:"string"},featured:{type:"boolean"},tags:{type:"array",minItems:0,items:{type:"string"}},certified:{type:"boolean"},packageID:{type:"string"},id:{type:"string"},platformKind:{type:"string",enum:["fabric","snowflake","databricks","bigquery"]}},required:["name","description","org","latestRelease","overview","tags","featured","certified","publisherID","packageID","id","platformKind"]},NodeDescription:{type:"object",description:"An object containing node description",properties:{description:{type:"string",description:"AI generated description of the node.",minLength:1}},required:["description"]},NodeDescriptionRequest:{type:"object",properties:{workspaceID:{type:"number",description:"The workspace ID."},nodeID:{type:"string",description:"The node ID.",minLength:1}},required:["workspaceID","nodeID"]},CreatePlanRequest:{type:"object",required:["parameters","runDetails","userCredentials"],properties:{parameters:{type:"object"},runDetails:{type:"object",required:["currentWorkspaceDataFilePath","desiredWorkspaceDataFilePath","disablePresync","environmentID","planID"],properties:{currentWorkspaceDataFilePath:{type:"string"},desiredWorkspaceDataFilePath:{type:"string"},disablePresync:{type:"boolean"},environmentID:{type:"string"},planID:{type:"string"},skippedBeforeCollection:{type:"boolean",default:!1},useRenderCache:{type:"boolean",default:!1}}},userCredentials:{type:"object"}}},PlanRequestAcceptedResponse:{type:"object",required:["message","planID"],properties:{message:{type:"string"},planID:{type:"string"}}},PlanResponse:{type:"object",required:["planStorageFilePath"],properties:{planStorageFilePath:{type:"string"}}},InFlightPlanResponse:{type:"object",required:["status"],properties:{status:{type:"string",enum:["planning"]}}},GitCommitMessageRequest:{type:"object",properties:{files:{type:"array",items:{type:"object",properties:{path:{type:"string",description:"File path relative to repository root"},before:{type:"string",description:"File content before changes"},after:{type:"string",description:"File content after changes"}},required:["path","before","after"]},description:"Array of files being committed with their before/after content",minItems:1}},required:["files"]},GitCommitMessageResponse:{type:"object",properties:{message:{type:"string",description:"AI generated git commit message (Soft max 200 chars, Hard max 400 chars)",maxLength:400}},required:["message"]},WriteInfo:{type:"object",required:["entityType","writeType","data"],properties:{entityType:{anyOf:[{type:"string",enum:["node","workspace","run","subgraph","job","macro","nodeType","installedPackage"]}]},writeType:{anyOf:[{type:"string",enum:["save","delete","merge"]}]},data:{type:"object",required:["id","version"],properties:{id:{anyOf:[{type:"string"},{type:"number"}]},version:{anyOf:[{type:"string"},{type:"number"}]}}}}},ChatRequest:{type:"object",required:["messages","threadId"],properties:{messages:{type:"array",description:"An array of message objects representing the conversation history.",items:{type:"object",required:["role","content"],properties:{role:{type:"string",enum:["user","assistant"],description:"The role of the message sender."},content:{type:"string",description:"The text content of the message."}}}},systemPrompt:{type:"string",description:"Optional system prompt"},responseSchema:{type:"object",description:"Optional schema for structuring the response format"},threadId:{type:"string",description:"Identifier for the conversation thread"}}},ChatResponse:{type:"object",required:["text"],properties:{text:{type:"string",description:"AI-generated response text"},usage:{type:"object",properties:{inputUsage:{type:"number"},outputUsage:{type:"number"},unit:{type:"string",enum:["token","char"]}}}}},LlmRequest:{type:"object",required:["model","messages"],properties:{model:{type:"string",description:"The model to use for the LLM call"},messages:{type:"array",description:"The messages to send to the LLM"},schema:{type:"object",description:"The schema to use for structured output",additionalProperties:!0},tools:{type:"object",description:"The tools to use for the LLM call",additionalProperties:!0},toolChoice:{description:"Controls which tools the model can use",oneOf:[{type:"string",enum:["auto","required","none"]},{type:"object",required:["type","toolName"],properties:{type:{type:"string",enum:["tool"]},toolName:{type:"string"}}}]}}},LlmResponse:{type:"object",description:"The response from the LLM call",additionalProperties:!0},SubgraphName:{type:"string",minLength:1,maxLength:100,description:"Name of the subgraph"},SubgraphRequest:{"x-coa-private":!0,type:"object",additionalProperties:!1,description:"Request body for creating or updating a subgraph",properties:{name:{$ref:"#/components/schemas/SubgraphName"},steps:{type:"array",description:"Array of node IDs in the subgraph",items:{type:"string",maxLength:64}}},required:["name","steps"]},Subgraph:{"x-coa-private":!0,type:"object",additionalProperties:!1,description:"A partial collection of nodes from the node graph, allowing easier viewing and editing of a portion of a large graph.",properties:{id:{type:"string",description:"Unique identifier for the subgraph"},name:{$ref:"#/components/schemas/SubgraphName"},steps:{type:"array",description:"Array of node IDs in the subgraph",items:{type:"string",maxLength:64}},version:{type:"integer",enum:[1],default:1,description:"Version of the subgraph schema"},createdAt:{type:"string",format:"date-time",description:"Date and time the subgraph was created"},updatedAt:{type:"string",format:"date-time",description:"Date and time the subgraph was last updated"},createdBy:{type:"string",description:"ID of the user who created the subgraph"},updatedBy:{type:"string",description:"ID of the user who last updated the subgraph"}},required:["id","name","steps","version"]},DatabricksWarehouse:{type:"object",description:"A minimal Databricks SQL warehouse configuration returned from GetDatabricksWarehouse.",properties:{id:{type:"string",description:"The unique identifier of the warehouse"},name:{type:"string",description:"The name of the warehouse"},odbc_params:{type:"object",description:"The connection parameters for the warehouse",properties:{path:{type:"string",description:"The path for the SQL warehouse"}},required:["path"]}},required:["id","name","odbc_params"]},DatabricksWarehouseResponse:{type:"object",description:"Response containing a list of Databricks SQL warehouses.",properties:{warehouses:{type:"array",items:{$ref:"#/components/schemas/DatabricksWarehouse"}}},required:["warehouses"]},BigQueryProject:{type:"object",description:"A minimal BigQuery project entry.",properties:{id:{type:"string",description:"The project ID"},name:{type:"string",description:"The project friendly name"}},required:["id"]},BigQueryProjectsResponse:{type:"object",description:"Response containing a list of BigQuery projects.",properties:{projects:{type:"array",items:{$ref:"#/components/schemas/BigQueryProject"}}},required:["projects"]},BigQueryDatasetsResponse:{type:"array",description:"A list of BigQuery dataset (schema) names.",items:{type:"string"}},BaseWorkspaceEnv:{type:"object",description:"A workspace is a collection of resources that are used to develop, test, and deploy code.",additionalProperties:!0,properties:{connectionAccount:{type:"string",description:"The Snowflake account name."},defaultStorageMapping:{type:"string",nullable:!0},description:{type:"string",description:"The Workspace description."},name:{type:"string",description:"The Workspace name."},oauthEnabled:{type:"boolean",description:"If Snowflake OAuth is enabled."},tagColors:{$ref:"#/components/schemas/TagColor"},project:{type:"string",description:"The Project ID."},createdAt:{type:"string",format:"date-time"},createdBy:{$ref:"#/components/schemas/UserSummary"},updatedAt:{type:"string",format:"date-time"},currentGitBranch:{type:"string",description:"The branch most recently run on this environment."},currentGitCommit:{type:"string"},currentGitURL:{type:"string"},currentlyRunningJobs:{description:"An array of any running Jobs. If there are not Jobs running, this will return empty.",type:"array",items:{type:"integer"}},id:{type:"string"},deployedCommit:{type:"string",description:"The most recently deployed commit ID."},status:{$ref:"#/components/schemas/WorkspaceEnvHealth"},platformKind:{$ref:"#/components/schemas/Common.schema1"}},required:["createdAt","updatedAt","id","name","oauthEnabled","project","status"]},Workspace:{allOf:[{$ref:"#/components/schemas/BaseWorkspaceEnv"},{type:"object",additionalProperties:!0,properties:{mappingsV1:{type:"string"},runTimeParameters:{type:"string"},jobs:{type:"array",items:{$ref:"#/components/schemas/Job"}}}}]},WorkspaceSummary:{type:"object",description:"A set of minimal workspace data.",additionalProperties:!0,properties:{id:{type:"string"},name:{type:"string"},project:{type:"string",description:"The Project ID."},status:{$ref:"#/components/schemas/WorkspaceEnvHealth"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},jobs:{type:"array",items:{$ref:"#/components/schemas/Job"}}},required:["createdAt","createdBy","updatedAt","id","name","status","project"]},WorkspaceEnvHealth:{type:"string",enum:["Deleting","Deploying","Failed Deploy","Failed Refresh","Initializing","Refreshing","Waiting"]},TagColor:{type:"object",description:"The tag color from the Environment settings.",additionalProperties:!1,properties:{backgroundColor:{type:"string"},textColor:{type:"string"}}},SourceColumnMetadata:{type:"object",additionalProperties:!1,properties:{columns:{items:{$ref:"#/components/schemas/ColumnMetadata"},type:"array"},join:{description:"The join condition of the source node.",type:"object",additionalProperties:!1,properties:{joinCondition:{type:"string",description:"Returns SQL from the Join tab."}},required:["joinCondition"]},sourceMapping:{type:"array",items:{$ref:"#/components/schemas/SourceMap"}}},required:["columns"]},SourceNode:{type:"object",description:"A source node returned by the API.",allOf:[{$ref:"#/components/schemas/BaseNode"},{type:"object",properties:{metadata:{$ref:"#/components/schemas/SourceColumnMetadata"},table:{description:"The table name of the source node.",type:"string"}},required:["metadata","table"]}]},MaterializationType:{anyOf:[{type:"string",enum:["table","view"]},{type:"string"}]},NodeTest:{type:"object",additionalProperties:!1,properties:{continueOnFailure:{type:"boolean"},description:{type:"string"},name:{type:"string"},runOrder:{$ref:"#/components/schemas/TestRunOrder"},templateString:{type:"string"}},required:["continueOnFailure","description","name","runOrder","templateString"]},SQLNode:{type:"object",description:"A SQL node returned by the API.",allOf:[{$ref:"#/components/schemas/BaseNode"},{type:"object",properties:{config:{$ref:"#/components/schemas/UserConfig"},isMultisource:{type:"boolean"},materializationType:{$ref:"#/components/schemas/MaterializationType"},metadata:{$ref:"#/components/schemas/SQLNodeMetadata"},overrideSQL:{type:"boolean"}},required:["config","isMultisource","materializationType","metadata","overrideSQL"]}]},SQLNodeMetadata:{type:"object",additionalProperties:!1,properties:{appliedNodeTests:{default:[],items:{$ref:"#/components/schemas/NodeTest"},type:"array"},columns:{default:[],items:{$ref:"#/components/schemas/ColumnMetadata"},type:"array"},cteString:{type:"string"},description:{type:"string"},destinationName:{type:"string"},enabledColumnTestIDs:{type:"array",items:{type:"string"}},mapping:{type:"object",additionalProperties:{anyOf:[{type:"object"},{type:"string"},{type:"number"},{type:"boolean"}]}},materializationOption:{type:"string"},sourceMapping:{type:"array",items:{$ref:"#/components/schemas/SourceMap"}}},required:["appliedNodeTests","columns","enabledColumnTestIDs","sourceMapping"]},TestRunOrder:{type:"string",enum:["After","Before"]},UserConfig:{type:"object",additionalProperties:{anyOf:[{type:"object"},{type:"string"},{type:"number"},{type:"boolean"}]}}},responses:{AllUsersResult:{description:"The list of users",content:{"application/json":{schema:{type:"object",properties:{total:{type:"integer",description:"The size of the result set."},startingFrom:{type:"string",description:"The cursor value used in the request."},limit:{type:"integer",description:"The requested page size."},next:{type:["string","null"],description:"The field value representing the start of the next page of results."},data:{type:"array",items:{type:"object",properties:{firstName:{type:"string"},lastName:{type:"string"},email:{type:"string"},id:{type:"string"},authDisabled:{type:"boolean"},deleted:{type:"boolean"}}}}},required:["total","limit","next","data"]}}}},CoaTagResponse:{description:"The coa image tag being used.","x-coa-private":!0,content:{"application/json":{schema:{type:"string"}}}},CoaTagReportResponse:{description:"A report of what coa image tags are being used for what orgs.","x-coa-private":!0,content:{"application/json":{schema:{type:"object",required:["defaultTag","deviatingOrgs"],properties:{defaultTag:{type:"string"},deviatingOrgs:{type:"array",items:{type:"object",required:["orgID","orgName","tag","image"],properties:{orgID:{type:"string"},orgName:{type:"string"},tag:{type:"string"},image:{type:"string"}}}}}}}}},CustomTokenResponse:{description:"The Coalesce custom token response","x-coa-private":!0,content:{"application/json":{schema:{type:"object",required:["customToken"],properties:{customToken:{description:"A Coalesce token",type:"string"}}}}}},EnvironmentResponse:{description:"Information about an environment.",content:{"application/json":{schema:{$ref:"#/components/schemas/Environment"}}}},EnvironmentsResponse:{description:"A collection of environment information.",content:{"application/json":{schema:{$ref:"#/components/schemas/EnvironmentsResponse"}}}},JobSummaryResponse:{description:"Information about a job.",content:{"application/json":{schema:{$ref:"#/components/schemas/Job"}}}},ProjectsResponse:{description:"A collection of project information.",content:{"application/json":{schema:{$ref:"#/components/schemas/ProjectsResponse"}}}},FeatureFlagsClientConfigResponse:{description:"Information used by the client to connect to feature flags service.","x-coa-private":!0,content:{"application/json":{schema:{$ref:"#/components/schemas/FeatureFlagsClientConfig"}}}},FeatureFlagsResponse:{description:"Feature flags.","x-coa-private":!0,content:{"application/json":{schema:{$ref:"#/components/schemas/FeatureFlagsValues"}}}},FivetranProjectsResponse:{description:"A collection of project information.",content:{"application/json":{schema:{$ref:"#/components/schemas/FivetranProjectsResponse"}}}},FivetranJobsResponse:{description:"A collection of Fivetran job information.",content:{"application/json":{schema:{$ref:"#/components/schemas/FivetranJobsResponse"}}}},FivetranJobHistoryResponse:{description:"Fivetran job history data.",content:{"application/json":{schema:{$ref:"#/components/schemas/FivetranJobHistoryResponse"}}}},FivetranRefreshJobResponse:{description:"The Fivetran start job refresh response.",content:{"application/json":{schema:{type:"object",required:["data"],properties:{data:{description:"Fivetran job history for the new run.",$ref:"#/components/schemas/FivetranJobHistory"}}}}}},GitAccountsListResponse:{description:"A list of git accounts for an org.",content:{"application/json":{schema:{type:"object",required:["data"],properties:{data:{$ref:"#/components/schemas/GitAccountsListResponse"}}}}}},GitAccountResponse:{description:"A list of git accounts for an org.",content:{"application/json":{schema:{type:"object",required:["data"],properties:{data:{$ref:"#/components/schemas/GitAccountResponse"}}}}}},NodeResponse:{description:"A node for an environment.",content:{"application/json":{schema:{$ref:"#/components/schemas/Node"}}}},NodesResponse:{description:"A collection of nodes for an environment.",content:{"application/json":{schema:{$ref:"#/components/schemas/NodesResponse"}}}},PackageResponse:{description:"A package registration","x-coa-private":!0,content:{"application/json":{schema:{type:"object",required:["releaseID","packageID","storePath","publisherID"],properties:{releaseID:{type:"string",minLength:1},publisherID:{type:"string"},packageID:{type:"string",minLength:1},storePath:{type:"string"}}}}}},PackageResponseV2:{description:"A package","x-coa-private":!0,content:{"application/json":{schema:{type:"object",required:["org","packageID","name","description","overview","tags","featured","certified","platformKind"],properties:{org:{type:"string"},name:{type:"string"},description:{type:"string"},overview:{type:"string"},tags:{type:"array",minItems:0,items:{type:"string"}},featured:{type:"boolean"},certified:{type:"boolean"},packageID:{type:"string"},id:{type:"string"},publisherID:{type:"string"},latestRelease:{type:"string"},platformKind:{$ref:"#/components/schemas/PlatformKind"}}}}}},PackageUpdateResponse:{description:"Successful package update","x-coa-private":!0,content:{"application/json":{schema:{type:"string"}}}},AllRegistryPackagesResult:{description:"A list of all packages in the registry.",content:{"application/json":{schema:{type:"array",minItems:0,items:{$ref:"#/components/schemas/RegistryPackageResult"}}}}},AllRegistryPackageReleasesResult:{description:"A list of all releases for a single package in the registry.",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/RegistryPackageReleaseResult"}}}}},RegistryPackageResult:{description:"A single package in the registry.",content:{"application/json":{schema:{$ref:"#/components/schemas/RegistryPackageResult"}}}},RegistryPackageReleaseResult:{description:"A single release for a single package in the registry.",content:{"application/json":{schema:{$ref:"#/components/schemas/RegistryPackageReleaseResult"}}}},ProjectResponse:{description:"Information about a project.",content:{"application/json":{schema:{$ref:"#/components/schemas/Project"}}}},RunResultsResponse:{description:"A collection of results for a deploy or refresh run.",content:{"application/json":{schema:{$ref:"#/components/schemas/RunResultsResponse"}}}},StoredRunResultsResponse:{description:"Raw run results from external storage.",content:{"application/json":{schema:{$ref:"#/components/schemas/StoredRunResultsResponse"}}}},RunResponse:{description:"A single run.",content:{"application/json":{schema:{$ref:"#/components/schemas/RunInfo"}}}},RunsResponse:{description:"A collection of runs.",content:{"application/json":{schema:{$ref:"#/components/schemas/RunsResponse"}}}},DatabaseInfoResponse:{description:"Information required to connect to the Coalesce database.",content:{"application/json":{schema:{$ref:"#/components/schemas/DatabaseInfo"}}}},secretExists:{"x-coa-private":!0,description:"Specifies whether or not a value for the secret exists.",content:{"application/json":{schema:{type:"boolean"}}}},ValidHostname:{"x-coa-private":!0,description:"A whitelisted version of the passed hostname.",content:{"application/json":{schema:{type:"string"}}}},TypesenseConfigurationResponse:{"x-coa-private":!0,description:"The typesense configuration data for a given org.",content:{"application/json":{schema:{$ref:"#/components/schemas/TypesenseConfigResponse"}}}},UserEnvironmentRoleResponse:{description:"A user's environment role information.",content:{"application/json":{schema:{$ref:"#/components/schemas/EnvironmentRoles"}}}},UserEnvironmentRolesResponse:{description:"A collection of user environment role information.",content:{"application/json":{schema:{$ref:"#/components/schemas/UserEnvironmentRolesResponse"}}}},UserProjectRoleResponse:{description:"A user's project role information.",content:{"application/json":{schema:{$ref:"#/components/schemas/ProjectRoles"}}}},UserProjectRolesResponse:{description:"A collection of user project role information.",content:{"application/json":{schema:{$ref:"#/components/schemas/UserProjectRolesResponse"}}}},UserRoleResponse:{description:"A user's role information.",content:{"application/json":{schema:{$ref:"#/components/schemas/OrgRoles"}}}},UserRolesResponse:{description:"A collection of user role information.",content:{"application/json":{schema:{$ref:"#/components/schemas/UserRolesResponse"}}}},SingleUserRoleResponseV2:{description:"A single user's role information",content:{"application/json":{schema:{$ref:"#/components/schemas/SingleUserRoleResponseV2"}}}},UserRoleResponseV2:{description:"A collection of user role information.",content:{"application/json":{schema:{$ref:"#/components/schemas/UserRoleResponseV2"}}}},NodeDescriptionResponse:{description:"The AI generated node description.",content:{"application/json":{schema:{$ref:"#/components/schemas/NodeDescription"}}}},PlanRequestAcceptedResponse:{description:"The request has been accepted for processing, but processing has not been completed.",content:{"application/json":{schema:{$ref:"#/components/schemas/PlanRequestAcceptedResponse"}}}},PlanResponse:{description:"A collection of plan information.",content:{"application/json":{schema:{oneOf:[{$ref:"#/components/schemas/PlanResponse"},{$ref:"#/components/schemas/InFlightPlanResponse"}]}}}},AlreadyExistsError:{description:"The requested resource already exists.",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}},BadGatewayError:{description:"The server received an error from an upstream system.",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}},ForbiddenError:{description:"The client is not permitted to perform the requested operation.",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}},GatewayTimeoutError:{description:"The server did not receive a response in time from an upstream system.",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}},InternalServerError:{description:"The server encountered an unexpected condition that prevented it from fulfilling the request.",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}},InvalidRequestError:{description:"The request was invalid.",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}},NotFoundError:{description:"The requested resource could not be found.",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}},ServiceUnavailableError:{description:"The service is currently unavailable.",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}},Unauthorized:{description:"User lacks authorization to perform this action.",content:{"application/json":{schema:{$ref:"#/components/schemas/ErrorResponse"}}}},GitCommitMessageResponse:{description:"AI generated git commit message",content:{"application/json":{schema:{$ref:"#/components/schemas/GitCommitMessageResponse"}}}}},parameters:{orderByDirection:{name:"orderByDirection",description:"The sort order for query results.",in:"query",schema:{description:"The sort order for query results.",type:"string",enum:["asc","desc"],default:"desc"},required:!1},secretType:{"x-coa-private":!0,description:"The name of the secret type.",name:"secretType",in:"path",schema:{type:"string"},required:!0},context:{description:"Contextual information required to identify a particular secret.",name:"context",in:"path",schema:{type:"string"},required:!0},newSecretType:{"x-coa-private":!0,description:"The name of the secret type to upgrade to.",name:"newSecretType",in:"path",schema:{type:"string"},required:!0},orgId:{"x-coa-private":!0,description:"The Organization ID of the organization that will be affected by the API call.",name:"orgId",in:"path",schema:{type:"string"},required:!0},runId:{"x-coa-private":!0,description:"The Run ID of the run that will be affected by the API call.",name:"runId",in:"path",schema:{type:"integer"},required:!0},coaTag:{"x-coa-private":!0,description:"A coa container image tag in Google Container Registry.",name:"coaTag",in:"path",schema:{type:"string"},required:!0}},securitySchemes:{BearerAuth:{type:"http",scheme:"bearer"}}},paths:{"/api/v1/customToken":{summary:"Custom Token","x-coa-private":!0,post:{summary:"Generate Custom Token",description:"Generate a Coalesce token from the provided OpenID Connect ID token",operationId:"GenerateCustomToken","x-eov-operation-handler":"SSOHandlers",requestBody:{description:"The information from the OpenID Connect authorization server required to sign into Coalesce.",required:!0,content:{"application/json":{schema:{oneOf:[{type:"object",description:"Token information for OpenID connect authorization completed on the client.",required:["type","idToken","accessToken","orgID"],properties:{type:{type:"string",enum:["token"]},idToken:{type:"string"},accessToken:{type:"string"},orgID:{type:"string"}},additionalProperties:!1},{type:"object",description:"Information for completing the authorization code grant on the backend.",required:["type","code","redirectURI","codeVerifier","orgID"],properties:{type:{type:"string",enum:["code"]},code:{type:"string"},redirectURI:{type:"string"},codeVerifier:{type:"string"},orgID:{type:"string"},extraTokenParams:{type:"object"}},additionalProperties:!1}]}}}},security:[],tags:["Authorization"],responses:{"200":{$ref:"#/components/responses/CustomTokenResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/environments":{summary:"Environments","x-coa-command-group":"environments",parameters:[{name:"overrideOrgID",description:"Runs an operation against the specified org. (Super-users only.)","x-coa-private":!0,in:"query",schema:{type:"string"},required:!1}],get:{summary:"List Environments",description:"Get a collection of Environment information.",operationId:"GetEnvironments","x-eov-operation-handler":"EnvironmentHandlers","x-coa-command":"list",parameters:[{name:"detail",description:"Include the full detail of the environments.",in:"query",schema:{type:"boolean",default:!1},required:!1},{name:"limit",description:"The maximum number of environments to return.",in:"query",schema:{type:"integer",minimum:1,maximum:500,default:100},required:!1},{name:"startingFrom",description:"The cursor point for paging the query results.",in:"query",allowReserved:!0,schema:{type:"string"},required:!1},{name:"orderBy",description:"The field to order the results by.",in:"query",schema:{type:"string",enum:["id"],default:"id"},required:!1}],security:[{BearerAuth:[]}],tags:["Environments"],responses:{"200":{$ref:"#/components/responses/EnvironmentsResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},post:{summary:"Create Environment",description:"Create a new environment.",operationId:"CreateEnvironment","x-eov-operation-handler":"EnvironmentHandlers","x-coa-private":!0,security:[{BearerAuth:[]}],tags:["Environments"],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/EnvironmentCreateRequest"}}}},responses:{"201":{$ref:"#/components/responses/EnvironmentResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/environments/{environmentID}":{summary:"Environment","x-coa-command-group":"environments",parameters:[{name:"environmentID",description:"The environment ID.",in:"path",schema:{type:"string"},required:!0},{name:"overrideOrgID",description:"Runs an operation against the specified org. (Super-users only.)","x-coa-private":!0,in:"query",schema:{type:"string"},required:!1}],delete:{summary:"Delete Environment",description:"Delete an environment.",operationId:"DeleteEnvironment","x-eov-operation-handler":"EnvironmentHandlers","x-coa-private":!0,security:[{BearerAuth:[]}],tags:["Environments"],responses:{"204":{description:"The environment was successfully deleted."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},get:{summary:"Get Environment",description:"Get information about an environment.",operationId:"GetEnvironment","x-eov-operation-handler":"EnvironmentHandlers","x-coa-command":"get",security:[{BearerAuth:[]}],tags:["Environments"],responses:{"200":{$ref:"#/components/responses/EnvironmentResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/environments/{environmentID}/nodes":{summary:"Nodes","x-coa-command-group":"nodes",parameters:[{name:"environmentID",description:"The environment ID.",in:"path",schema:{type:"string"},required:!0},{name:"overrideOrgID",description:"Runs an operation against the specified org. (Super-users only.)","x-coa-private":!0,in:"query",schema:{type:"string"},required:!1}],get:{summary:"List Nodes",description:"Get a collection of nodes for an environment",operationId:"GetNodes","x-eov-operation-handler":"NodeHandlers","x-coa-command":"list",parameters:[{name:"detail",description:"Include the full detail of the nodes.",in:"query",schema:{type:"boolean",default:!1},required:!1},{name:"limit",description:"The maximum number of nodes to return.",in:"query",schema:{type:"integer",minimum:1,maximum:500,default:100},required:!1},{name:"startingFrom",description:"The cursor point for paging the query results.",in:"query",allowReserved:!0,schema:{type:"string"},required:!1},{name:"orderBy",description:"The field to order the results by.",in:"query",schema:{type:"string",enum:["id"],default:"id"},required:!1},{name:"skipParsing",description:"Skip parsing column references and updating sources for the nodes.",in:"query",schema:{type:"boolean",default:!1},required:!1}],security:[{BearerAuth:[]}],tags:["Nodes"],responses:{"200":{$ref:"#/components/responses/NodesResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/environments/{environmentID}/nodes/{nodeID}":{summary:"Node","x-coa-command-group":"nodes",parameters:[{name:"environmentID",description:"The environment ID.",in:"path",schema:{type:"string"},required:!0},{name:"nodeID",description:"The node ID.",in:"path",schema:{type:"string"},required:!0},{name:"overrideOrgID",description:"Runs an operation against the specified org. (Super-users only.)","x-coa-private":!0,in:"query",schema:{type:"string"},required:!1}],get:{summary:"Get Node",description:"Get information about a node in an environment.",operationId:"GetNode","x-eov-operation-handler":"NodeHandlers","x-coa-command":"get",parameters:[{name:"skipParsing",description:"Skip parsing column references and updating sources for the nodes.",in:"query",schema:{type:"boolean",default:!1},required:!1}],security:[{BearerAuth:[]}],tags:["Nodes"],responses:{"200":{$ref:"#/components/responses/NodeResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/workspaces/{workspaceID}/jobs":{summary:"Jobs","x-coa-command-group":"jobs",parameters:[{name:"workspaceID",description:"The workspace ID.",in:"path",schema:{type:"string"},required:!0}],post:{summary:"Create Job",description:"Create a new job in a workspace.",operationId:"CreateJob","x-eov-operation-handler":"JobHandlers","x-coa-private":!0,security:[{BearerAuth:[]}],tags:["Jobs"],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/JobRequest"}}}},responses:{"201":{$ref:"#/components/responses/JobSummaryResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/workspaces/{workspaceID}/jobs/{jobID}":{summary:"Job","x-coa-private":!0,parameters:[{name:"workspaceID",description:"The workspace ID.",in:"path",schema:{type:"string"},required:!0},{name:"jobID",description:"The job ID.",in:"path",schema:{type:"string"},required:!0}],put:{summary:"Update Job",description:"Update all fields of an existing job in a workspace.",operationId:"UpdateJob","x-eov-operation-handler":"JobHandlers","x-coa-private":!0,security:[{BearerAuth:[]}],tags:["Jobs"],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/JobRequest"}}}},responses:{"204":{description:"Job updated successfully"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},delete:{summary:"Delete Job",description:"Delete a job from a workspace.",operationId:"DeleteJob","x-eov-operation-handler":"JobHandlers","x-coa-private":!0,security:[{BearerAuth:[]}],tags:["Jobs"],responses:{"204":{description:"Job successfully deleted"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/environments/{environmentID}/jobs/{jobID}":{summary:"Job","x-coa-command-group":"jobs",parameters:[{name:"environmentID",description:"The environment ID.",in:"path",schema:{type:"string"},required:!0},{name:"jobID",description:"The job ID.",in:"path",schema:{type:"string"},required:!0}],get:{summary:"Get Job",description:"Get information about a job in an environment.",operationId:"GetJob","x-eov-operation-handler":"JobHandlers","x-coa-command":"get",security:[{BearerAuth:[]}],tags:["Jobs"],responses:{"200":{$ref:"#/components/responses/JobSummaryResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/featureFlags/config":{summary:"Feature Flags Configuration","x-coa-private":!0,get:{summary:"Get Feature Flags Configuration",description:"Gets information the client needs to connect to the feature flags service.",operationId:"GetFeatureFlagsClientConfig","x-eov-operation-handler":"FeatureFlagsHandlers",tags:["FeatureFlags"],security:[],responses:{"200":{$ref:"#/components/responses/FeatureFlagsClientConfigResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/featureFlags/default":{summary:"Default Feature Flags","x-coa-private":!0,get:{summary:"Get Default Feature Flags",description:"Gets default feature flags for the unauthenticated users.",operationId:"GetDefaultFeatureFlags","x-eov-operation-handler":"FeatureFlagsHandlers",tags:["FeatureFlags"],security:[],responses:{"200":{$ref:"#/components/responses/FeatureFlagsResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/featureFlags":{summary:"Feature Flags","x-coa-private":!0,get:{summary:"Get Feature Flags",description:"Gets feature flags for the authenticated user.",operationId:"GetFeatureFlags","x-eov-operation-handler":"FeatureFlagsHandlers",parameters:[{name:"subdomain",description:"The customer subdomain.",in:"query",required:!1,schema:{type:"string"}}],tags:["FeatureFlags"],security:[{BearerAuth:[]},{}],responses:{"200":{$ref:"#/components/responses/FeatureFlagsResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/gitAccounts":{summary:"Git account management","x-coa-private":!1,"x-coa-command-group":"gitAccounts",parameters:[{name:"accountOwner",description:"The owner of the git accounts. If not provided will fallback to the requester's accounts.",in:"query",schema:{type:"string"},required:!1}],get:{summary:"List all org git accounts",description:"Allows for a user to view all the git accounts in their org.",operationId:"ListGitAccounts","x-eov-operation-handler":"GitAccountHandlers","x-coa-command":"list",tags:["GitAccounts"],security:[{BearerAuth:[]}],responses:{"200":{$ref:"#/components/responses/GitAccountsListResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},post:{summary:"Create a git account",description:"Users can create git accounts for their org.",operationId:"CreateGitAccount","x-eov-operation-handler":"GitAccountHandlers","x-coa-command":"create",tags:["GitAccounts"],security:[{BearerAuth:[]}],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/GitAccountCreateRequest"}}}},responses:{"201":{$ref:"#/components/responses/GitAccountResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/gitAccounts/{gitAccountID}":{summary:"Git account management","x-coa-private":!1,"x-coa-command-group":"gitAccounts",parameters:[{name:"gitAccountID",description:"The git account ID.",in:"path",schema:{type:"string"},required:!0},{name:"accountOwner",description:"The owner of the git accounts. If not provided will fallback to the requester's accounts.",in:"query",schema:{type:"string"},required:!1}],get:{summary:"Get a single git account",description:"Allows for a user to get a git account.",operationId:"GetGitAccount","x-eov-operation-handler":"GitAccountHandlers","x-coa-command":"get",tags:["GitAccounts"],security:[{BearerAuth:[]}],responses:{"200":{$ref:"#/components/responses/GitAccountResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},patch:{summary:"Update a single git account",description:"Allows for a user to update their git account.",operationId:"UpdateGitAccount","x-eov-operation-handler":"GitAccountHandlers","x-coa-command":"update",tags:["GitAccounts"],security:[{BearerAuth:[]}],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/GitAccountUpdateRequest"}}}},responses:{"200":{$ref:"#/components/responses/GitAccountResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},delete:{summary:"Delete a single git account",description:"Allows for a user to delete a git account.",operationId:"DeleteGitAccount","x-eov-operation-handler":"GitAccountHandlers","x-coa-command":"delete",tags:["GitAccounts"],security:[{BearerAuth:[]}],responses:{"204":{description:"The git account was successfully deleted."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/workspaces/{workspaceID}/nodes":{summary:"Nodes","x-coa-command-group":"workspace-nodes",parameters:[{name:"workspaceID",description:"The workspace ID.",in:"path",schema:{type:"string"},required:!0},{name:"overrideOrgID",description:"Runs an operation against the specified org. (Super-users only.)","x-coa-private":!0,in:"query",schema:{type:"string"},required:!1}],get:{summary:"List Workspace Nodes",description:"Get a collection of nodes for a workspace.",operationId:"GetWorkspaceNodes","x-eov-operation-handler":"NodeHandlers","x-coa-command":"list",parameters:[{name:"detail",description:"Include the full detail of the nodes.",in:"query",schema:{type:"boolean",default:!1},required:!1},{name:"limit",description:"The maximum number of nodes to return.",in:"query",schema:{type:"integer",minimum:1,maximum:500,default:100},required:!1},{name:"startingFrom",description:"The cursor point for paging the query results.",in:"query",allowReserved:!0,schema:{type:"string"},required:!1},{name:"orderBy",description:"The field to order the results by.",in:"query",schema:{type:"string",enum:["id"],default:"id"},required:!1},{name:"skipParsing",description:"Skip parsing column references and updating sources for the nodes.",in:"query",schema:{type:"boolean",default:!1},required:!1}],security:[{BearerAuth:[]}],tags:["Nodes"],responses:{"200":{$ref:"#/components/responses/NodesResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},post:{summary:"Create Node",description:"Create a new node in a workspace.",operationId:"CreateNode","x-eov-operation-handler":"NodeHandlers","x-coa-command":"create",parameters:[{name:"workspaceID",description:"The workspace ID.",in:"path",schema:{type:"string"},required:!0},{name:"overrideOrgID",description:"Runs an operation against the specified org. (Super-users only.)","x-coa-private":!0,in:"query",schema:{type:"string"},required:!1}],security:[{BearerAuth:[]}],tags:["Nodes"],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NodeCreateRequest"}}}},responses:{"201":{$ref:"#/components/responses/NodeResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/workspaces/{workspaceID}/nodes/{nodeID}":{summary:"Node","x-coa-command-group":"workspace-nodes",parameters:[{name:"workspaceID",description:"The environment ID.",in:"path",schema:{type:"string"},required:!0},{name:"nodeID",description:"The node ID.",in:"path",schema:{type:"string"},required:!0},{name:"overrideOrgID",description:"Runs an operation against the specified org. (Super-users only.)","x-coa-private":!0,in:"query",schema:{type:"string"},required:!1}],get:{summary:"Get Node",description:"Get information about a node in a workspace.",operationId:"GetWorkspaceNode","x-eov-operation-handler":"NodeHandlers","x-coa-command":"get",parameters:[{name:"skipParsing",description:"Skip parsing column references and updating sources for the nodes.",in:"query",schema:{type:"boolean",default:!1},required:!1}],security:[{BearerAuth:[]}],tags:["Nodes"],responses:{"200":{$ref:"#/components/responses/NodeResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},put:{summary:"Set Node",description:"Replace all fields of a node in a workspace.",operationId:"SetWorkspaceNode","x-eov-operation-handler":"NodeHandlers","x-coa-command":"put",security:[{BearerAuth:[]}],tags:["Nodes"],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/Node"}}}},responses:{"200":{$ref:"#/components/responses/NodeResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},delete:{summary:"Delete Node",description:"Delete a node in a workspace.",operationId:"DeleteWorkspaceNode","x-eov-operation-handler":"NodeHandlers","x-coa-command":"delete",security:[{BearerAuth:[]}],tags:["Nodes"],responses:{"204":{description:"The node was successfully deleted."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/projects":{summary:"Projects","x-coa-private":!1,"x-coa-command-group":"projects",get:{summary:"Get Projects",description:"Get projects in org.",operationId:"GetProjectsInOrg","x-eov-operation-handler":"ProjectHandlers","x-coa-command":"list",parameters:[{name:"includeWorkspaces",description:"Whether or not to include nested workspace data for all projects.",in:"query",schema:{type:"boolean"},required:!1},{name:"includeJobs",description:"Whether or not to include nested job data for all workspaces in the projects.",in:"query",schema:{type:"boolean"},required:!1}],security:[{BearerAuth:[]}],tags:["Projects"],responses:{"200":{$ref:"#/components/responses/ProjectsResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},post:{summary:"Create Project",description:"Create a new project.",operationId:"CreateProject","x-eov-operation-handler":"ProjectHandlers","x-coa-command":"create",security:[{BearerAuth:[]}],tags:["Projects"],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/ProjectCreateRequest"}}}},responses:{"201":{$ref:"#/components/responses/ProjectResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/projects/{projectID}":{summary:"Projects","x-coa-private":!1,"x-coa-command-group":"projects",parameters:[{name:"projectID",description:"The project ID.",in:"path",schema:{type:"string"},required:!0},{name:"includeWorkspaces",description:"Whether or not to include nested workspace data for all projects.",in:"query",schema:{type:"boolean"},required:!1},{name:"includeJobs",description:"Whether or not to include nested job data for all workspaces in the projects.",in:"query",schema:{type:"boolean"},required:!1}],get:{summary:"Get Project",description:"Get a project.",operationId:"GetProjectInOrg","x-eov-operation-handler":"ProjectHandlers","x-coa-private":!1,"x-coa-command":"get",security:[{BearerAuth:[]}],tags:["Projects"],responses:{"200":{description:"Successful response",content:{"application/json":{schema:{$ref:"#/components/schemas/ProjectResponse"}}}},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},patch:{summary:"Update a project",description:"Update a project",operationId:"UpdateProject","x-eov-operation-handler":"ProjectHandlers","x-coa-private":!1,"x-coa-command":"update",security:[{BearerAuth:[]}],tags:["Projects"],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/ProjectPatchRequest"}}}},responses:{"200":{description:"The project was successfully updated.",content:{"application/json":{schema:{$ref:"#/components/schemas/ProjectResponse"}}}},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},delete:{summary:"Delete Project",description:"Delete a project.",operationId:"DeleteProject","x-eov-operation-handler":"ProjectHandlers","x-coa-command":"delete","x-coa-private":!1,security:[{BearerAuth:[]}],tags:["Projects"],requestBody:{required:!1,content:{"application/json":{schema:{type:["object","null"]}}}},responses:{"204":{description:"The project was successfully deleted."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/projects/{projectID}/gitAccounts":{summary:"Projects Git Accounts","x-coa-private":!1,parameters:[{name:"projectID",description:"The project ID.",in:"path",schema:{type:"string"},required:!0}],get:{summary:"List Project Git Accounts",description:"List git accounts for a project",operationId:"ListProjectGitAccounts","x-eov-operation-handler":"ProjectGitAccountHandlers","x-coa-private":!1,security:[{BearerAuth:[]}],tags:["Projects","Git Accounts"],responses:{"200":{description:"Successful response",content:{"application/json":{schema:{$ref:"#/components/schemas/ProjectGitAccountsResponse"}}}},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/projects/{projectID}/gitAccounts/{userID}":{summary:"Projects Git Accounts","x-coa-private":!1,parameters:[{name:"projectID",description:"The project ID.",in:"path",schema:{type:"string"},required:!0},{name:"userID",description:"The user ID.",in:"path",schema:{type:"string"},required:!0}],get:{summary:"Get Project Git Account",description:"Get a user's git account for a project",operationId:"GetProjectGitAccount","x-eov-operation-handler":"ProjectGitAccountHandlers","x-coa-private":!1,security:[{BearerAuth:[]}],tags:["Projects","Git Accounts"],responses:{"200":{description:"Successful response",content:{"application/json":{schema:{$ref:"#/components/schemas/ProjectGitAccountResponse"}}}},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},put:{summary:"Set Project Git Account",description:"Set a user's git account for a project",operationId:"SetProjectGitAccount","x-eov-operation-handler":"ProjectGitAccountHandlers","x-coa-private":!1,security:[{BearerAuth:[]}],tags:["Projects","Git Accounts"],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/ProjectGitAccountSetRequest"}}}},responses:{"204":{description:"The user's git account for the project was set successfully."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},delete:{summary:"Remove Project Git Account",description:"Un-set a user's git account for a project",operationId:"DeleteProjectGitAccount","x-eov-operation-handler":"ProjectGitAccountHandlers","x-coa-private":!1,security:[{BearerAuth:[]}],tags:["Projects","Git Accounts"],responses:{"204":{description:"The user's git account for the project was deleted successfully."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/integrations/fivetran/projects":{summary:"Fivetran Projects","x-coa-private":!0,get:{summary:"Get Fivetran Projects",description:"Get fivetran projects in org.",operationId:"GetFivetranProjects","x-eov-operation-handler":"FivetranHandlers",security:[{BearerAuth:[]}],tags:["FivetranIntegration"],responses:{"200":{$ref:"#/components/responses/FivetranProjectsResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/integrations/fivetran/projects/{projectId}":{"x-coa-private":!0,get:{summary:"Gets a single Fivetran project.",operationId:"GetFivetranProject","x-eov-operation-handler":"FivetranHandlers",tags:["FivetranIntegration"],parameters:[{name:"projectId",in:"path",description:"The unique identifier for the project",required:!0,schema:{type:"string"}}],responses:{"200":{description:"Successful response",content:{"application/json":{schema:{$ref:"#/components/schemas/FivetranProjectResponse"}}}},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/integrations/fivetran/projects/{projectId}/jobs":{summary:"Fivetran Jobs","x-coa-private":!0,get:{summary:"Get Fivetran jobs",description:"Get Fivetran jobs.",operationId:"GetFivetranJobs","x-eov-operation-handler":"FivetranHandlers",parameters:[{name:"projectId",in:"path",description:"The unique identifier for the project",required:!0,schema:{type:"string"}}],security:[{BearerAuth:[]}],tags:["FivetranIntegration"],responses:{"200":{$ref:"#/components/responses/FivetranJobsResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/integrations/fivetran/jobs/{jobId}/history/{historyId}":{summary:"Fivetran Job History","x-coa-private":!0,get:{parameters:[{name:"jobId",description:"The Fivetran job ID.",in:"path",schema:{type:"string"},required:!0},{name:"historyId",description:"The Fivetran history ID.",in:"path",schema:{type:"string"},required:!0}],summary:"Get Fivetran Job History",description:"Get Fivetran job history in org.",operationId:"GetFivetranJobHistory","x-eov-operation-handler":"FivetranHandlers",security:[{BearerAuth:[]}],tags:["FivetranIntegration"],responses:{"200":{$ref:"#/components/responses/FivetranJobHistoryResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/integrations/fivetran/jobs/{jobId}/run":{summary:"Start a refresh job via Fivetran","x-coa-private":!0,post:{parameters:[{name:"jobId",description:"The Fivetran job ID.",in:"path",schema:{type:"string"},required:!0}],requestBody:{description:"Request body for start Fivetran run.",required:!0,content:{"application/json":{schema:{type:"object",required:["cause"],properties:{cause:{$ref:"#/components/schemas/FivetranJobRunCause"}}}}}},summary:"Start a refresh job via Fivetran",operationId:"PostFivetranJobRefresh","x-eov-operation-handler":"FivetranHandlers",security:[{BearerAuth:[]}],tags:["FivetranIntegration"],responses:{"201":{$ref:"#/components/responses/FivetranRefreshJobResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/userRoles":{summary:"User Roles","x-coa-private":!0,get:{summary:"List User Roles",description:"Get all user roles in the organization, filtered by information available based on the current user's roles and sorted alphabetically by last name, then by first name.",operationId:"GetUserRoles","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],parameters:[{name:"excludeOrgRoles",description:"Exclude organization level roles from the results.",in:"query",schema:{type:"boolean"}},{name:"projectID",description:"Return only user roles pertaining to the specified project.",in:"query",schema:{type:"string"},required:!1},{name:"environmentID",description:"Return only user roles pertaining to the specified environment.",in:"query",schema:{type:"string"},required:!1}],responses:{"200":{$ref:"#/components/responses/UserRolesResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/userRoles/{userID}/organizationRoles":{summary:"Organization User Roles","x-coa-private":!0,parameters:[{name:"userID",description:"The user ID.",in:"path",schema:{type:"string"},required:!0}],put:{summary:"Create/Update User Organization Roles",description:"Creates or updates all of a user's organization roles. Only org admins may use this API.",operationId:"UpsertUserOrganizationRoles","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],requestBody:{description:"The user's organization roles.",required:!0,content:{"application/json":{schema:{type:"array",items:{type:"string"}}}}},responses:{"200":{$ref:"#/components/responses/UserRoleResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/userRoles/{userID}/projects/{projectID}/environments/{environmentID}":{summary:"Environment User Roles","x-coa-private":!0,parameters:[{name:"userID",description:"The user ID.",in:"path",schema:{type:"string"},required:!0},{name:"projectID",description:"The project ID.",in:"path",schema:{type:"string"},required:!0},{name:"environmentID",description:"The environment ID.",in:"path",schema:{type:"string"},required:!0}],delete:{summary:"Delete Environment User Roles",description:"Deletes all of a user's environment roles.",operationId:"DeleteUserEnvironmentRoles","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],responses:{"204":{description:"The user's environment roles were successfully deleted."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},put:{summary:"Create/Update Environment User Roles",description:"Creates or updates all of a user's environment roles.",operationId:"UpsertUserEnvironmentRoles","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],requestBody:{description:"The user environment roles.",required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/EnvironmentRoles"}}}},responses:{"200":{$ref:"#/components/responses/UserEnvironmentRoleResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/userRoles/{userID}/projects/{projectID}":{summary:"Project User Roles","x-coa-private":!0,parameters:[{name:"userID",description:"The user ID.",in:"path",schema:{type:"string"},required:!0},{name:"projectID",description:"The project ID.",in:"path",schema:{type:"string"},required:!0}],delete:{summary:"Delete Project User Roles",description:"Deletes all of a user's project roles. Only org and project admins may user this API.",operationId:"DeleteUserProjectRoles","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],responses:{"204":{description:"The user's project roles were successfully deleted."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},put:{summary:"Create/Update Project User Roles",description:"Creates or updates all of a user's project roles. Only org and project admins may user this API.",operationId:"UpsertUserProjectRoles","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],requestBody:{description:"The user project roles.",required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/ProjectRoles"}}}},responses:{"200":{$ref:"#/components/responses/UserProjectRoleResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v2/userRoles":{summary:"User Roles",get:{summary:"List User Roles",description:"Get all user roles in the organization, filtered by information available based on the current user's roles",operationId:"GetUserRolesV2","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],parameters:[{name:"projectID",description:"Return only user roles pertaining to the specified project.",in:"query",schema:{type:"string"},required:!1},{name:"environmentID",description:"Return only user roles pertaining to the specified environment.",in:"query",schema:{type:"string"},required:!1}],responses:{"200":{$ref:"#/components/responses/UserRoleResponseV2"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v2/userRoles/{userID}":{summary:"Single User roles",parameters:[{name:"userID",description:"The user ID.",in:"path",schema:{type:"string"},required:!0},{name:"projectID",description:"The project ID.",in:"query",schema:{type:"string"},required:!1},{name:"environmentID",description:"The environment ID.",in:"query",schema:{type:"string"},required:!1}],get:{summary:"Get Single User Roles",description:"Get a single user's roles.",operationId:"GetSingleUserRolesV2","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],responses:{"200":{$ref:"#/components/responses/SingleUserRoleResponseV2"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v2/userRoles/{userID}/organizationRole":{summary:"Organization User Roles",parameters:[{name:"userID",description:"The user ID.",in:"path",schema:{type:"string"},required:!0}],put:{summary:"Create/Update User Organization Role",description:"Creates or updates a user's organization role. Only org admins may use this API.",operationId:"UpsertUserOrganizationRoleV2","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],requestBody:{description:"The user's organization role.",required:!0,content:{"application/json":{schema:{type:"object",properties:{organizationRole:{type:"string"}},required:["organizationRole"]}}}},responses:{"200":{$ref:"#/components/responses/SingleUserRoleResponseV2"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v2/userRoles/{userID}/projects/{projectID}":{summary:"Project User Roles",parameters:[{name:"userID",description:"The user ID.",in:"path",schema:{type:"string"},required:!0},{name:"projectID",description:"The project ID.",in:"path",schema:{type:"string"},required:!0}],delete:{summary:"Delete Project User Roles",description:"Deletes all of a user's project roles. Only org and project admins may user this API.",operationId:"DeleteUserProjectRoleV2","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],responses:{"204":{description:"The user's project roles were successfully deleted."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},put:{summary:"Create/Update Project User Role",description:"Creates or updates a user's project role. Only org and project admins may user this API.",operationId:"UpsertUserProjectRoleV2","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],requestBody:{description:"The user project role",required:!0,content:{"application/json":{schema:{type:"object",properties:{projectRole:{type:"string"}},required:["projectRole"]}}}},responses:{"200":{$ref:"#/components/responses/SingleUserRoleResponseV2"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v2/userRoles/{userID}/environments/{environmentID}":{summary:"Environment User Roles",parameters:[{name:"userID",description:"The user ID.",in:"path",schema:{type:"string"},required:!0},{name:"environmentID",description:"The environment ID.",in:"path",schema:{type:"string"},required:!0}],delete:{summary:"Delete Environment User Roles",description:"Deletes all of a user's environment roles.",operationId:"DeleteUserEnvironmentRoleV2","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],responses:{"204":{description:"The user's environment role was successfully deleted."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},put:{summary:"Create/Update Environment User Roles",description:"Creates or updates a user's environment role.",operationId:"UpsertUserEnvironmentRoleV2","x-eov-operation-handler":"UserRolesHandlers",tags:["UserRoles"],requestBody:{description:"The user environment role.",required:!0,content:{"application/json":{schema:{type:"object",properties:{environmentRole:{description:"The environment role to set",type:"string"},setDefaultProjectRole:{description:`If set, if the user has no role for the environment's project, it will be set to this role. If this
10376
10376
  is not set and the user has no role assigned for the environment's project, the response will be an
10377
10377
  HTTP 403 error
10378
10378
  `,type:"string"}},required:["environmentRole"]}}}},responses:{"200":{$ref:"#/components/responses/SingleUserRoleResponseV2"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/users":{summary:"All users in the current org",get:{description:"Get all users in the current org",operationId:"ListOrgUsers","x-eov-operation-handler":"UsersHandlers",parameters:[{name:"limit",description:"The maximum number of users to return.",in:"query",schema:{type:"integer",minimum:1,maximum:500,default:50},required:!1},{name:"startingFrom",description:"The cursor point for paging the query results.",in:"query",allowReserved:!0,schema:{type:"string"},required:!1},{name:"orderBy",description:"The field to order the results by.",in:"query",schema:{type:"string",enum:["id"],default:"id"},required:!1}],security:[{BearerAuth:[]}],responses:{"200":{$ref:"#/components/responses/AllUsersResult"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/users/{userId}":{summary:"Delete User","x-coa-private":!0,delete:{summary:"Delete User",description:"Delete a user by ID.",operationId:"DeleteUser","x-eov-operation-handler":"UsersHandlers",tags:["Users"],parameters:[{name:"userId",description:"The user ID.",in:"path",schema:{type:"string"},required:!0}],responses:{"204":{description:"The user was successfully deleted."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"500":{$ref:"#/components/responses/InternalServerError"}}}},"/api/v1/packageRegistry/all":{summary:"All Packages","x-coa-private":!0,get:{description:"Get all available packages on the registry.",operationId:"GetAllRegistryPackages","x-eov-operation-handler":"PackageRegistryHandlers",tags:["PackageRegistry"],responses:{"200":{$ref:"#/components/responses/AllRegistryPackagesResult"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/packageRegistry/{packageID}/releases/privacy/{privacy}":{summary:"All Package Releases","x-coa-private":!0,get:{description:"Get all available releases for a package on the registry.",operationId:"GetAllRegistryPackageReleases","x-eov-operation-handler":"PackageRegistryHandlers",tags:["PackageRegistry"],parameters:[{name:"packageID",description:"The package id.",in:"path",schema:{type:"string",minLength:1},required:!0},{name:"privacy",description:"The privacy level of the packages requested",in:"path",schema:{type:"string",enum:["public","private","unlisted","all"],minLength:1},required:!0}],responses:{"200":{$ref:"#/components/responses/AllRegistryPackageReleasesResult"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/packageRegistry/{packageID}":{summary:"Package","x-coa-private":!0,get:{description:"Get a package on the registry.",operationId:"GetRegistryPackage","x-eov-operation-handler":"PackageRegistryHandlers",tags:["PackageRegistry"],parameters:[{name:"packageID",description:"The package id.",in:"path",schema:{type:"string",minLength:1},required:!0}],responses:{"200":{$ref:"#/components/responses/RegistryPackageResult"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},put:{description:"Update an existing package's information.",operationId:"updatePackageV2","x-eov-operation-handler":"PackagesHandlers",tags:["Packages"],parameters:[{name:"packageID",description:"The id of the package.",in:"path",schema:{type:"string",minLength:1},required:!0}],requestBody:{description:"Updated package details. Does not include package content held in a release.",required:!0,content:{"application/json":{schema:{type:"object",required:["description","overview","tags","featured","certified"],properties:{description:{type:"string"},overview:{type:"string",maxLength:200},tags:{type:"array",items:{type:"string"}},featured:{type:"boolean"},certified:{type:"boolean"}}}}}},responses:{"200":{$ref:"#/components/responses/PackageResponseV2"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/packageRegistry/{packageID}/releases/{releaseID}":{summary:"Package Release","x-coa-private":!0,put:{description:"Update a package release.",operationId:"updatePackageReleaseV2","x-eov-operation-handler":"PackagesHandlers",tags:["Packages"],parameters:[{name:"packageID",description:"The package id.",in:"path",schema:{type:"string",minLength:1},required:!0},{name:"releaseID",description:"The package release ID.",in:"path",schema:{type:"string",minLength:1},required:!0}],requestBody:{description:"The package release info to update with.",required:!0,content:{"application/json":{schema:{type:"object",required:["changeLog","privacy"],properties:{changeLog:{type:"string",minLength:1},privacy:{type:"string",minLength:1,enum:["public","private","unlisted"]}}}}}},responses:{"200":{$ref:"#/components/responses/RegistryPackageReleaseResult"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},get:{description:"Get a release from a package in the registry.",operationId:"GetRegistryPackageRelease","x-eov-operation-handler":"PackageRegistryHandlers",tags:["PackageRegistry"],parameters:[{name:"packageID",description:"The package id.",in:"path",schema:{type:"string",minLength:1},required:!0},{name:"releaseID",description:"The package release ID.",in:"path",schema:{type:"string",minLength:1},required:!0}],responses:{"200":{$ref:"#/components/responses/RegistryPackageReleaseResult"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/packageRegistry/org":{summary:"Organization Packages","x-coa-private":!0,get:{description:"Get a release from a package in the registry.",operationId:"GetRegistryPackagesForOrg","x-eov-operation-handler":"PackageRegistryHandlers",tags:["PackageRegistry"],responses:{"200":{$ref:"#/components/responses/AllRegistryPackagesResult"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/packageRegistry/createPackage":{summary:"Packages","x-coa-private":!0,post:{description:"Create a package without a release.",operationId:"createPackage","x-eov-operation-handler":"PackagesHandlers",tags:["Packages"],requestBody:{description:"Info describing and defining the package. Does not include package content held in a release",required:!0,content:{"application/json":{schema:{type:"object",required:["name","description","overview","tags","featured","certified","platformKind"],properties:{name:{type:"string"},description:{type:"string"},overview:{type:"string",maxLength:200},tags:{type:"array",items:{type:"string"}},featured:{type:"boolean"},certified:{type:"boolean"},platformKind:{type:"string",enum:["snowflake","fabric","databricks","bigquery"]}}}}}},responses:{"201":{$ref:"#/components/responses/PackageResponseV2"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/packageRegistry/createRelease":{"x-coa-private":!0,post:{description:"Add a new package release to an existing package.",operationId:"AddPackageRelease","x-eov-operation-handler":"PackagesHandlers",tags:["Packages"],requestBody:{description:"The package release info.",required:!0,content:{"application/json":{schema:{type:"object",required:["release","entities","privacy","packageVariables","packageID"],properties:{release:{$ref:"#/components/schemas/PackageCreateReleaseInfo"},privacy:{type:"string",enum:["public","private","unlisted"]},entities:{$ref:"#/components/schemas/PackageCreateEntities"},packageVariables:{type:"string"},packageID:{type:"string",minLength:1}}}}}},responses:{"201":{$ref:"#/components/responses/RegistryPackageReleaseResult"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/packageRegistry/update":{"x-coa-private":!0,put:{description:"Update a package.",operationId:"UpdatePackage","x-eov-operation-handler":"PackagesHandlers",tags:["Packages"],requestBody:{description:"The package info to create with.",required:!0,content:{"application/json":{schema:{type:"object",required:["packageID","releaseID"],properties:{packageID:{type:"string",minLength:1},releaseID:{type:"string",minLength:1},changeLog:{type:"string"},description:{type:"string"},privacy:{type:"string",enum:["public","private","unlisted"]}}}}}},responses:{"200":{$ref:"#/components/responses/PackageUpdateResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/typesense/orgs/{orgID}/typesense-config":{summary:"Typesense Config","x-coa-private":!0,parameters:[{name:"orgID",description:"The organization ID.",in:"path",schema:{type:"string"},required:!0}],post:{description:"Returns Typesense configuration data for a given org.",operationId:"getTypesenseConfigForOrg","x-eov-operation-handler":"TypesenseHandlers",security:[{BearerAuth:[]}],tags:["CoalesceAPI"],responses:{"200":{$ref:"#/components/responses/TypesenseConfigurationResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/runs":{summary:"Runs","x-coa-command-group":"runs",parameters:[{name:"overrideOrgID",description:"Runs an operation against the specified org. (Super-users only.)","x-coa-private":!0,in:"query",schema:{type:"string"},required:!1}],get:{summary:"List Runs",description:"Get a collection of information about runs.",operationId:"GetRuns","x-eov-operation-handler":"RunHandlers","x-coa-command":"list",security:[{BearerAuth:[]}],tags:["Runs"],parameters:[{name:"limit",description:"The maximum number of runs to return.",in:"query",schema:{type:"integer",minimum:0,maximum:1e3,default:25},required:!1},{name:"startingFrom",description:"The starting run ID, runStartTime, or runEndTime (exclusive) for paging the query results.",in:"query",allowReserved:!0,schema:{oneOf:[{type:"integer",minimum:0},{type:"string",format:"date-time"}]},required:!1},{name:"orderBy",description:"The field used to sort query results. Defaults to `id`, but must be explicitly provided when also using `startingFrom`. Make sure to match data type.",in:"query",schema:{$ref:"#/components/schemas/RunsOrderBy"},required:!1},{$ref:"#/components/parameters/orderByDirection"},{name:"projectID",description:"One or more project IDs to filter the query results.",in:"query",schema:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},style:"form",explode:!0,required:!1},{name:"runType",description:"One or more run types to filter the query results.",in:"query",schema:{oneOf:[{$ref:"#/components/schemas/RunType"},{type:"array",items:{$ref:"#/components/schemas/RunType"}}]},style:"form",explode:!0,required:!1},{name:"runStatus",description:"One or more status values to filter the query results.",in:"query",schema:{oneOf:[{$ref:"#/components/schemas/RunStatus"},{type:"array",items:{$ref:"#/components/schemas/RunStatus"}}]},style:"form",explode:!0,required:!1},{name:"environmentID",description:"One or more environment IDs to filter the query results.",in:"query",schema:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},style:"form",explode:!0,required:!1},{name:"detail",description:"Include the full detail of the run.",in:"query",schema:{type:"boolean",default:!1},required:!1}],responses:{"200":{$ref:"#/components/responses/RunsResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/runs/{runID}":{summary:"Run","x-coa-command-group":"runs",parameters:[{name:"overrideOrgID",description:"Runs an operation against the specified org. (Super-users only.)","x-coa-private":!0,in:"query",schema:{type:"string"},required:!1}],get:{summary:"Get Run",description:"Gets a single run.",operationId:"GetRun","x-eov-operation-handler":"RunHandlers","x-coa-command":"get",security:[{BearerAuth:[]}],tags:["Runs"],parameters:[{name:"runID",description:"The run ID.",in:"path",schema:{type:"integer"},required:!0}],responses:{"200":{$ref:"#/components/responses/RunResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/runs/{runID}/results":{summary:"Run Results","x-coa-command-group":"runs",parameters:[{name:"overrideOrgID",description:"Runs an operation against the specified org. (Super-users only.)","x-coa-private":!0,in:"query",schema:{type:"string"},required:!1}],get:{summary:"List Run Results",description:"Get a collection of the results of a deploy or refresh run",operationId:"GetRunResults","x-eov-operation-handler":"RunHandlers","x-coa-command":"list-results",security:[{BearerAuth:[]}],tags:["Runs"],parameters:[{name:"runID",description:"The run ID.",in:"path",schema:{type:"integer"},required:!0}],responses:{"200":{$ref:"#/components/responses/RunResultsResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/runs/{runID}/stored-run-results/{chunkID}":{summary:"Stored Run Results","x-coa-private":!0,"x-coa-command-group":"runs",parameters:[{name:"overrideOrgID",description:"Runs an operation against the specified org. (Super-users only.)","x-coa-private":!0,in:"query",schema:{type:"string"},required:!1},{name:"runID",description:"The run ID.",in:"path",schema:{type:"string"},required:!0},{name:"chunkID",description:"The chunk ID",in:"path",schema:{type:"string"},required:!0}],get:{summary:"Get Stored Run Results",description:"Get raw run results from external storage",operationId:"GetStoredRunResults","x-eov-operation-handler":"RunHandlers","x-coa-private":!0,security:[{BearerAuth:[]}],tags:["Runs"],responses:{"200":{$ref:"#/components/responses/StoredRunResultsResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/database":{"x-coa-private":!0,get:{summary:"Get database connectivity information.",description:"Gets the information required to connect to the Coalesce database.",operationId:"GetDatabase","x-eov-operation-handler":"DatabaseHandlers",security:[],responses:{"200":{$ref:"#/components/responses/DatabaseInfoResponse"}}}},"/api/v1/secrets/{secretType}/{context}":{"x-coa-private":!0,get:{description:"Determines whether or not a git token value exists for a given project ID.",operationId:"SecretExists","x-eov-operation-handler":"SecretHandlers",security:[{BearerAuth:[]}],tags:["Secrets"],parameters:[{$ref:"#/components/parameters/secretType"},{$ref:"#/components/parameters/context"}],responses:{"200":{$ref:"#/components/responses/secretExists"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},post:{description:"Upgrades a secret from secretType its upgrade target.",operationId:"UpgradeSecret","x-eov-operation-handler":"SecretHandlers",security:[{BearerAuth:[]}],tags:["Secrets"],parameters:[{$ref:"#/components/parameters/secretType"},{$ref:"#/components/parameters/context"}],responses:{"204":{description:"Successfully upgraded a secret."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},put:{description:"Sets the value of a secret.",operationId:"SetSecret","x-eov-operation-handler":"SecretHandlers",security:[{BearerAuth:[]}],tags:["Secrets"],parameters:[{$ref:"#/components/parameters/secretType"},{$ref:"#/components/parameters/context"}],requestBody:{description:"The new value of the secret.",required:!0,content:{"application/json":{schema:{type:"object",required:["secretValue"],properties:{secretValue:{}}}}}},responses:{"204":{description:"Successfully set the value of a secret."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},delete:{description:"Deletes a secret.",operationId:"DeleteSecret","x-eov-operation-handler":"SecretHandlers",security:[{BearerAuth:[]}],tags:["Secrets"],parameters:[{$ref:"#/components/parameters/secretType"},{$ref:"#/components/parameters/context"}],responses:{"204":{description:"Successfully deleted the value of a secret."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/sql/parse":{"x-coa-private":!0,post:{summary:"Parse SQL expressions",description:"Parse multiple SQL expressions or FROM clauses using the Strumenta parser.",operationId:"ParseSql","x-eov-operation-handler":"SqlParseHandlers",security:[{BearerAuth:[]}],tags:["SQL"],requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["expressions"],properties:{expressions:{type:"array",description:"Array of SQL expressions to parse",items:{type:"object",required:["sql","type","platformKind"],properties:{sql:{type:"string",description:"The SQL expression or FROM clause to parse"},type:{type:"string",enum:["expression","from"],description:"Type of SQL to parse - either an expression or a FROM clause"},platformKind:{$ref:"#/components/schemas/PlatformKind"}}}}}}}}},responses:{"200":{description:"Parsing results",content:{"application/json":{schema:{type:"object",required:["results"],properties:{results:{type:"array",items:{type:"object",required:["originalSql","type","platformKind","success"],properties:{originalSql:{type:"string",description:"The original SQL expression that was parsed"},type:{type:"string",enum:["expression","from"],description:"The type of SQL that was parsed"},platformKind:{$ref:"#/components/schemas/PlatformKind"},success:{type:"boolean",description:"Whether the parsing was successful"},result:{description:"The parsing result (only present if successful). For 'expression' type, contains table and column references. For 'from' type, contains a lookup table of aliases.",oneOf:[{type:"object",description:"TableReferenceResult - returned for 'expression' type",required:["validReferences","invalidReferences"],properties:{validReferences:{type:"array",description:"Array of valid table.column references as tuples [tableName, columnName]",items:{type:"array",minItems:2,maxItems:2,items:{type:"string"}}},invalidReferences:{type:"array",description:"Array of column names that could not be resolved to a table",items:{type:"string"}}}},{type:"object",description:"QuickLookup - returned for 'from' type. A map of aliases to their referenced nodes and columns",additionalProperties:{type:"object",properties:{node:{type:"string",description:"Optional node identifier"},column:{description:"Column name or symbol",oneOf:[{type:"string"},{type:"object"}]}}}}]},error:{type:"string",description:"Error message (only present if failed)"}}}}}}}}},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/admin/kill-job/{orgId}/{runId}":{"x-coa-private":!0,post:{description:"Deletes the Kubernetes job.",operationId:"KillJob","x-eov-operation-handler":"AdminHandlers",security:[{BearerAuth:[]}],tags:["Admin"],parameters:[{$ref:"#/components/parameters/orgId"},{$ref:"#/components/parameters/runId"}],responses:{"204":{description:"Successfully killed the job."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/scheduler/secret/{secretType}/{context}":{"x-coa-private":!0,get:{description:"Determines whether or not a git token value exists for a given project ID.",operationId:"SecretExistsV0","x-eov-operation-handler":"SecretHandlers",security:[{BearerAuth:[]}],tags:["default"],deprecated:!0,parameters:[{$ref:"#/components/parameters/secretType"},{$ref:"#/components/parameters/context"}],responses:{"200":{$ref:"#/components/responses/secretExists"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},post:{description:"Sets the value of a secret.",operationId:"SetSecretV0","x-eov-operation-handler":"SecretHandlers",security:[{BearerAuth:[]}],tags:["default"],deprecated:!0,parameters:[{$ref:"#/components/parameters/secretType"},{$ref:"#/components/parameters/context"}],requestBody:{description:"The new value of the secret.",required:!0,content:{"application/json":{schema:{type:"object",required:["secretValue"],properties:{secretValue:{}}}}}},responses:{"204":{description:"Successfully set the value of a secret."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},delete:{description:"Deletes a secret.",operationId:"DeleteSecretV0","x-eov-operation-handler":"SecretHandlers",security:[{BearerAuth:[]}],tags:["default"],deprecated:!0,parameters:[{$ref:"#/components/parameters/secretType"},{$ref:"#/components/parameters/context"}],responses:{"204":{description:"Successfully deleted the value of a secret."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/bulkWrite":{"x-coa-private":!0,post:{description:"Updates multiple documents for a workspace.",operationId:"BulkWrite","x-eov-operation-handler":"BulkWriteHandlers",security:[{BearerAuth:[]}],tags:["BulkOperations"],deprecated:!1,requestBody:{description:"The workspace to update and the data to update with.",required:!0,content:{"application/json":{schema:{type:"object",required:["workspaceID","writeInfo","requestID"],properties:{workspaceID:{type:"number"},requesetID:{type:"string"},writeInfo:{type:"array",items:{$ref:"#/components/schemas/WriteInfo"}}}}}}},responses:{"204":{description:"Successfully wrote the documents to the workspace."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/validHostname":{"x-coa-private":!0,post:{description:"Validates the passed hostname and returns an authorized version.",operationId:"ValidateHostname","x-eov-operation-handler":"ValidateHostnameHandlers",tags:["default"],deprecated:!1,security:[],requestBody:{description:"The hostname that needs to be validated.",required:!0,content:{"application/json":{schema:{type:"object",required:["hostname"],properties:{hostname:{type:"string"}}}}}},responses:{"200":{$ref:"#/components/responses/ValidHostname"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/metrics":{"x-coa-private":!0,post:{description:"Submit a set of metrics",operationId:"SubmitMetrics","x-eov-operation-handler":"MetricsHandlers",security:[{BearerAuth:[]}],tags:["default"],deprecated:!1,requestBody:{description:"The metrics to submit",required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/MetricsRequest"}}}},responses:{"204":{description:"Submitted metrics"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/multiFactorAuth/{userID}":{"x-coa-private":!0,parameters:[{name:"userID",description:"The user ID.",in:"path",schema:{type:"string"},required:!0}],delete:{description:"Deletes the MFA for a user in firebase auth",operationId:"RemoveMultiFactor","x-eov-operation-handler":"MultiFactorAuthHandlers",deprecated:!1,tags:["default"],security:[{BearerAuth:[]}],responses:{"204":{description:"User's MFA successfully deleted."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/plan":{"x-coa-private":!0,post:{description:"Create a deployment plan",summary:"Create Plan",operationId:"createPlan","x-eov-operation-handler":"PlanHandlers",security:[{BearerAuth:[]}],tags:["default"],deprecated:!1,requestBody:{description:"Requirements for plan creation",required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/CreatePlanRequest"}}}},responses:{"202":{$ref:"#/components/responses/PlanRequestAcceptedResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/plan/{environmentID}/{planID}":{"x-coa-private":!0,get:{description:"Get an existing deployment plan",summary:"Get Plan",operationId:"getPlan","x-eov-operation-handler":"PlanHandlers",security:[{BearerAuth:[]}],tags:["default"],deprecated:!1,parameters:[{name:"environmentID",description:"The environment ID",in:"path",schema:{type:"string"},required:!0},{name:"planID",description:"The plan ID",in:"path",schema:{type:"string"},required:!0}],responses:{"200":{$ref:"#/components/responses/PlanResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/llm/git-commit-message":{"x-coa-private":!0,post:{summary:"Generate AI Git Commit Message",description:"Generate an AI commit message based on git diffs",operationId:"GetAIGitCommitMessage","x-eov-operation-handler":"GitCommitMessageHandler",requestBody:{description:"Git diff context for commit message generation",required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/GitCommitMessageRequest"}}}},responses:{"200":{$ref:"#/components/responses/GitCommitMessageResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}},tags:["LLM"]}},"/api/v1/llm/node-description":{"x-coa-private":!0,post:{summary:"Get AI Descriptions for a node",description:"Retrieve the generated AI descriptions for a node.",operationId:"GetAINodeDescription","x-eov-operation-handler":"NodeDescriptionHandler",requestBody:{description:"workspaceID, nodeID of the node for which to generate the AI description.",required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/NodeDescriptionRequest"}}}},responses:{"200":{$ref:"#/components/responses/NodeDescriptionResponse"},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}},tags:["LLM"]}},"/api/v1/llm/chat":{"x-coa-private":!0,post:{summary:"Get AI Chat Message",description:"Get the generated AI chat message.",operationId:"GetChatMessage","x-eov-operation-handler":"ChatMessageHandler",requestBody:{description:"The prompt to generate the AI chat message.",required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/ChatRequest"}}}},responses:{"200":{description:"Successful chat response",content:{"application/json":{schema:{$ref:"#/components/schemas/ChatResponse"}}}},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}},tags:["LLM"]}},"/api/v1/llm/llm":{"x-coa-private":!0,post:{summary:"Get AI LLM Message",description:"Get the generated AI LLM message.",operationId:"GetLlmMessage","x-eov-operation-handler":"LlmMessageHandler",requestBody:{description:"The prompt to generate the AI LLM message.",required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/LlmRequest"}}}},responses:{"200":{description:"Successful chat response",content:{"application/json":{schema:{$ref:"#/components/schemas/LlmResponse"}}}},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}},tags:["LLM"]}},"/api/v1/workspaces/{workspaceID}/subgraphs":{summary:"Subgraphs","x-coa-private":!0,post:{summary:"Create Subgraph",description:"Create a new subgraph for organizing and managing a collection of nodes.",operationId:"CreateSubgraph","x-eov-operation-handler":"SubgraphHandlers",security:[{BearerAuth:[]}],tags:["Subgraphs"],parameters:[{name:"workspaceID",required:!0,description:"ID of the workspace containing the subgraph",in:"path",schema:{type:"string"}}],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/SubgraphRequest"}}}},responses:{"201":{description:"The subgraph was successfully created.",content:{"application/json":{schema:{type:"object",required:["data"],properties:{data:{$ref:"#/components/schemas/Subgraph"}}}}}},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/workspaces/{workspaceID}/subgraphs/{subgraphID}":{summary:"Subgraphs","x-coa-private":!0,put:{summary:"Update Subgraph",description:"Update a subgraph.",operationId:"UpdateSubgraph","x-eov-operation-handler":"SubgraphHandlers",security:[{BearerAuth:[]}],tags:["Subgraphs"],parameters:[{name:"subgraphID",required:!0,description:"ID of the subgraph being fetched",in:"path",schema:{type:"string"}},{name:"workspaceID",required:!0,description:"ID of the workspace containing the subgraph",in:"path",schema:{type:"string"}}],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/SubgraphRequest"}}}},responses:{"204":{description:"The subgraph was successfully updated."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"409":{$ref:"#/components/responses/AlreadyExistsError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},delete:{summary:"Delete Subgraph",description:"Delete a subgraph.",operationId:"DeleteSubgraph","x-eov-operation-handler":"SubgraphHandlers",security:[{BearerAuth:[]}],tags:["Subgraphs"],parameters:[{name:"subgraphID",required:!0,description:"ID of the subgraph being fetched",in:"path",schema:{type:"string"}},{name:"workspaceID",required:!0,description:"ID of the workspace containing the subgraph",in:"path",schema:{type:"string"}}],responses:{"204":{description:"Subgraph deleted successfully."},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}},get:{summary:"Get Subgraph",description:"Get a subgraph.",operationId:"GetSubgraph","x-eov-operation-handler":"SubgraphHandlers",security:[{BearerAuth:[]}],tags:["Subgraphs"],parameters:[{name:"subgraphID",required:!0,description:"ID of the subgraph being fetched",in:"path",schema:{type:"string"}},{name:"workspaceID",required:!0,description:"ID of the workspace containing the subgraph",in:"path",schema:{type:"string"}}],responses:{"200":{description:"The subgraph was successfully retrieved.",content:{"application/json":{schema:{type:"object",required:["data"],properties:{data:{$ref:"#/components/schemas/Subgraph"}}}}}},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/workspaces/{workspaceID}/databricks/warehouse":{"x-coa-private":!0,get:{summary:"Get list of Databricks SQL warehouses",description:"Retrieves a list of all SQL warehouses that a user has manager permissions on.",operationId:"GetDatabricksWarehouse","x-eov-operation-handler":"DatabricksHandlers",security:[{BearerAuth:[]}],tags:["Databricks"],parameters:[{name:"workspaceID",in:"path",required:!0,schema:{type:"string"},description:"The ID of the workspace"},{name:"x-databricks-browser-token",in:"header",required:!1,schema:{type:"string"},description:"Token from browser storage, only used when connection type is browser storage token."}],responses:{"200":{description:"Successfully retrieved warehouses from databricks.",content:{"application/json":{schema:{$ref:"#/components/schemas/DatabricksWarehouseResponse"}}}},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/workspaces/{workspaceID}/bigquery/projects":{"x-coa-private":!0,get:{summary:"List BigQuery projects",description:"Retrieves BigQuery projects accessible by the workspace's configured account.",operationId:"GetBigQueryProjects","x-eov-operation-handler":"BigQueryHandlers",security:[{BearerAuth:[]}],tags:["BigQuery"],parameters:[{name:"workspaceID",in:"path",required:!0,schema:{type:"string"},description:"The workspace ID."}],responses:{"200":{description:"Successfully retrieved BigQuery projects.",content:{"application/json":{schema:{$ref:"#/components/schemas/BigQueryProjectsResponse"}}}},"400":{$ref:"#/components/responses/InvalidRequestError"},"401":{$ref:"#/components/responses/Unauthorized"},"403":{$ref:"#/components/responses/ForbiddenError"},"404":{$ref:"#/components/responses/NotFoundError"},"500":{$ref:"#/components/responses/InternalServerError"},"502":{$ref:"#/components/responses/BadGatewayError"},"503":{$ref:"#/components/responses/ServiceUnavailableError"},"504":{$ref:"#/components/responses/GatewayTimeoutError"}}}},"/api/v1/workspaces/{workspaceID}/bigquery/projects/{projectID}/datasets":{"x-coa-private":!0,get:{summary:"List BigQuery datasets",description:`Retrieves BigQuery datasets (schemas) for a given project.