sml-cli 2026.8.0-rc.6 → 2026.8.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -666,10 +666,10 @@ ${r}`,PHr=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),NHr=Obj
|
|
|
666
666
|
`),i=[];for(let l of r){let p=l.trim();if(p.startsWith("#")||p==="")i.push(l);else break}return i.some(l=>l.trim().startsWith("#"))?i.join(`
|
|
667
667
|
`):""},fxe=n=>{let r=n.split(`
|
|
668
668
|
`),i=0;for(let a=0;a<r.length;a++){let l=r[a].trim();if(l.startsWith("#")||l==="")i=a+1;else break}return r.slice(i).join(`
|
|
669
|
-
`)};var Jwr=n=>`${n} is required`,VJe=class n{constructor(r){this.ErrorConstructor=r}forError(r){return new n(r)}should(r,i){if(!r)throw new this.ErrorConstructor(i)}exists(r,i){this.should(r!=null,i),typeof r=="number"&&this.should(!isNaN(r),i)}notEmpty(r,i){let a=r!=null&&r.trim()!=="";this.should(a,i)}allRequired(r){r.forEach(([i,a])=>{let l=Jwr(a);typeof i=="string"&&this.notEmpty(i,l),this.exists(i,l)})}ensure(r,i){if(this.exists(r,i),!r)throw new this.ErrorConstructor(i);return r}ensureType(r,i,a){if(i(r))return r;throw new this.ErrorConstructor(a)}},vs=new VJe(Error),Yb=vs;var Uwr=n=>n?n instanceof Error?n.message:typeof n=="string"?n:`${n}`:"unknown error",a_={getErrorMessage(n,r){let i=Uwr(n);return r?.removeStartString&&i.startsWith(r.removeStartString)?i.substring(r.removeStartString.length).trim():i},getError(n){return new Error(this.getErrorMessage(n))},hasErrorCode:n=>{if(!n)return!1;let r=n.code;return r?typeof r=="string":!1},async executeQueryOrThrow(n){try{return await n()}catch(r){let i;if(r.response)try{i=(await r.response.json()).message}catch(a){i=`Could not get json error. Error ${a_.getErrorMessage(a)}. Original error: ${a_.getErrorMessage(r)}`}else i=`Error: ${a_.getErrorMessage(r)}`;throw new Error(i)}}},pxe=a_;var WJe=class{async wait(r=50){return new Promise(i=>{setTimeout(()=>i(),r)})}async returnDelayed(r,i=300){return await this.wait(i),r}},drn=new WJe;var Vwr={cloneFunctions:!1},xC=class n{static deep(r,i={}){let a={...Vwr,...i};if(r==null)return r;let l=typeof r=="function";if(!l&&!(typeof r=="object"))return r;if(l)return a.cloneFunctions?r:void 0;if(Array.isArray(r))return r.map(_=>n.deep(_,a));if(r instanceof Date)return new Date(r.getTime());{let _={},b=Object.keys(r);for(let T of b)_[T]=n.deep(r[T],a);return _}}static cleanEmptyProperties(r){let i={};for(let a in r){let l=r[a];l===""||l===void 0||l===null||(typeof l=="object"?i[a]=n.cleanEmptyProperties(l):i[a]=l)}return i}};var Wwr=/token/i,zwr=/password/i,Gwr=/secret/i,a2t=[Wwr,zwr,Gwr],zJe=class{constructor(){this.undefinedString="[undefined]";this.functionString="[function]";this.circularString="[Circular]";this.obfuscatedString="***"}obfuscate(r){return typeof r=="string"?r==null?this.obfuscatedString:r.length<=6?this.obfuscatedString:r.length<=9?`${this.obfuscatedString}${r.substring(r.length-3)}`:`${r.substring(0,3)}${this.obfuscatedString}${r.substring(r.length-3)}`:this.obfuscatedString}getMaxObjectDepthError(r){return`Max object depth (${r.maxObjectDepth}) exceeded. Current depth: ${r.currentDepth}`}obfuscateObject(r,i,a,l=1){if(l>i.maxObjectDepth)return this.getMaxObjectDepthError({maxObjectDepth:i.maxObjectDepth,currentDepth:l});if(r instanceof Date)return r.toISOString();if(r instanceof Map){let p={};for(let[_,b]of r.entries()){let T=typeof _=="string"?_:i.jsonSerialize(_);a2t.some(E=>E.test(T))?p[T]=this.obfuscate(b):p[T]=this.obfuscateObject(b,i,a,l+1)}return p}if(r instanceof Set)return Array.from(r).map(p=>this.obfuscateObject(p,i,a,l+1));if(typeof r=="bigint")return r.toString();if(r===void 0)return i.serializeUndefined?this.undefinedString:r;if(typeof r=="function")return i.serializeFunctions?this.functionString:r;if(typeof r=="symbol")return i.serializeSymbols?r.toString():r;if(Array.isArray(r))return r.map(p=>this.obfuscateObject(p,i,a,l+1));if(r!==null&&typeof r=="object"){if(a.has(r))return this.circularString;a.add(r);let p={};for(let[_,b]of Object.entries(r))_.toLowerCase()!=="prototype"&&(typeof b=="function"&&!i.serializeFunctions||(typeof b=="string"&&a2t.some(T=>T.test(_))?p[_]=this.obfuscate(b):p[_]=this.obfuscateObject(b,i,a,l+1)));return p}return r}safeToString(r,i){let l=Object.assign({serializeUndefined:!0,serializeFunctions:!1,serializeSymbols:!1,rethrowErrors:!1,maxObjectDepth:10,jsonSerialize:JSON.stringify},i??{});try{let p=new WeakSet,_=this.obfuscateObject(r,l,p);return l.jsonSerialize(_,null,l.space)}catch(p){let _=`Error serializing object: ${pxe.getErrorMessage(p)}`;if(l.rethrowErrors)throw Error(_);return _}}},Srn=new zJe;var kO=n=>n!=null;var c2t=su(require("crypto")),_xe=new Uint8Array(256),dxe=_xe.length;function GJe(){return dxe>_xe.length-16&&(c2t.default.randomFillSync(_xe),dxe=0),_xe.slice(dxe,dxe+=16)}var l2t=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Hwr(n){return typeof n=="string"&&l2t.test(n)}var X6=Hwr;var Kb=[];for(let n=0;n<256;++n)Kb.push((n+256).toString(16).slice(1));function mxe(n,r=0){return(Kb[n[r+0]]+Kb[n[r+1]]+Kb[n[r+2]]+Kb[n[r+3]]+"-"+Kb[n[r+4]]+Kb[n[r+5]]+"-"+Kb[n[r+6]]+Kb[n[r+7]]+"-"+Kb[n[r+8]]+Kb[n[r+9]]+"-"+Kb[n[r+10]]+Kb[n[r+11]]+Kb[n[r+12]]+Kb[n[r+13]]+Kb[n[r+14]]+Kb[n[r+15]]).toLowerCase()}function Qwr(n){if(!X6(n))throw TypeError("Invalid UUID");let r,i=new Uint8Array(16);return i[0]=(r=parseInt(n.slice(0,8),16))>>>24,i[1]=r>>>16&255,i[2]=r>>>8&255,i[3]=r&255,i[4]=(r=parseInt(n.slice(9,13),16))>>>8,i[5]=r&255,i[6]=(r=parseInt(n.slice(14,18),16))>>>8,i[7]=r&255,i[8]=(r=parseInt(n.slice(19,23),16))>>>8,i[9]=r&255,i[10]=(r=parseInt(n.slice(24,36),16))/1099511627776&255,i[11]=r/4294967296&255,i[12]=r>>>24&255,i[13]=r>>>16&255,i[14]=r>>>8&255,i[15]=r&255,i}var pB=Qwr;function Ywr(n){n=unescape(encodeURIComponent(n));let r=[];for(let i=0;i<n.length;++i)r.push(n.charCodeAt(i));return r}var Kwr="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Xwr="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function HJe(n,r,i){function a(l,p,_,b){var T;if(typeof l=="string"&&(l=Ywr(l)),typeof p=="string"&&(p=pB(p)),((T=p)===null||T===void 0?void 0:T.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let E=new Uint8Array(16+l.length);if(E.set(p),E.set(l,p.length),E=i(E),E[6]=E[6]&15|r,E[8]=E[8]&63|128,_){b=b||0;for(let k=0;k<16;++k)_[b+k]=E[k];return _}return mxe(E)}try{a.name=n}catch{}return a.DNS=Kwr,a.URL=Xwr,a}var u2t=su(require("crypto")),QJe={randomUUID:u2t.default.randomUUID};function Zwr(n,r,i){if(QJe.randomUUID&&!r&&!n)return QJe.randomUUID();n=n||{};let a=n.random||(n.rng||GJe)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,r){i=i||0;for(let l=0;l<16;++l)r[i+l]=a[l];return r}return mxe(a)}var dB=Zwr;var f2t=su(require("crypto"));function eAr(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),f2t.default.createHash("sha1").update(n).digest()}var p2t=eAr;var tAr=HJe("v5",80,p2t),FL=tAr;var rAr="4d2cacb5-5b53-4da4-b120-709089990e91",YJe=class{generateNew(){return dB()}generateNewPredictable(r){return FL(r,rAr)}validate(r){return X6(r)}parse(r){return pB(r)}},KJe=new YJe;var sAr=(n,r)=>{let i=r===void 0?"string":r,a=Object.keys(n).map(l=>n[l]);if(i==="string")return a;if(i==="number")return a.map(l=>parseInt(l)).filter(l=>!isNaN(l));throw new Error(`result type "${r}" is not supported in EnumUtil.getAllValues`)},Nk={getAllValues:sAr},d2t=Nk;var g2t=(p=>(p.Second="s",p.Minute="m",p.Hour="h",p.Day="d",p.Week="w",p))(g2t||{}),_2t=d2t.getAllValues(g2t,"string"),m2t=/^\d{1,10}[smhdw]$/,h2t=/^\d+$/,XJe=[{unit:"w",factor:1},{unit:"d",factor:7},{unit:"h",factor:24},{unit:"m",factor:60},{unit:"s",factor:60}],Z6={isValidNonNegativeInteger:n=>h2t.test(n.trim()),isValidDuration:n=>m2t.test(n.trim()),toString:n=>n.unit?`${n.value}${n.unit}`:`${n.value}`,parse:n=>{let r=n.trim();if(h2t.test(r))return{value:parseInt(r,10)};Yb.should(m2t.test(r),`invalid input for duration: "${n}"`);let i=r[r.length-1];Yb.should(_2t.includes(i),`invalid time unit in "${n}". Unit "${i}" should be one of ${_2t.join(", ")} `);let a=i;return{value:parseInt(r.substring(0,r.length-1)),unit:a}},toSeconds:n=>{if(!n.unit)return n.value;let r=XJe.findIndex(a=>a.unit===n.unit);Yb.should(r>=0,`Cannot convert duration with time unit: ${n.unit}. No mapping was found`);let i=n.value;for(let a=r+1;a<XJe.length;a++)i=i*XJe[a].factor;return i}};var v2t="\\",ZJe="/",y2t=[ZJe,v2t],eUe=class{constructor(){this._pathSeparator=typeof process<"u"&&process.platform==="win32"?v2t:ZJe;this._pathSeparatorChanged=!1}get pathSeparator(){return this._pathSeparator}set pathSeparator(r){Yb.should(!this._pathSeparatorChanged,`Path separator is already changed to ${this._pathSeparator}. For protection it can be set only once.`),Yb.should(y2t.includes(r),`Cannot set pathSeparator to '${r}'. It is invalid. It should be one of: ${y2t.join(",")}`),this._pathSeparatorChanged=!0,this._pathSeparator=r}joinTwo(r,i){if(r==="")return i;if(i==="")return r;let a=r.endsWith(this.pathSeparator)?r.slice(void 0,r.length-1):r,l=i.startsWith(this.pathSeparator)?i.slice(1):i;return`${a}${this.pathSeparator}${l}`}join(...r){return Yb.ensure(r.length>1,"Cannot join path for less than two paths"),r.slice(1).reduce((i,a)=>this.joinTwo(i,a),r[0])}areEqual(r,i){if(r===i)return!0;if(r===void 0||i===void 0)return!1;let a=r.startsWith(this.pathSeparator)?r.substring(1):r,l=i.startsWith(this.pathSeparator)?i.substring(1):i;return a.endsWith(this.pathSeparator)&&(a=a.substring(0,a.length-1)),l.endsWith(this.pathSeparator)&&(l=l.substring(0,l.length-1)),a===l}getExtensionFromPath(r){let i=r.lastIndexOf(this.pathSeparator),a=i===-1?0:i+1,l=r.substring(a),p=l.lastIndexOf(".");if(!(p===-1||p===l.length-1))return l.substring(p+1)}getFileNameFromPath(r){let i=r.lastIndexOf(this.pathSeparator);return i!==-1?r.substring(i+1):r}getFileNameFromPathWithoutExtension(r){let i=this.getFileNameFromPath(r),a=this.getExtensionFromPath(r);return a?i.replace("."+a,""):i}isFileOnRootLevel(r){let i=r.lastIndexOf(this.pathSeparator);return i===-1?!0:!r.substring(0,i).length}getPath(r,i){let a=this.pathSeparator===ZJe,l=`${r}${i}`;return r.endsWith(this.pathSeparator)&&i.startsWith(this.pathSeparator)&&(l=`${r}${i.slice(1)}`),!r.endsWith(this.pathSeparator)&&!i.startsWith(this.pathSeparator)&&(l=`${r}${this.pathSeparator}${i}`),a&&!l.startsWith(this.pathSeparator)?`${this.pathSeparator}${l}`:l}getPathWithoutFileName(r){if(this.isFileOnRootLevel(r))return this.pathSeparator;let i=r.lastIndexOf(this.pathSeparator);return r.substring(0,i)}rewriteFolderPath(r,i){Yb.ensure(r.startsWith(this.pathSeparator)&&r.endsWith(this.pathSeparator),"Path is not a folder path");let l=[...r.split(this.pathSeparator).filter(p=>p!=="").slice(0,-1),i];return`${this.pathSeparator}${l.join(this.pathSeparator)}${this.pathSeparator}`}getFolderPath(r,i){return`${r}${i}${this.pathSeparator}`}getFolders(r){let i=this.isFolderPath(r),a=r.split(this.pathSeparator).filter(l=>l!=="");return i?a:a.slice(0,-1)}isFolderPath(r){return r.endsWith(this.pathSeparator)}getParentFolderPath(r){let i=this.isFolderPath(r),a=this.getFolders(r);return a=i?a.slice(0,-1):a,`${a.join(this.pathSeparator)}${this.pathSeparator}`}},Ga=new eUe;function RL(n){return({unique_name:r,uniqueName:i})=>r===n||i===n}function hxe(n){return({id:r})=>r===n}var ph=n=>{if(n.length===0)return"";if(n.length===1)return`"${n[0]}"`;let r=n.slice(0,-1).join('", "'),i=n[n.length-1];return`"${r}" and "${i}"`};var gxe=su(b2t(),1),S2t=Symbol.for("Dexie"),yxe=globalThis[S2t]||(globalThis[S2t]=gxe.default);if(gxe.default.semVer!==yxe.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${gxe.default.semVer} and ${yxe.semVer}`);var{liveQuery:iin,mergeRanges:sin,rangesOverlap:oin,RangeSet:ain,cmp:cin,Entity:lin,PropModification:uin,replacePrefix:fin,add:pin,remove:din}=yxe;var vxe=yxe;var nUe=class extends vxe{constructor(r){super(r),this.version(1).stores({logs:`++id,
|
|
669
|
+
`)};var Jwr=n=>`${n} is required`,VJe=class n{constructor(r){this.ErrorConstructor=r}forError(r){return new n(r)}should(r,i){if(!r)throw new this.ErrorConstructor(i)}exists(r,i){this.should(r!=null,i),typeof r=="number"&&this.should(!isNaN(r),i)}notEmpty(r,i){let a=r!=null&&r.trim()!=="";this.should(a,i)}allRequired(r){r.forEach(([i,a])=>{let l=Jwr(a);typeof i=="string"&&this.notEmpty(i,l),this.exists(i,l)})}ensure(r,i){if(this.exists(r,i),!r)throw new this.ErrorConstructor(i);return r}ensureType(r,i,a){if(i(r))return r;throw new this.ErrorConstructor(a)}},vs=new VJe(Error),Yb=vs;var Uwr=n=>n?n instanceof Error?n.message:typeof n=="string"?n:`${n}`:"unknown error",a_={getErrorMessage(n,r){let i=Uwr(n);return r?.removeStartString&&i.startsWith(r.removeStartString)?i.substring(r.removeStartString.length).trim():i},getError(n){return new Error(this.getErrorMessage(n))},hasErrorCode:n=>{if(!n)return!1;let r=n.code;return r?typeof r=="string":!1},async executeQueryOrThrow(n){try{return await n()}catch(r){let i;if(r.response)try{i=(await r.response.json()).message}catch(l){i=`Could not get json error. Error ${a_.getErrorMessage(l)}. Original error: ${a_.getErrorMessage(r)}`}else i=`Error: ${a_.getErrorMessage(r)}`;let a=new Error(i);throw a.status=r.response?.status,a}}},pxe=a_;var WJe=class{async wait(r=50){return new Promise(i=>{setTimeout(()=>i(),r)})}async returnDelayed(r,i=300){return await this.wait(i),r}},drn=new WJe;var Vwr={cloneFunctions:!1},xC=class n{static deep(r,i={}){let a={...Vwr,...i};if(r==null)return r;let l=typeof r=="function";if(!l&&!(typeof r=="object"))return r;if(l)return a.cloneFunctions?r:void 0;if(Array.isArray(r))return r.map(_=>n.deep(_,a));if(r instanceof Date)return new Date(r.getTime());{let _={},b=Object.keys(r);for(let T of b)_[T]=n.deep(r[T],a);return _}}static cleanEmptyProperties(r){let i={};for(let a in r){let l=r[a];l===""||l===void 0||l===null||(typeof l=="object"?i[a]=n.cleanEmptyProperties(l):i[a]=l)}return i}};var Wwr=/token/i,zwr=/password/i,Gwr=/secret/i,a2t=[Wwr,zwr,Gwr],zJe=class{constructor(){this.undefinedString="[undefined]";this.functionString="[function]";this.circularString="[Circular]";this.obfuscatedString="***"}obfuscate(r){return typeof r=="string"?r==null?this.obfuscatedString:r.length<=6?this.obfuscatedString:r.length<=9?`${this.obfuscatedString}${r.substring(r.length-3)}`:`${r.substring(0,3)}${this.obfuscatedString}${r.substring(r.length-3)}`:this.obfuscatedString}getMaxObjectDepthError(r){return`Max object depth (${r.maxObjectDepth}) exceeded. Current depth: ${r.currentDepth}`}obfuscateObject(r,i,a,l=1){if(l>i.maxObjectDepth)return this.getMaxObjectDepthError({maxObjectDepth:i.maxObjectDepth,currentDepth:l});if(r instanceof Date)return r.toISOString();if(r instanceof Map){let p={};for(let[_,b]of r.entries()){let T=typeof _=="string"?_:i.jsonSerialize(_);a2t.some(E=>E.test(T))?p[T]=this.obfuscate(b):p[T]=this.obfuscateObject(b,i,a,l+1)}return p}if(r instanceof Set)return Array.from(r).map(p=>this.obfuscateObject(p,i,a,l+1));if(typeof r=="bigint")return r.toString();if(r===void 0)return i.serializeUndefined?this.undefinedString:r;if(typeof r=="function")return i.serializeFunctions?this.functionString:r;if(typeof r=="symbol")return i.serializeSymbols?r.toString():r;if(Array.isArray(r))return r.map(p=>this.obfuscateObject(p,i,a,l+1));if(r!==null&&typeof r=="object"){if(a.has(r))return this.circularString;a.add(r);let p={};for(let[_,b]of Object.entries(r))_.toLowerCase()!=="prototype"&&(typeof b=="function"&&!i.serializeFunctions||(typeof b=="string"&&a2t.some(T=>T.test(_))?p[_]=this.obfuscate(b):p[_]=this.obfuscateObject(b,i,a,l+1)));return p}return r}safeToString(r,i){let l=Object.assign({serializeUndefined:!0,serializeFunctions:!1,serializeSymbols:!1,rethrowErrors:!1,maxObjectDepth:10,jsonSerialize:JSON.stringify},i??{});try{let p=new WeakSet,_=this.obfuscateObject(r,l,p);return l.jsonSerialize(_,null,l.space)}catch(p){let _=`Error serializing object: ${pxe.getErrorMessage(p)}`;if(l.rethrowErrors)throw Error(_);return _}}},Srn=new zJe;var kO=n=>n!=null;var c2t=su(require("crypto")),_xe=new Uint8Array(256),dxe=_xe.length;function GJe(){return dxe>_xe.length-16&&(c2t.default.randomFillSync(_xe),dxe=0),_xe.slice(dxe,dxe+=16)}var l2t=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Hwr(n){return typeof n=="string"&&l2t.test(n)}var X6=Hwr;var Kb=[];for(let n=0;n<256;++n)Kb.push((n+256).toString(16).slice(1));function mxe(n,r=0){return(Kb[n[r+0]]+Kb[n[r+1]]+Kb[n[r+2]]+Kb[n[r+3]]+"-"+Kb[n[r+4]]+Kb[n[r+5]]+"-"+Kb[n[r+6]]+Kb[n[r+7]]+"-"+Kb[n[r+8]]+Kb[n[r+9]]+"-"+Kb[n[r+10]]+Kb[n[r+11]]+Kb[n[r+12]]+Kb[n[r+13]]+Kb[n[r+14]]+Kb[n[r+15]]).toLowerCase()}function Qwr(n){if(!X6(n))throw TypeError("Invalid UUID");let r,i=new Uint8Array(16);return i[0]=(r=parseInt(n.slice(0,8),16))>>>24,i[1]=r>>>16&255,i[2]=r>>>8&255,i[3]=r&255,i[4]=(r=parseInt(n.slice(9,13),16))>>>8,i[5]=r&255,i[6]=(r=parseInt(n.slice(14,18),16))>>>8,i[7]=r&255,i[8]=(r=parseInt(n.slice(19,23),16))>>>8,i[9]=r&255,i[10]=(r=parseInt(n.slice(24,36),16))/1099511627776&255,i[11]=r/4294967296&255,i[12]=r>>>24&255,i[13]=r>>>16&255,i[14]=r>>>8&255,i[15]=r&255,i}var pB=Qwr;function Ywr(n){n=unescape(encodeURIComponent(n));let r=[];for(let i=0;i<n.length;++i)r.push(n.charCodeAt(i));return r}var Kwr="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Xwr="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function HJe(n,r,i){function a(l,p,_,b){var T;if(typeof l=="string"&&(l=Ywr(l)),typeof p=="string"&&(p=pB(p)),((T=p)===null||T===void 0?void 0:T.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let E=new Uint8Array(16+l.length);if(E.set(p),E.set(l,p.length),E=i(E),E[6]=E[6]&15|r,E[8]=E[8]&63|128,_){b=b||0;for(let k=0;k<16;++k)_[b+k]=E[k];return _}return mxe(E)}try{a.name=n}catch{}return a.DNS=Kwr,a.URL=Xwr,a}var u2t=su(require("crypto")),QJe={randomUUID:u2t.default.randomUUID};function Zwr(n,r,i){if(QJe.randomUUID&&!r&&!n)return QJe.randomUUID();n=n||{};let a=n.random||(n.rng||GJe)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,r){i=i||0;for(let l=0;l<16;++l)r[i+l]=a[l];return r}return mxe(a)}var dB=Zwr;var f2t=su(require("crypto"));function eAr(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),f2t.default.createHash("sha1").update(n).digest()}var p2t=eAr;var tAr=HJe("v5",80,p2t),FL=tAr;var rAr="4d2cacb5-5b53-4da4-b120-709089990e91",YJe=class{generateNew(){return dB()}generateNewPredictable(r){return FL(r,rAr)}validate(r){return X6(r)}parse(r){return pB(r)}},KJe=new YJe;var sAr=(n,r)=>{let i=r===void 0?"string":r,a=Object.keys(n).map(l=>n[l]);if(i==="string")return a;if(i==="number")return a.map(l=>parseInt(l)).filter(l=>!isNaN(l));throw new Error(`result type "${r}" is not supported in EnumUtil.getAllValues`)},Nk={getAllValues:sAr},d2t=Nk;var g2t=(p=>(p.Second="s",p.Minute="m",p.Hour="h",p.Day="d",p.Week="w",p))(g2t||{}),_2t=d2t.getAllValues(g2t,"string"),m2t=/^\d{1,10}[smhdw]$/,h2t=/^\d+$/,XJe=[{unit:"w",factor:1},{unit:"d",factor:7},{unit:"h",factor:24},{unit:"m",factor:60},{unit:"s",factor:60}],Z6={isValidNonNegativeInteger:n=>h2t.test(n.trim()),isValidDuration:n=>m2t.test(n.trim()),toString:n=>n.unit?`${n.value}${n.unit}`:`${n.value}`,parse:n=>{let r=n.trim();if(h2t.test(r))return{value:parseInt(r,10)};Yb.should(m2t.test(r),`invalid input for duration: "${n}"`);let i=r[r.length-1];Yb.should(_2t.includes(i),`invalid time unit in "${n}". Unit "${i}" should be one of ${_2t.join(", ")} `);let a=i;return{value:parseInt(r.substring(0,r.length-1)),unit:a}},toSeconds:n=>{if(!n.unit)return n.value;let r=XJe.findIndex(a=>a.unit===n.unit);Yb.should(r>=0,`Cannot convert duration with time unit: ${n.unit}. No mapping was found`);let i=n.value;for(let a=r+1;a<XJe.length;a++)i=i*XJe[a].factor;return i}};var v2t="\\",ZJe="/",y2t=[ZJe,v2t],eUe=class{constructor(){this._pathSeparator=typeof process<"u"&&process.platform==="win32"?v2t:ZJe;this._pathSeparatorChanged=!1}get pathSeparator(){return this._pathSeparator}set pathSeparator(r){Yb.should(!this._pathSeparatorChanged,`Path separator is already changed to ${this._pathSeparator}. For protection it can be set only once.`),Yb.should(y2t.includes(r),`Cannot set pathSeparator to '${r}'. It is invalid. It should be one of: ${y2t.join(",")}`),this._pathSeparatorChanged=!0,this._pathSeparator=r}joinTwo(r,i){if(r==="")return i;if(i==="")return r;let a=r.endsWith(this.pathSeparator)?r.slice(void 0,r.length-1):r,l=i.startsWith(this.pathSeparator)?i.slice(1):i;return`${a}${this.pathSeparator}${l}`}join(...r){return Yb.ensure(r.length>1,"Cannot join path for less than two paths"),r.slice(1).reduce((i,a)=>this.joinTwo(i,a),r[0])}areEqual(r,i){if(r===i)return!0;if(r===void 0||i===void 0)return!1;let a=r.startsWith(this.pathSeparator)?r.substring(1):r,l=i.startsWith(this.pathSeparator)?i.substring(1):i;return a.endsWith(this.pathSeparator)&&(a=a.substring(0,a.length-1)),l.endsWith(this.pathSeparator)&&(l=l.substring(0,l.length-1)),a===l}getExtensionFromPath(r){let i=r.lastIndexOf(this.pathSeparator),a=i===-1?0:i+1,l=r.substring(a),p=l.lastIndexOf(".");if(!(p===-1||p===l.length-1))return l.substring(p+1)}getFileNameFromPath(r){let i=r.lastIndexOf(this.pathSeparator);return i!==-1?r.substring(i+1):r}getFileNameFromPathWithoutExtension(r){let i=this.getFileNameFromPath(r),a=this.getExtensionFromPath(r);return a?i.replace("."+a,""):i}isFileOnRootLevel(r){let i=r.lastIndexOf(this.pathSeparator);return i===-1?!0:!r.substring(0,i).length}getPath(r,i){let a=this.pathSeparator===ZJe,l=`${r}${i}`;return r.endsWith(this.pathSeparator)&&i.startsWith(this.pathSeparator)&&(l=`${r}${i.slice(1)}`),!r.endsWith(this.pathSeparator)&&!i.startsWith(this.pathSeparator)&&(l=`${r}${this.pathSeparator}${i}`),a&&!l.startsWith(this.pathSeparator)?`${this.pathSeparator}${l}`:l}getPathWithoutFileName(r){if(this.isFileOnRootLevel(r))return this.pathSeparator;let i=r.lastIndexOf(this.pathSeparator);return r.substring(0,i)}rewriteFolderPath(r,i){Yb.ensure(r.startsWith(this.pathSeparator)&&r.endsWith(this.pathSeparator),"Path is not a folder path");let l=[...r.split(this.pathSeparator).filter(p=>p!=="").slice(0,-1),i];return`${this.pathSeparator}${l.join(this.pathSeparator)}${this.pathSeparator}`}getFolderPath(r,i){return`${r}${i}${this.pathSeparator}`}getFolders(r){let i=this.isFolderPath(r),a=r.split(this.pathSeparator).filter(l=>l!=="");return i?a:a.slice(0,-1)}isFolderPath(r){return r.endsWith(this.pathSeparator)}getParentFolderPath(r){let i=this.isFolderPath(r),a=this.getFolders(r);return a=i?a.slice(0,-1):a,`${a.join(this.pathSeparator)}${this.pathSeparator}`}},Ga=new eUe;function RL(n){return({unique_name:r,uniqueName:i})=>r===n||i===n}function hxe(n){return({id:r})=>r===n}var ph=n=>{if(n.length===0)return"";if(n.length===1)return`"${n[0]}"`;let r=n.slice(0,-1).join('", "'),i=n[n.length-1];return`"${r}" and "${i}"`};var gxe=su(b2t(),1),S2t=Symbol.for("Dexie"),yxe=globalThis[S2t]||(globalThis[S2t]=gxe.default);if(gxe.default.semVer!==yxe.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${gxe.default.semVer} and ${yxe.semVer}`);var{liveQuery:iin,mergeRanges:sin,rangesOverlap:oin,RangeSet:ain,cmp:cin,Entity:lin,PropModification:uin,replacePrefix:fin,add:pin,remove:din}=yxe;var vxe=yxe;var nUe=class extends vxe{constructor(r){super(r),this.version(1).stores({logs:`++id,
|
|
670
670
|
timestamp,
|
|
671
671
|
level,
|
|
672
|
-
loggerName`})}},oAr=new nUe("LogsDB");function bxe(n){return n=n.replace(/^(https:\/\/|git@)/,""),n=n.replace(":","/"),n.replace(/\.git$/,"").toLowerCase()}var HH=n=>n.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/.*$/gm,"").replace(/--.*$/gm,"");var pA=n=>{let r=/(?<=\[Measures\]\.\[).+?(?=])/g;return HH(n).match(r)||[]};var Eoe=class{static firstDefined(...r){let i=r.find(a=>a==null?!1:typeof a=="string"?a!=="":!0);return Yb.ensure(i,"Cannot get first defined value. All are undefined, null or empty string.")}};var aAr={maxAttempts:3,initialDelayMs:20,maxDelayMs:1e3,backoffMultiplier:2,shouldRetry:()=>!0},iUe=class{async execute(r,i={}){let a={...aAr,...i};Yb.should(a.maxAttempts>0,"Execution aborted: maxAttempts is less than or equal to 0"),Yb.should(a.initialDelayMs>=0,`Execution aborted: initialDelayMs (${a.initialDelayMs}) must be >= 0`),Yb.should(a.maxDelayMs>=0,`Execution aborted: maxDelayMs (${a.maxDelayMs}) must be >= 0`),Yb.should(a.backoffMultiplier>=1,`Execution aborted: backoffMultiplier (${a.backoffMultiplier}) must be >= 1`),Yb.should(a.initialDelayMs<=a.maxDelayMs,`Execution aborted: initialDelayMs (${a.initialDelayMs}) must not exceed maxDelayMs (${a.maxDelayMs})`);let l=a.initialDelayMs;for(let p=1;p<=a.maxAttempts;p++)try{return await r()}catch(_){if(p===a.maxAttempts||!a.shouldRetry(_))throw _;await new Promise(b=>setTimeout(b,l)),l=Math.min(l*a.backoffMultiplier,a.maxDelayMs)}throw new Error("Retry loop exited without returning or throwing.")}},gsn=new iUe;var sUe=/\$\$?\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g;function D2t(n,r){return n.replace(sUe,(i,a)=>i.startsWith("$$")?i.slice(1):r[a]??"")}function Sxe(n){for(let r of n.matchAll(sUe))if(!r[0].startsWith("$$"))return!0;return!1}function x2t(n){let r=new Set;for(let i of n.matchAll(sUe)){let[a,l]=i;a.startsWith("$$")||r.add(l)}return[...r]}var hl=(j=>(j.Catalog="catalog",j.Model="model",j.ModelSettings="model_settings",j.GlobalSettings="global_settings",j.Dimension="dimension",j.Dataset="dataset",j.Metric="metric",j.MetricCalc="metric_calc",j.Connection="connection",j.RowSecurity="row_security",j.CompositeModel="composite_model",j))(hl||{});var cAr={connection:[{path:"unique_name",allowTemplate:!1},{path:"object_type",allowTemplate:!1},{path:"*",allowTemplate:!0}],dataset:[{path:"sql",allowTemplate:!0},{path:"dialects[*].sql",allowTemplate:!0},{path:"*",allowTemplate:!1}]};function lAr(n,r){if(n==="*")return!0;let i="^"+n.replace(/\./g,"\\.").replace(/\[\*\]/g,"\\[\\d+\\]").replace(/\*/g,"[^.\\[\\]]+")+"$";return new RegExp(i).test(r)}function uAr(n,r){for(let i of r)if(lAr(i.path,n))return i.allowTemplate;return!0}function fAr(n,r){let a=x2t(n).filter(l=>!(l in r));if(a.length)throw new Error(`The variable \${${a[0]}} is not defined in the .env file or the engine environment variables (sml.environment.variables). Please add ${a[0]}="your_value_here" to the .env file or configure it in the engine settings to resolve this issue.`)}function Dxe(n,r,i,a=""){if(!i)return n;let l=cAr[r]||[];if(typeof n=="string"){let p=Sxe(n);if(p&&!uAr(a,l))throw new Error(`Variables cannot be used in the "${a}" field. Please provide a fixed value.`);return p?(fAr(n,i),D2t(n,i)):n}if(Array.isArray(n))return n.map((p,_)=>Dxe(p,r,i,`${a}[${_}]`));if(n&&typeof n=="object"){let p={};for(let _ in n)if(n.hasOwnProperty(_)){let b=a?`${a}.${_}`:_;p[_]=Dxe(n[_],r,i,b)}return p}return n}var oUe=["connection","dataset"];var T2t=su(Dse()),woe=class n{static create(){return new n}parse(r){return{...r,data:T2t.parse(r.rawContent),compilationOutput:[]}}};var Aoe=class n{static create(){return new n}parse(r){return{...r,data:JSON.parse(r.rawContent),compilationOutput:[]}}};var ML=class n{static create(){return new n}parse(r){let i=cxe(r.rawContent,{schema:axe});return{...r,data:i,compilationOutput:[]}}};var pAr={yaml:ML.create(),yml:ML.create(),json:Aoe.create(),env:woe.create()},_B=class n{constructor(r=pAr){this.mappings=r}static create(){return new n}parseRawContent(r,i="yaml"){let a={rawContent:r,relativePath:`name.${i}`};return this.parse(a).data}parse(r){let i=Ga.getExtensionFromPath(r.relativePath);return i?(this.mappings[i]||this.defaultParser()).parse(r):this.defaultParser().parse(r)}defaultParser(){return{parse(r){return{...r,data:r.rawContent,compilationOutput:[]}},parseRawContent(r){return r}}}};var dAr=n=>n.trim()===""||n.trim().startsWith("#")?!0:/^[A-Za-z_]+[A-Za-z0-9_]*=(.*)$/.test(n),Ioe=class{getErrors(r){let i=[];return r.split(/\r?\n/).forEach((l,p)=>{dAr(l)||i.push(`Invalid format at line ${p+1}: "${l}"`)}),i}};var koe=class{getErrors(r){try{return JSON.parse(r),[]}catch(i){return typeof i=="string"?[i]:i instanceof Error?[i.message]:[`${i}`]}}};var QH=class{getErrors(r){let i=[];try{GH.load(r)}catch(a){a instanceof lxe?i.push(a.message):i.push(`Unknown yaml parsing error: ${a_.getErrorMessage(a)}`)}return i}};var _Ar={yml:new QH,yaml:new QH,json:new koe,env:new Ioe},Poe=class{constructor(r=_Ar){this.mappings=r}getValidator(r){let i=this.getExtensionFromPath(r);return i?this.mappings[i]||this.dummyValidator():this.dummyValidator()}dummyValidator(){return{getErrors:()=>[]}}getExtensionFromPath(r){let i=r.lastIndexOf("/"),a=i===-1?0:i+1,l=r.substring(a),p=l.lastIndexOf(".");if(!(p===-1||p===l.length-1))return l.substring(p+1)}};var Ok=class{static traverse(r,i){r.files.forEach(i),r.folders.flatMap(a=>this.traverse(a,i))}};var aUe={unknownObjectTypeWarning:"Unknown object type. File will be skipped.",notSupportedObjectTypeError:n=>`Not supported object type ${n}`},mB=class{getType(r,i){let a=r.data;if(!a||!a.object_type){r.compilationOutput.push({message:aUe.unknownObjectTypeWarning,severity:"warning"}),i.file(r).addWarning(aUe.unknownObjectTypeWarning);return}if(!Object.values(hl).filter(p=>isNaN(Number(p))).includes(a.object_type)){i.file(r).addError(aUe.notSupportedObjectTypeError(a.object_type));return}return a.object_type}};var mAr=n=>zo.hasProps("rawContent")&&(n.rawContent||"").length>0,Noe=n=>({relativePath:n.relativePath,compilationOutput:[],origin:n.origin,type:"Unknown",data:n.data,rawContent:n.rawContent,packageName:n.packageName}),LL=class{constructor(r={}){this.compilerSettings=r.compilerSettings||{amlFileExtensions:["yaml","yml"]},this.fileTypeValidationFactory=r.fileTypeValidationFactory||new Poe,this.yamlObjectTypeExtractor=r.yamlObjectTypeExtractor||new mB,this.fileParser=r.fileParser||new _B}parseFolderStructure(r,i,a){let l=r.files.find(E=>E.relativePath===Y6.relativePath),p=l?this.parseFile(l,i):void 0,_=p?.data,b=a||_?{...a,..._}:void 0;l&&(r.files=r.files.filter(E=>E.relativePath!==Y6.relativePath)??[]);let T=this.parseFolderStructureInternal(r,i,b);return p&&T.files.push(p),T}parseFolderStructureInternal(r,i,a,l=1){if(l>=50){let _=`Max folder depth exceed. Max folder depth is 50. Current folder path: ${r.path}`;throw i.global().addError(_),new K6(_)}let p={path:r.path,origin:r.origin,files:[],folders:[],packageName:r.packageName};return p.files=r.files.map(_=>this.parseFile(_,i,a)),p.folders=r.folders.map(_=>this.parseFolderStructureInternal(_,i,a,l+1)),p}getTextFile(r){return{...r,type:fh.Text,data:void 0}}getEnvFile(r,i){return{...r,type:fh.Environment,data:i}}parseFile(r,i,a){let l=[...this.compilerSettings.amlFileExtensions,kL,...AO];if(!this.hasValidExtension(l,r))return i.file(r).addInfo("File is not recognized as atscale file and will be skipped"),Noe(r);let p=this.compilerSettings.amlFileExtensions.includes(Ga.getExtensionFromPath(r.relativePath)||""),_=z1.isEnvFile(r);if(_&&!Ga.isFileOnRootLevel(r.relativePath)&&i.file(r).addWarning("Environment files should be on root level"),mAr(r)){let T=this.fileTypeValidationFactory.getValidator(r.relativePath).getErrors(r.rawContent);if(T.length>0)return T.forEach(j=>{i.file(r).addWarning(j)}),_?this.getEnvFile(r):p?this.getTextFile(r):Noe(r);let E={},k;try{E=this.fileParser.parse(r);let j=Ga.getExtensionFromPath(r.relativePath)||"";k=AO.includes(j)?void 0:this.yamlObjectTypeExtractor.getType(E,i),E=this.handleEnvironmentVariableInParsedFile({file:E,objectType:k,environmentVariables:a,validatorOutput:i})}catch(j){return i.file(r).addError(`File content is invalid. It cannot be parsed. ${a_.getErrorMessage(j)}`),_?this.getEnvFile(r):p?this.getTextFile(r):Noe(r)}if(k){let j=uxe(r.rawContent)||void 0;return{...r,type:k,data:E.data,rawContent:j?fxe(r.rawContent):r.rawContent,headerComments:j}}else return _?this.getEnvFile(r,E.data):z1.isTextFile(r)||p?this.getTextFile(r):Noe(r)}else return _?(i.file(r).addWarning("Environment file is empty"),this.getEnvFile(r)):z1.isTextFile(r)?this.getTextFile(r):(i.file(r).addInfo("File has no rawContent and will be skipped"),Noe(r))}extractYamlFiles(r){let i=[];return Ok.traverse(r,a=>{if(z1.isYamlFile(a)&&this.hasValidExtension(this.compilerSettings.amlFileExtensions,a)){if(this.isFileTypeCatalog(a.type)&&a.origin!=="R")return;i.push(a)}}),i}hasValidExtension(r,i){let a=Ga.getExtensionFromPath(i.relativePath);return!!a&&r.includes(a)}getYamlFilesWithValidObjectType(r,i){let a=[];return r.forEach(l=>{z1.isYamlFile(l)&&this.yamlObjectTypeExtractor.getType(l,i)&&a.push(l)}),a}isFileTypeCatalog(r){return r===fh.Catalog}handleEnvironmentVariableInParsedFile({file:r,objectType:i,environmentVariables:a,validatorOutput:l}){if(!Sxe(r.rawContent))return r;if(i&&!oUe.includes(i))return l.file(r).addError(`Variable placeholders (e.g., \${VARIABLE_NAME}) were detected in a ${i} file. Variable replacement is only supported for the following file types: ${oUe.join(", ")}.`),r;if(!a)return l.file(r).addError("Referenced variables were detected, but no environment variables are configured. Please create a .env file or configure the engine environment variables (sml.environment.variables)."),r;let _=r.data;try{_=this.replaceVariablesInData(r.data,a)}catch(b){return l.file(r).addError(a_.getErrorMessage(b)),r}return{...r,data:_}}replaceVariablesInData(r,i){return Dxe(r,r.object_type,i)}};var TC="package.yml";var hAr=n=>`${n} is required`,cUe=class n{constructor(r){this.ErrorConstructor=r}forError(r){return new n(r)}should(r,i){if(!r)throw new this.ErrorConstructor(i)}exists(r,i){this.should(r!=null,i),typeof r=="number"&&this.should(!isNaN(r),i)}notEmpty(r,i){let a=r!=null&&r.trim()!=="";this.should(a,i)}allRequired(r){r.forEach(([i,a])=>{let l=hAr(a);typeof i=="string"&&this.notEmpty(i,l),this.exists(i,l)})}ensure(r,i){if(this.exists(r,i),!r)throw new this.ErrorConstructor(i);return r}ensureType(r,i,a){if(i(r))return r;throw new this.ErrorConstructor(a)}},Ooe=new cUe(Error),r2=Ooe;var gAr=function(n,r,i,a){function l(p){return p instanceof i?p:new i(function(_){_(p)})}return new(i||(i=Promise))(function(p,_){function b(k){try{E(a.next(k))}catch(j){_(j)}}function T(k){try{E(a.throw(k))}catch(j){_(j)}}function E(k){k.done?p(k.value):l(k.value).then(b,T)}E((a=a.apply(n,r||[])).next())})},yAr=n=>n?n instanceof Error?n.message:typeof n=="string"?n:`${n}`:"unknown error",Fk={getErrorMessage(n,r){let i=yAr(n);return r?.removeStartString&&i.startsWith(r.removeStartString)?i.substring(r.removeStartString.length).trim():i},getError(n){return new Error(this.getErrorMessage(n))},hasErrorCode:n=>{if(!n)return!1;let r=n.code;return r?typeof r=="string":!1},executeQueryOrThrow(n){return gAr(this,void 0,void 0,function*(){try{return yield n()}catch(r){let i;if(r.response)try{i=(yield r.response.json()).message}catch(a){i=`Could not get json error. Error ${Fk.getErrorMessage(a)}. Original error: ${Fk.getErrorMessage(r)}`}else i=`Error: ${Fk.getErrorMessage(r)}`;throw new Error(i)}})}},xxe=Fk;var C2t=function(n,r,i,a){function l(p){return p instanceof i?p:new i(function(_){_(p)})}return new(i||(i=Promise))(function(p,_){function b(k){try{E(a.next(k))}catch(j){_(j)}}function T(k){try{E(a.throw(k))}catch(j){_(j)}}function E(k){k.done?p(k.value):l(k.value).then(b,T)}E((a=a.apply(n,r||[])).next())})},lUe=class{wait(r=50){return C2t(this,void 0,void 0,function*(){return new Promise(i=>{setTimeout(()=>i(),r)})})}returnDelayed(r,i=300){return C2t(this,void 0,void 0,function*(){return yield this.wait(i),r})}},Pon=new lUe;var vAr={cloneFunctions:!1},YH=class n{static deep(r,i={}){let a=Object.assign(Object.assign({},vAr),i);if(r==null)return r;let l=typeof r=="function";if(!l&&!(typeof r=="object"))return r;if(l)return a.cloneFunctions?r:void 0;if(Array.isArray(r))return r.map(_=>n.deep(_,a));if(r instanceof Date)return new Date(r.getTime());{let _={},b=Object.keys(r);for(let T of b)_[T]=n.deep(r[T],a);return _}}static cleanEmptyProperties(r){let i={};for(let a in r){let l=r[a];l===""||l===void 0||l===null||(typeof l=="object"?i[a]=n.cleanEmptyProperties(l):i[a]=l)}return i}};var bAr=/token/i,SAr=/password/i,DAr=/secret/i,E2t=[bAr,SAr,DAr],uUe=class{constructor(){this.undefinedString="[undefined]",this.functionString="[function]",this.circularString="[Circular]",this.obfuscatedString="***"}obfuscate(r){return typeof r=="string"?r==null?this.obfuscatedString:r.length<=6?this.obfuscatedString:r.length<=9?`${this.obfuscatedString}${r.substring(r.length-3)}`:`${r.substring(0,3)}${this.obfuscatedString}${r.substring(r.length-3)}`:this.obfuscatedString}getMaxObjectDepthError(r){return`Max object depth (${r.maxObjectDepth}) exceeded. Current depth: ${r.currentDepth}`}obfuscateObject(r,i,a,l=1){if(l>i.maxObjectDepth)return this.getMaxObjectDepthError({maxObjectDepth:i.maxObjectDepth,currentDepth:l});if(r instanceof Date)return r.toISOString();if(r instanceof Map){let p={};for(let[_,b]of r.entries()){let T=typeof _=="string"?_:i.jsonSerialize(_);E2t.some(E=>E.test(T))?p[T]=this.obfuscate(b):p[T]=this.obfuscateObject(b,i,a,l+1)}return p}if(r instanceof Set)return Array.from(r).map(p=>this.obfuscateObject(p,i,a,l+1));if(typeof r=="bigint")return r.toString();if(r===void 0)return i.serializeUndefined?this.undefinedString:r;if(typeof r=="function")return i.serializeFunctions?this.functionString:r;if(typeof r=="symbol")return i.serializeSymbols?r.toString():r;if(Array.isArray(r))return r.map(p=>this.obfuscateObject(p,i,a,l+1));if(r!==null&&typeof r=="object"){if(a.has(r))return this.circularString;a.add(r);let p={};for(let[_,b]of Object.entries(r))_.toLowerCase()!=="prototype"&&(typeof b=="function"&&!i.serializeFunctions||(typeof b=="string"&&E2t.some(T=>T.test(_))?p[_]=this.obfuscate(b):p[_]=this.obfuscateObject(b,i,a,l+1)));return p}return r}safeToString(r,i){let l=Object.assign({serializeUndefined:!0,serializeFunctions:!1,serializeSymbols:!1,rethrowErrors:!1,maxObjectDepth:10,jsonSerialize:JSON.stringify},i??{});try{let p=new WeakSet,_=this.obfuscateObject(r,l,p);return l.jsonSerialize(_,null,l.space)}catch(p){let _=`Error serializing object: ${xxe.getErrorMessage(p)}`;if(l.rethrowErrors)throw Error(_);return _}}},qon=new uUe;var xAr="4d2cacb5-5b53-4da4-b120-709089990e91",fUe=class{generateNew(){return dB()}generateNewPredictable(r){return FL(r,xAr)}validate(r){return X6(r)}parse(r){return pB(r)}},pUe=new fUe;var TAr=(n,r)=>{let i=r===void 0?"string":r,a=Object.keys(n).map(l=>n[l]);if(i==="string")return a;if(i==="number")return a.map(l=>parseInt(l)).filter(l=>!isNaN(l));throw new Error(`result type "${r}" is not supported in EnumUtil.getAllValues`)},CAr={getAllValues:TAr},w2t=CAr;var jL;(function(n){n.Second="s",n.Minute="m",n.Hour="h",n.Day="d",n.Week="w"})(jL||(jL={}));var nan=w2t.getAllValues(jL,"string");var ian=[{unit:jL.Week,factor:1},{unit:jL.Day,factor:7},{unit:jL.Hour,factor:24},{unit:jL.Minute,factor:60},{unit:jL.Second,factor:60}];var I2t="\\",dUe="/",A2t=[dUe,I2t],_Ue=class{constructor(){this._pathSeparator=typeof process<"u"&&process.platform==="win32"?I2t:dUe,this._pathSeparatorChanged=!1}get pathSeparator(){return this._pathSeparator}set pathSeparator(r){r2.should(!this._pathSeparatorChanged,`Path separator is already changed to ${this._pathSeparator}. For protection it can be set only once.`),r2.should(A2t.includes(r),`Cannot set pathSeparator to '${r}'. It is invalid. It should be one of: ${A2t.join(",")}`),this._pathSeparatorChanged=!0,this._pathSeparator=r}joinTwo(r,i){if(r==="")return i;if(i==="")return r;let a=r.endsWith(this.pathSeparator)?r.slice(void 0,r.length-1):r,l=i.startsWith(this.pathSeparator)?i.slice(1):i;return`${a}${this.pathSeparator}${l}`}join(...r){return r2.ensure(r.length>1,"Cannot join path for less than two paths"),r.slice(1).reduce((i,a)=>this.joinTwo(i,a),r[0])}areEqual(r,i){if(r===i)return!0;if(r===void 0||i===void 0)return!1;let a=r.startsWith(this.pathSeparator)?r.substring(1):r,l=i.startsWith(this.pathSeparator)?i.substring(1):i;return a.endsWith(this.pathSeparator)&&(a=a.substring(0,a.length-1)),l.endsWith(this.pathSeparator)&&(l=l.substring(0,l.length-1)),a===l}getExtensionFromPath(r){let i=r.lastIndexOf(this.pathSeparator),a=i===-1?0:i+1,l=r.substring(a),p=l.lastIndexOf(".");if(!(p===-1||p===l.length-1))return l.substring(p+1)}getFileNameFromPath(r){let i=r.lastIndexOf(this.pathSeparator);return i!==-1?r.substring(i+1):r}getFileNameFromPathWithoutExtension(r){let i=this.getFileNameFromPath(r),a=this.getExtensionFromPath(r);return a?i.replace("."+a,""):i}isFileOnRootLevel(r){let i=r.lastIndexOf(this.pathSeparator);return i===-1?!0:!r.substring(0,i).length}getPath(r,i){let a=this.pathSeparator===dUe,l=`${r}${i}`;return r.endsWith(this.pathSeparator)&&i.startsWith(this.pathSeparator)&&(l=`${r}${i.slice(1)}`),!r.endsWith(this.pathSeparator)&&!i.startsWith(this.pathSeparator)&&(l=`${r}${this.pathSeparator}${i}`),a&&!l.startsWith(this.pathSeparator)?`${this.pathSeparator}${l}`:l}getPathWithoutFileName(r){if(this.isFileOnRootLevel(r))return this.pathSeparator;let i=r.lastIndexOf(this.pathSeparator);return r.substring(0,i)}rewriteFolderPath(r,i){r2.ensure(r.startsWith(this.pathSeparator)&&r.endsWith(this.pathSeparator),"Path is not a folder path");let l=[...r.split(this.pathSeparator).filter(p=>p!=="").slice(0,-1),i];return`${this.pathSeparator}${l.join(this.pathSeparator)}${this.pathSeparator}`}getFolderPath(r,i){return`${r}${i}${this.pathSeparator}`}getFolders(r){let i=this.isFolderPath(r),a=r.split(this.pathSeparator).filter(l=>l!=="");return i?a:a.slice(0,-1)}isFolderPath(r){return r.endsWith(this.pathSeparator)}getParentFolderPath(r){let i=this.isFolderPath(r),a=this.getFolders(r);return a=i?a.slice(0,-1):a,`${a.join(this.pathSeparator)}${this.pathSeparator}`}},EAr=new _Ue;var k2t=n=>n.replace(/(['"\w])\s+(?=[A-Za-z_][A-Za-z0-9_]*=)/g,`$1
|
|
672
|
+
loggerName`})}},oAr=new nUe("LogsDB");function bxe(n){return n=n.replace(/^(https:\/\/|git@)/,""),n=n.replace(":","/"),n.replace(/\.git$/,"").toLowerCase()}var HH=n=>n.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/.*$/gm,"").replace(/--.*$/gm,"");var pA=n=>{let r=/(?<=\[Measures\]\.\[).+?(?=])/g;return HH(n).match(r)||[]};var Eoe=class{static firstDefined(...r){let i=r.find(a=>a==null?!1:typeof a=="string"?a!=="":!0);return Yb.ensure(i,"Cannot get first defined value. All are undefined, null or empty string.")}};var aAr={maxAttempts:3,initialDelayMs:20,maxDelayMs:1e3,backoffMultiplier:2,shouldRetry:()=>!0},iUe=class{async execute(r,i={}){let a={...aAr,...i};Yb.should(a.maxAttempts>0,"Execution aborted: maxAttempts is less than or equal to 0"),Yb.should(a.initialDelayMs>=0,`Execution aborted: initialDelayMs (${a.initialDelayMs}) must be >= 0`),Yb.should(a.maxDelayMs>=0,`Execution aborted: maxDelayMs (${a.maxDelayMs}) must be >= 0`),Yb.should(a.backoffMultiplier>=1,`Execution aborted: backoffMultiplier (${a.backoffMultiplier}) must be >= 1`),Yb.should(a.initialDelayMs<=a.maxDelayMs,`Execution aborted: initialDelayMs (${a.initialDelayMs}) must not exceed maxDelayMs (${a.maxDelayMs})`);let l=a.initialDelayMs;for(let p=1;p<=a.maxAttempts;p++)try{return await r()}catch(_){if(p===a.maxAttempts||!a.shouldRetry(_))throw _;await new Promise(b=>setTimeout(b,l)),l=Math.min(l*a.backoffMultiplier,a.maxDelayMs)}throw new Error("Retry loop exited without returning or throwing.")}},gsn=new iUe;var sUe=/\$\$?\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g;function D2t(n,r){return n.replace(sUe,(i,a)=>i.startsWith("$$")?i.slice(1):r[a]??"")}function Sxe(n){for(let r of n.matchAll(sUe))if(!r[0].startsWith("$$"))return!0;return!1}function x2t(n){let r=new Set;for(let i of n.matchAll(sUe)){let[a,l]=i;a.startsWith("$$")||r.add(l)}return[...r]}var hl=(j=>(j.Catalog="catalog",j.Model="model",j.ModelSettings="model_settings",j.GlobalSettings="global_settings",j.Dimension="dimension",j.Dataset="dataset",j.Metric="metric",j.MetricCalc="metric_calc",j.Connection="connection",j.RowSecurity="row_security",j.CompositeModel="composite_model",j))(hl||{});var cAr={connection:[{path:"unique_name",allowTemplate:!1},{path:"object_type",allowTemplate:!1},{path:"*",allowTemplate:!0}],dataset:[{path:"sql",allowTemplate:!0},{path:"dialects[*].sql",allowTemplate:!0},{path:"*",allowTemplate:!1}]};function lAr(n,r){if(n==="*")return!0;let i="^"+n.replace(/\./g,"\\.").replace(/\[\*\]/g,"\\[\\d+\\]").replace(/\*/g,"[^.\\[\\]]+")+"$";return new RegExp(i).test(r)}function uAr(n,r){for(let i of r)if(lAr(i.path,n))return i.allowTemplate;return!0}function fAr(n,r){let a=x2t(n).filter(l=>!(l in r));if(a.length)throw new Error(`The variable \${${a[0]}} is not defined in the .env file or the engine environment variables (sml.environment.variables). Please add ${a[0]}="your_value_here" to the .env file or configure it in the engine settings to resolve this issue.`)}function Dxe(n,r,i,a=""){if(!i)return n;let l=cAr[r]||[];if(typeof n=="string"){let p=Sxe(n);if(p&&!uAr(a,l))throw new Error(`Variables cannot be used in the "${a}" field. Please provide a fixed value.`);return p?(fAr(n,i),D2t(n,i)):n}if(Array.isArray(n))return n.map((p,_)=>Dxe(p,r,i,`${a}[${_}]`));if(n&&typeof n=="object"){let p={};for(let _ in n)if(n.hasOwnProperty(_)){let b=a?`${a}.${_}`:_;p[_]=Dxe(n[_],r,i,b)}return p}return n}var oUe=["connection","dataset"];var T2t=su(Dse()),woe=class n{static create(){return new n}parse(r){return{...r,data:T2t.parse(r.rawContent),compilationOutput:[]}}};var Aoe=class n{static create(){return new n}parse(r){return{...r,data:JSON.parse(r.rawContent),compilationOutput:[]}}};var ML=class n{static create(){return new n}parse(r){let i=cxe(r.rawContent,{schema:axe});return{...r,data:i,compilationOutput:[]}}};var pAr={yaml:ML.create(),yml:ML.create(),json:Aoe.create(),env:woe.create()},_B=class n{constructor(r=pAr){this.mappings=r}static create(){return new n}parseRawContent(r,i="yaml"){let a={rawContent:r,relativePath:`name.${i}`};return this.parse(a).data}parse(r){let i=Ga.getExtensionFromPath(r.relativePath);return i?(this.mappings[i]||this.defaultParser()).parse(r):this.defaultParser().parse(r)}defaultParser(){return{parse(r){return{...r,data:r.rawContent,compilationOutput:[]}},parseRawContent(r){return r}}}};var dAr=n=>n.trim()===""||n.trim().startsWith("#")?!0:/^[A-Za-z_]+[A-Za-z0-9_]*=(.*)$/.test(n),Ioe=class{getErrors(r){let i=[];return r.split(/\r?\n/).forEach((l,p)=>{dAr(l)||i.push(`Invalid format at line ${p+1}: "${l}"`)}),i}};var koe=class{getErrors(r){try{return JSON.parse(r),[]}catch(i){return typeof i=="string"?[i]:i instanceof Error?[i.message]:[`${i}`]}}};var QH=class{getErrors(r){let i=[];try{GH.load(r)}catch(a){a instanceof lxe?i.push(a.message):i.push(`Unknown yaml parsing error: ${a_.getErrorMessage(a)}`)}return i}};var _Ar={yml:new QH,yaml:new QH,json:new koe,env:new Ioe},Poe=class{constructor(r=_Ar){this.mappings=r}getValidator(r){let i=this.getExtensionFromPath(r);return i?this.mappings[i]||this.dummyValidator():this.dummyValidator()}dummyValidator(){return{getErrors:()=>[]}}getExtensionFromPath(r){let i=r.lastIndexOf("/"),a=i===-1?0:i+1,l=r.substring(a),p=l.lastIndexOf(".");if(!(p===-1||p===l.length-1))return l.substring(p+1)}};var Ok=class{static traverse(r,i){r.files.forEach(i),r.folders.flatMap(a=>this.traverse(a,i))}};var aUe={unknownObjectTypeWarning:"Unknown object type. File will be skipped.",notSupportedObjectTypeError:n=>`Not supported object type ${n}`},mB=class{getType(r,i){let a=r.data;if(!a||!a.object_type){r.compilationOutput.push({message:aUe.unknownObjectTypeWarning,severity:"warning"}),i.file(r).addWarning(aUe.unknownObjectTypeWarning);return}if(!Object.values(hl).filter(p=>isNaN(Number(p))).includes(a.object_type)){i.file(r).addError(aUe.notSupportedObjectTypeError(a.object_type));return}return a.object_type}};var mAr=n=>zo.hasProps("rawContent")&&(n.rawContent||"").length>0,Noe=n=>({relativePath:n.relativePath,compilationOutput:[],origin:n.origin,type:"Unknown",data:n.data,rawContent:n.rawContent,packageName:n.packageName}),LL=class{constructor(r={}){this.compilerSettings=r.compilerSettings||{amlFileExtensions:["yaml","yml"]},this.fileTypeValidationFactory=r.fileTypeValidationFactory||new Poe,this.yamlObjectTypeExtractor=r.yamlObjectTypeExtractor||new mB,this.fileParser=r.fileParser||new _B}parseFolderStructure(r,i,a){let l=r.files.find(E=>E.relativePath===Y6.relativePath),p=l?this.parseFile(l,i):void 0,_=p?.data,b=a||_?{...a,..._}:void 0;l&&(r.files=r.files.filter(E=>E.relativePath!==Y6.relativePath)??[]);let T=this.parseFolderStructureInternal(r,i,b);return p&&T.files.push(p),T}parseFolderStructureInternal(r,i,a,l=1){if(l>=50){let _=`Max folder depth exceed. Max folder depth is 50. Current folder path: ${r.path}`;throw i.global().addError(_),new K6(_)}let p={path:r.path,origin:r.origin,files:[],folders:[],packageName:r.packageName};return p.files=r.files.map(_=>this.parseFile(_,i,a)),p.folders=r.folders.map(_=>this.parseFolderStructureInternal(_,i,a,l+1)),p}getTextFile(r){return{...r,type:fh.Text,data:void 0}}getEnvFile(r,i){return{...r,type:fh.Environment,data:i}}parseFile(r,i,a){let l=[...this.compilerSettings.amlFileExtensions,kL,...AO];if(!this.hasValidExtension(l,r))return i.file(r).addInfo("File is not recognized as atscale file and will be skipped"),Noe(r);let p=this.compilerSettings.amlFileExtensions.includes(Ga.getExtensionFromPath(r.relativePath)||""),_=z1.isEnvFile(r);if(_&&!Ga.isFileOnRootLevel(r.relativePath)&&i.file(r).addWarning("Environment files should be on root level"),mAr(r)){let T=this.fileTypeValidationFactory.getValidator(r.relativePath).getErrors(r.rawContent);if(T.length>0)return T.forEach(j=>{i.file(r).addWarning(j)}),_?this.getEnvFile(r):p?this.getTextFile(r):Noe(r);let E={},k;try{E=this.fileParser.parse(r);let j=Ga.getExtensionFromPath(r.relativePath)||"";k=AO.includes(j)?void 0:this.yamlObjectTypeExtractor.getType(E,i),E=this.handleEnvironmentVariableInParsedFile({file:E,objectType:k,environmentVariables:a,validatorOutput:i})}catch(j){return i.file(r).addError(`File content is invalid. It cannot be parsed. ${a_.getErrorMessage(j)}`),_?this.getEnvFile(r):p?this.getTextFile(r):Noe(r)}if(k){let j=uxe(r.rawContent)||void 0;return{...r,type:k,data:E.data,rawContent:j?fxe(r.rawContent):r.rawContent,headerComments:j}}else return _?this.getEnvFile(r,E.data):z1.isTextFile(r)||p?this.getTextFile(r):Noe(r)}else return _?(i.file(r).addWarning("Environment file is empty"),this.getEnvFile(r)):z1.isTextFile(r)?this.getTextFile(r):(i.file(r).addInfo("File has no rawContent and will be skipped"),Noe(r))}extractYamlFiles(r){let i=[];return Ok.traverse(r,a=>{if(z1.isYamlFile(a)&&this.hasValidExtension(this.compilerSettings.amlFileExtensions,a)){if(this.isFileTypeCatalog(a.type)&&a.origin!=="R")return;i.push(a)}}),i}hasValidExtension(r,i){let a=Ga.getExtensionFromPath(i.relativePath);return!!a&&r.includes(a)}getYamlFilesWithValidObjectType(r,i){let a=[];return r.forEach(l=>{z1.isYamlFile(l)&&this.yamlObjectTypeExtractor.getType(l,i)&&a.push(l)}),a}isFileTypeCatalog(r){return r===fh.Catalog}handleEnvironmentVariableInParsedFile({file:r,objectType:i,environmentVariables:a,validatorOutput:l}){if(!Sxe(r.rawContent))return r;if(i&&!oUe.includes(i))return l.file(r).addError(`Variable placeholders (e.g., \${VARIABLE_NAME}) were detected in a ${i} file. Variable replacement is only supported for the following file types: ${oUe.join(", ")}.`),r;if(!a)return l.file(r).addError("Referenced variables were detected, but no environment variables are configured. Please create a .env file or configure the engine environment variables (sml.environment.variables)."),r;let _=r.data;try{_=this.replaceVariablesInData(r.data,a)}catch(b){return l.file(r).addError(a_.getErrorMessage(b)),r}return{...r,data:_}}replaceVariablesInData(r,i){return Dxe(r,r.object_type,i)}};var TC="package.yml";var hAr=n=>`${n} is required`,cUe=class n{constructor(r){this.ErrorConstructor=r}forError(r){return new n(r)}should(r,i){if(!r)throw new this.ErrorConstructor(i)}exists(r,i){this.should(r!=null,i),typeof r=="number"&&this.should(!isNaN(r),i)}notEmpty(r,i){let a=r!=null&&r.trim()!=="";this.should(a,i)}allRequired(r){r.forEach(([i,a])=>{let l=hAr(a);typeof i=="string"&&this.notEmpty(i,l),this.exists(i,l)})}ensure(r,i){if(this.exists(r,i),!r)throw new this.ErrorConstructor(i);return r}ensureType(r,i,a){if(i(r))return r;throw new this.ErrorConstructor(a)}},Ooe=new cUe(Error),r2=Ooe;var gAr=function(n,r,i,a){function l(p){return p instanceof i?p:new i(function(_){_(p)})}return new(i||(i=Promise))(function(p,_){function b(k){try{E(a.next(k))}catch(j){_(j)}}function T(k){try{E(a.throw(k))}catch(j){_(j)}}function E(k){k.done?p(k.value):l(k.value).then(b,T)}E((a=a.apply(n,r||[])).next())})},yAr=n=>n?n instanceof Error?n.message:typeof n=="string"?n:`${n}`:"unknown error",Fk={getErrorMessage(n,r){let i=yAr(n);return r?.removeStartString&&i.startsWith(r.removeStartString)?i.substring(r.removeStartString.length).trim():i},getError(n){return new Error(this.getErrorMessage(n))},hasErrorCode:n=>{if(!n)return!1;let r=n.code;return r?typeof r=="string":!1},executeQueryOrThrow(n){var r;return gAr(this,void 0,void 0,function*(){try{return yield n()}catch(i){let a;if(i.response)try{a=(yield i.response.json()).message}catch(p){a=`Could not get json error. Error ${Fk.getErrorMessage(p)}. Original error: ${Fk.getErrorMessage(i)}`}else a=`Error: ${Fk.getErrorMessage(i)}`;let l=new Error(a);throw l.status=(r=i.response)===null||r===void 0?void 0:r.status,l}})}},xxe=Fk;var C2t=function(n,r,i,a){function l(p){return p instanceof i?p:new i(function(_){_(p)})}return new(i||(i=Promise))(function(p,_){function b(k){try{E(a.next(k))}catch(j){_(j)}}function T(k){try{E(a.throw(k))}catch(j){_(j)}}function E(k){k.done?p(k.value):l(k.value).then(b,T)}E((a=a.apply(n,r||[])).next())})},lUe=class{wait(r=50){return C2t(this,void 0,void 0,function*(){return new Promise(i=>{setTimeout(()=>i(),r)})})}returnDelayed(r,i=300){return C2t(this,void 0,void 0,function*(){return yield this.wait(i),r})}},Pon=new lUe;var vAr={cloneFunctions:!1},YH=class n{static deep(r,i={}){let a=Object.assign(Object.assign({},vAr),i);if(r==null)return r;let l=typeof r=="function";if(!l&&!(typeof r=="object"))return r;if(l)return a.cloneFunctions?r:void 0;if(Array.isArray(r))return r.map(_=>n.deep(_,a));if(r instanceof Date)return new Date(r.getTime());{let _={},b=Object.keys(r);for(let T of b)_[T]=n.deep(r[T],a);return _}}static cleanEmptyProperties(r){let i={};for(let a in r){let l=r[a];l===""||l===void 0||l===null||(typeof l=="object"?i[a]=n.cleanEmptyProperties(l):i[a]=l)}return i}};var bAr=/token/i,SAr=/password/i,DAr=/secret/i,E2t=[bAr,SAr,DAr],uUe=class{constructor(){this.undefinedString="[undefined]",this.functionString="[function]",this.circularString="[Circular]",this.obfuscatedString="***"}obfuscate(r){return typeof r=="string"?r==null?this.obfuscatedString:r.length<=6?this.obfuscatedString:r.length<=9?`${this.obfuscatedString}${r.substring(r.length-3)}`:`${r.substring(0,3)}${this.obfuscatedString}${r.substring(r.length-3)}`:this.obfuscatedString}getMaxObjectDepthError(r){return`Max object depth (${r.maxObjectDepth}) exceeded. Current depth: ${r.currentDepth}`}obfuscateObject(r,i,a,l=1){if(l>i.maxObjectDepth)return this.getMaxObjectDepthError({maxObjectDepth:i.maxObjectDepth,currentDepth:l});if(r instanceof Date)return r.toISOString();if(r instanceof Map){let p={};for(let[_,b]of r.entries()){let T=typeof _=="string"?_:i.jsonSerialize(_);E2t.some(E=>E.test(T))?p[T]=this.obfuscate(b):p[T]=this.obfuscateObject(b,i,a,l+1)}return p}if(r instanceof Set)return Array.from(r).map(p=>this.obfuscateObject(p,i,a,l+1));if(typeof r=="bigint")return r.toString();if(r===void 0)return i.serializeUndefined?this.undefinedString:r;if(typeof r=="function")return i.serializeFunctions?this.functionString:r;if(typeof r=="symbol")return i.serializeSymbols?r.toString():r;if(Array.isArray(r))return r.map(p=>this.obfuscateObject(p,i,a,l+1));if(r!==null&&typeof r=="object"){if(a.has(r))return this.circularString;a.add(r);let p={};for(let[_,b]of Object.entries(r))_.toLowerCase()!=="prototype"&&(typeof b=="function"&&!i.serializeFunctions||(typeof b=="string"&&E2t.some(T=>T.test(_))?p[_]=this.obfuscate(b):p[_]=this.obfuscateObject(b,i,a,l+1)));return p}return r}safeToString(r,i){let l=Object.assign({serializeUndefined:!0,serializeFunctions:!1,serializeSymbols:!1,rethrowErrors:!1,maxObjectDepth:10,jsonSerialize:JSON.stringify},i??{});try{let p=new WeakSet,_=this.obfuscateObject(r,l,p);return l.jsonSerialize(_,null,l.space)}catch(p){let _=`Error serializing object: ${xxe.getErrorMessage(p)}`;if(l.rethrowErrors)throw Error(_);return _}}},qon=new uUe;var xAr="4d2cacb5-5b53-4da4-b120-709089990e91",fUe=class{generateNew(){return dB()}generateNewPredictable(r){return FL(r,xAr)}validate(r){return X6(r)}parse(r){return pB(r)}},pUe=new fUe;var TAr=(n,r)=>{let i=r===void 0?"string":r,a=Object.keys(n).map(l=>n[l]);if(i==="string")return a;if(i==="number")return a.map(l=>parseInt(l)).filter(l=>!isNaN(l));throw new Error(`result type "${r}" is not supported in EnumUtil.getAllValues`)},CAr={getAllValues:TAr},w2t=CAr;var jL;(function(n){n.Second="s",n.Minute="m",n.Hour="h",n.Day="d",n.Week="w"})(jL||(jL={}));var nan=w2t.getAllValues(jL,"string");var ian=[{unit:jL.Week,factor:1},{unit:jL.Day,factor:7},{unit:jL.Hour,factor:24},{unit:jL.Minute,factor:60},{unit:jL.Second,factor:60}];var I2t="\\",dUe="/",A2t=[dUe,I2t],_Ue=class{constructor(){this._pathSeparator=typeof process<"u"&&process.platform==="win32"?I2t:dUe,this._pathSeparatorChanged=!1}get pathSeparator(){return this._pathSeparator}set pathSeparator(r){r2.should(!this._pathSeparatorChanged,`Path separator is already changed to ${this._pathSeparator}. For protection it can be set only once.`),r2.should(A2t.includes(r),`Cannot set pathSeparator to '${r}'. It is invalid. It should be one of: ${A2t.join(",")}`),this._pathSeparatorChanged=!0,this._pathSeparator=r}joinTwo(r,i){if(r==="")return i;if(i==="")return r;let a=r.endsWith(this.pathSeparator)?r.slice(void 0,r.length-1):r,l=i.startsWith(this.pathSeparator)?i.slice(1):i;return`${a}${this.pathSeparator}${l}`}join(...r){return r2.ensure(r.length>1,"Cannot join path for less than two paths"),r.slice(1).reduce((i,a)=>this.joinTwo(i,a),r[0])}areEqual(r,i){if(r===i)return!0;if(r===void 0||i===void 0)return!1;let a=r.startsWith(this.pathSeparator)?r.substring(1):r,l=i.startsWith(this.pathSeparator)?i.substring(1):i;return a.endsWith(this.pathSeparator)&&(a=a.substring(0,a.length-1)),l.endsWith(this.pathSeparator)&&(l=l.substring(0,l.length-1)),a===l}getExtensionFromPath(r){let i=r.lastIndexOf(this.pathSeparator),a=i===-1?0:i+1,l=r.substring(a),p=l.lastIndexOf(".");if(!(p===-1||p===l.length-1))return l.substring(p+1)}getFileNameFromPath(r){let i=r.lastIndexOf(this.pathSeparator);return i!==-1?r.substring(i+1):r}getFileNameFromPathWithoutExtension(r){let i=this.getFileNameFromPath(r),a=this.getExtensionFromPath(r);return a?i.replace("."+a,""):i}isFileOnRootLevel(r){let i=r.lastIndexOf(this.pathSeparator);return i===-1?!0:!r.substring(0,i).length}getPath(r,i){let a=this.pathSeparator===dUe,l=`${r}${i}`;return r.endsWith(this.pathSeparator)&&i.startsWith(this.pathSeparator)&&(l=`${r}${i.slice(1)}`),!r.endsWith(this.pathSeparator)&&!i.startsWith(this.pathSeparator)&&(l=`${r}${this.pathSeparator}${i}`),a&&!l.startsWith(this.pathSeparator)?`${this.pathSeparator}${l}`:l}getPathWithoutFileName(r){if(this.isFileOnRootLevel(r))return this.pathSeparator;let i=r.lastIndexOf(this.pathSeparator);return r.substring(0,i)}rewriteFolderPath(r,i){r2.ensure(r.startsWith(this.pathSeparator)&&r.endsWith(this.pathSeparator),"Path is not a folder path");let l=[...r.split(this.pathSeparator).filter(p=>p!=="").slice(0,-1),i];return`${this.pathSeparator}${l.join(this.pathSeparator)}${this.pathSeparator}`}getFolderPath(r,i){return`${r}${i}${this.pathSeparator}`}getFolders(r){let i=this.isFolderPath(r),a=r.split(this.pathSeparator).filter(l=>l!=="");return i?a:a.slice(0,-1)}isFolderPath(r){return r.endsWith(this.pathSeparator)}getParentFolderPath(r){let i=this.isFolderPath(r),a=this.getFolders(r);return a=i?a.slice(0,-1):a,`${a.join(this.pathSeparator)}${this.pathSeparator}`}},EAr=new _Ue;var k2t=n=>n.replace(/(['"\w])\s+(?=[A-Za-z_][A-Za-z0-9_]*=)/g,`$1
|
|
673
673
|
`);var mUe;(function(n){n.Info="Info",n.Warning="Warning",n.Error="Error"})(mUe||(mUe={}));var hUe=class extends vxe{constructor(r){super(r),this.version(1).stores({logs:`++id,
|
|
674
674
|
timestamp,
|
|
675
675
|
level,
|
package/oclif.manifest.json
CHANGED