diff --git a/adapter/0.1.4.json b/adapter/0.1.4.json new file mode 100644 index 0000000..f11e7c0 --- /dev/null +++ b/adapter/0.1.4.json @@ -0,0 +1,48 @@ +/** + * Copyright © 2016-2022 by IntegrIT S.A. dba Hackolade. All rights reserved. + * + * The copyright to the computer software herein is the property of IntegrIT S.A. + * The software may be used and/or copied only with the written permission of + * IntegrIT S.A. or in accordance with the terms and conditions stipulated in + * the agreement/contract under which the software has been supplied. + * + * { + * "add": { + * "entity": [], + * "container": [], + * "model": [], + * "view": [], + * "field": { + * "": [] + * } + * }, + * "delete": { + * "entity": [], + * "container": [], + * "model": [], + * "view": [], + * "field": { + * "": [] + * } + * }, + * "modify": { + * "entity": [ + * { + * "from": { }, + * "to": { } + * } + * ], + * "container": [], + * "model": [], + * "view": [], + * "field": [] + * }, + * } + */ +{ + "modify": { + "container": [["validateContainer", "name", "code"]], + "entity": [["validateEntity", "collectionName", "code"]], + "field": [["validateField", "name", "code"]] + } +} diff --git a/forward_engineering/api.js b/forward_engineering/api.js index 64c332b..25363e3 100644 --- a/forward_engineering/api.js +++ b/forward_engineering/api.js @@ -20,7 +20,7 @@ function print() { __p += __j.call(arguments, '') } }`;var ee=ko(function(){return ce(c,G+"return "+P).apply(i,g)});if(ee.source=P,ca(ee))throw ee;return ee}r(l_,"template");function h_(e){return pe(e).toLowerCase()}r(h_,"toLower");function p_(e){return pe(e).toUpperCase()}r(p_,"toUpper");function g_(e,t,n){if(e=pe(e),e&&(n||t===i))return Va(e);if(!e||!(t=je(t)))return e;var u=yt(e),s=yt(t),c=ja(u,s),g=ef(u,s)+1;return cn(u,c,g).join("")}r(g_,"trim");function d_(e,t,n){if(e=pe(e),e&&(n||t===i))return e.slice(0,nf(e)+1);if(!e||!(t=je(t)))return e;var u=yt(e),s=ef(u,yt(t))+1;return cn(u,0,s).join("")}r(d_,"trimEnd");function __(e,t,n){if(e=pe(e),e&&(n||t===i))return e.replace(Wr,"");if(!e||!(t=je(t)))return e;var u=yt(e),s=ja(u,yt(t));return cn(u,s).join("")}r(__,"trimStart");function v_(e,t){var n=ju,u=es;if(Se(t)){var s="separator"in t?t.separator:s;n="length"in t?j(t.length):n,u="omission"in t?je(t.omission):u}e=pe(e);var c=e.length;if(wr(e)){var g=yt(e);c=g.length}if(n>=c)return e;var v=n-Er(u);if(v<1)return u;var w=g?cn(g,0,v).join(""):e.slice(0,v);if(s===i)return w+u;if(g&&(v+=w.length-v),la(s)){if(e.slice(v).search(s)){var R,D=w;for(s.global||(s=Os(s.source,pe(Fi.exec(s))+"g")),s.lastIndex=0;R=s.exec(D);)var P=R.index;w=w.slice(0,P===i?v:P)}}else if(e.indexOf(je(s),v)!=v){var U=w.lastIndexOf(s);U>-1&&(w=w.slice(0,U))}return w+u}r(v_,"truncate");function y_(e){return e=pe(e),e&&fs.test(e)?e.replace(Mi,zl):e}r(y_,"unescape");var m_=xr(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),ga=kf("toUpperCase");function Ko(e,t,n){return e=pe(e),t=n?i:t,t===i?ql(e)?Ql(e):Bt(e):e.match(t)||[]}r(Ko,"words");var ko=ne(function(e,t){try{return l(e,i,t)}catch(n){return ca(n)?n:new Z(n)}}),S_=Wt(function(e,t){return h(t,function(n){n=Rt(n),Ft(e,n,fa(e[n],e))}),e});function w_(e){var t=e==null?0:e.length,n=X();return e=t?x(e,function(u){if(typeof u[1]!="function")throw new ut(d);return[n(u[0]),u[1]]}):[],ne(function(u){for(var s=-1;++sIt)return[];var n=it,u=Ne(e,it);t=X(t),e-=it;for(var s=Mt(u,t);++n0||t<0)?new ae(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(t=j(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},ae.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ae.prototype.toArray=function(){return this.take(it)},xt(ae.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),u=/^(?:head|last)$/.test(t),s=o[u?"take"+(t=="last"?"Right":""):t],c=u||/^find/.test(t);s&&(o.prototype[t]=function(){var g=this.__wrapped__,v=u?[1]:arguments,w=g instanceof ae,R=v[0],D=w||V(g),P=r(function(se){var fe=s.apply(o,$([se],v));return u&&U?fe[0]:fe},"interceptor");D&&n&&typeof R=="function"&&R.length!=1&&(w=D=!1);var U=this.__chain__,G=!!this.__actions__.length,J=c&&!U,ee=w&&!G;if(!c&&D){g=ee?g:new ae(this);var Q=e.apply(g,v);return Q.__actions__.push({func:Nu,args:[P],thisArg:i}),new st(Q,U)}return J&&ee?e.apply(this,v):(Q=this.thru(P),J?u?Q.value()[0]:Q.value():Q)})}),h(["pop","push","shift","sort","splice","unshift"],function(e){var t=su[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",u=/^(?:pop|shift)$/.test(e);o.prototype[e]=function(){var s=arguments;if(u&&!this.__chain__){var c=this.value();return t.apply(V(c)?c:[],s)}return this[n](function(g){return t.apply(V(g)?g:[],s)})}}),xt(ae.prototype,function(e,t){var n=o[t];if(n){var u=n.name+"";ge.call(Ir,u)||(Ir[u]=[]),Ir[u].push({name:t,func:n})}}),Ir[Ou(i,Ue).name]=[{name:"wrapper",func:i}],ae.prototype.clone=yh,ae.prototype.reverse=mh,ae.prototype.value=Sh,o.prototype.at=Jg,o.prototype.chain=Qg,o.prototype.commit=Zg,o.prototype.next=Vg,o.prototype.plant=ed,o.prototype.reverse=td,o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=nd,o.prototype.first=o.prototype.head,si&&(o.prototype[si]=jg),o},"runInContext"),un=Zl();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ae._=un,define(function(){return un})):Ot?((Ot.exports=un)._=un,ei._=un):Ae._=un}).call(Pr)});var Ea=le((Gu,Qo)=>{(function(i,a){typeof Gu=="object"&&typeof Qo<"u"?a(Gu):typeof define=="function"&&define.amd?define(["exports"],a):(i=typeof globalThis<"u"?globalThis:i||self,a(i.async={}))})(Gu,function(i){"use strict";function a(l,...f){return(...h)=>l(...f,...h)}r(a,"apply");function p(l){return function(...f){var h=f.pop();return l.call(this,f,h)}}r(p,"initialParams");var y=typeof queueMicrotask=="function"&&queueMicrotask,d=typeof setImmediate=="function"&&setImmediate,m=typeof process=="object"&&typeof process.nextTick=="function";function b(l){setTimeout(l,0)}r(b,"fallback");function N(l){return(f,...h)=>l(()=>f(...h))}r(N,"wrap");var M;y?M=queueMicrotask:d?M=setImmediate:m?M=process.nextTick:M=b;var I=N(M);function B(l){return de(l)?function(...f){let h=f.pop(),_=l.apply(this,f);return H(_,h)}:p(function(f,h){var _;try{_=l.apply(this,f)}catch(E){return h(E)}if(_&&typeof _.then=="function")return H(_,h);h(null,_)})}r(B,"asyncify");function H(l,f){return l.then(h=>{q(f,null,h)},h=>{q(f,h&&(h instanceof Error||h.message)?h:new Error(h))})}r(H,"handlePromise");function q(l,f,h){try{l(f,h)}catch(_){I(E=>{throw E},_)}}r(q,"invokeCallback");function de(l){return l[Symbol.toStringTag]==="AsyncFunction"}r(de,"isAsync");function me(l){return l[Symbol.toStringTag]==="AsyncGenerator"}r(me,"isAsyncGenerator");function Ue(l){return typeof l[Symbol.asyncIterator]=="function"}r(Ue,"isAsyncIterable");function z(l){if(typeof l!="function")throw new Error("expected a function");return de(l)?B(l):l}r(z,"wrapAsync");function Y(l,f){if(f||(f=l.length),!f)throw new Error("arity is undefined");function h(..._){return typeof _[f-1]=="function"?l.apply(this,_):new Promise((E,A)=>{_[f-1]=(T,...O)=>{if(T)return A(T);E(O.length>1?O:O[0])},l.apply(this,_)})}return r(h,"awaitable"),h}r(Y,"awaitify");function Dt(l){return r(function(h,..._){return Y(function(A){var T=this;return l(h,(O,x)=>{z(O).apply(T,_.concat(x))},A)})},"applyEach")}r(Dt,"applyEach$1");function ke(l,f,h,_){f=f||[];var E=[],A=0,T=z(h);return l(f,(O,x,$)=>{var te=A++;T(O,(oe,re)=>{E[te]=re,$(oe)})},O=>{_(O,E)})}r(ke,"_asyncMap");function ht(l){return l&&typeof l.length=="number"&&l.length>=0&&l.length%1===0}r(ht,"isArrayLike");var At={};function rt(l){function f(...h){if(l!==null){var _=l;l=null,_.apply(this,h)}}return r(f,"wrapper"),Object.assign(f,l),f}r(rt,"once");function ju(l){return l[Symbol.iterator]&&l[Symbol.iterator]()}r(ju,"getIterator");function es(l){var f=-1,h=l.length;return r(function(){return++f=f||T||E||(T=!0,l.next().then(({value:re,done:ze})=>{if(!(A||E)){if(T=!1,ze){E=!0,O<=0&&_(null);return}O++,h(re,x,te),x++,$()}}).catch(oe))}r($,"replenish");function te(re,ze){if(O-=1,!A){if(re)return oe(re);if(re===!1){E=!0,A=!0;return}if(ze===At||E&&O<=0)return E=!0,_(null);$()}}r(te,"iterateeCallback");function oe(re){A||(T=!1,E=!0,_(re))}r(oe,"handleError"),$()}r(Pi,"asyncEachOfLimit");var Te=r(l=>(f,h,_)=>{if(_=rt(_),l<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!f)return _(null);if(me(f))return Pi(f,l,h,_);if(Ue(f))return Pi(f[Symbol.asyncIterator](),l,h,_);var E=Di(f),A=!1,T=!1,O=0,x=!1;function $(oe,re){if(!T)if(O-=1,oe)A=!0,_(oe);else if(oe===!1)A=!0,T=!0;else{if(re===At||A&&O<=0)return A=!0,_(null);x||te()}}r($,"iterateeCallback");function te(){for(x=!0;O1?E:E[0])}return r(h,"callback"),h[gt]=new Promise((_,E)=>{l=_,f=E}),h}r(Pt,"promiseCallback");function Fe(l,f,h){typeof f!="number"&&(h=f,f=null),h=rt(h||Pt());var _=Object.keys(l).length;if(!_)return h(null);f||(f=_);var E={},A=0,T=!1,O=!1,x=Object.create(null),$=[],te=[],oe={};Object.keys(l).forEach(W=>{var k=l[W];if(!Array.isArray(k)){re(W,[k]),te.push(W);return}var ue=k.slice(0,k.length-1),ve=ue.length;if(ve===0){re(W,k),te.push(W);return}oe[W]=ve,ue.forEach(we=>{if(!l[we])throw new Error("async.auto task `"+W+"` has a non-existent dependency `"+we+"` in "+ue.join(", "));en(we,()=>{ve--,ve===0&&re(W,k)})})}),ie(),ze();function re(W,k){$.push(()=>tn(W,k))}r(re,"enqueueTask");function ze(){if(!T){if($.length===0&&A===0)return h(null,E);for(;$.length&&Aue()),ze()}r(Bt,"taskComplete");function tn(W,k){if(!O){var ue=Ct((we,...We)=>{if(A--,we===!1){T=!0;return}if(We.length<2&&([We]=We),we){var nn={};if(Object.keys(E).forEach(vt=>{nn[vt]=E[vt]}),nn[W]=We,O=!0,x=Object.create(null),T)return;h(we,nn)}else E[W]=We,Bt(W)});A++;var ve=z(k[k.length-1]);k.length>1?ve(E,ue):ve(ue)}}r(tn,"runTask");function ie(){for(var W,k=0;te.length;)W=te.pop(),k++,K(W).forEach(ue=>{--oe[ue]===0&&te.push(ue)});if(k!==_)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}r(ie,"checkForDeadlocks");function K(W){var k=[];return Object.keys(l).forEach(ue=>{let ve=l[ue];Array.isArray(ve)&&ve.indexOf(W)>=0&&k.push(ue)}),k}return r(K,"getDependents"),h[gt]}r(Fe,"auto");var yn=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,ss=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,dt=/,/,bi=/(=.+)?(\s*)$/;function as(l){let f="",h=0,_=l.indexOf("*/");for(;hE.replace(bi,"").trim())}r(mn,"parseParams");function Ye(l,f){var h={};return Object.keys(l).forEach(_=>{var E=l[_],A,T=de(E),O=!T&&E.length===1||T&&E.length===0;if(Array.isArray(E))A=[...E],E=A.pop(),h[_]=A.concat(A.length>0?x:E);else if(O)h[_]=E;else{if(A=mn(E),E.length===0&&!T&&A.length===0)throw new Error("autoInject task functions require explicit parameters.");T||A.pop(),h[_]=A.concat(x)}function x($,te){var oe=A.map(re=>$[re]);oe.push(te),z(E)(...oe)}r(x,"newTask")}),Fe(h,f)}r(Ye,"autoInject");let mr=class mr{constructor(){this.head=this.tail=null,this.length=0}removeLink(f){return f.prev?f.prev.next=f.next:this.head=f.next,f.next?f.next.prev=f.prev:this.tail=f.prev,f.prev=f.next=null,this.length-=1,f}empty(){for(;this.head;)this.shift();return this}insertAfter(f,h){h.prev=f,h.next=f.next,f.next?f.next.prev=h:this.tail=h,f.next=h,this.length+=1}insertBefore(f,h){h.prev=f.prev,h.next=f,f.prev?f.prev.next=h:this.head=h,f.prev=h,this.length+=1}unshift(f){this.head?this.insertBefore(this.head,f):Sn(this,f)}push(f){this.tail?this.insertAfter(this.tail,f):Sn(this,f)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var f=this.head;f;)yield f.data,f=f.next}remove(f){for(var h=this.head;h;){var{next:_}=h;f(h)&&this.removeLink(h),h=_}return this}};r(mr,"DLL");let bt=mr;function Sn(l,f){l.length=1,l.head=l.tail=f}r(Sn,"setInitial");function Br(l,f,h){if(f==null)f=1;else if(f===0)throw new RangeError("Concurrency must not be zero");var _=z(l),E=0,A=[];let T={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function O(K,W){T[K].push(W)}r(O,"on");function x(K,W){let k=r((...ue)=>{$(K,k),W(...ue)},"handleAndRemove");T[K].push(k)}r(x,"once");function $(K,W){if(!K)return Object.keys(T).forEach(k=>T[k]=[]);if(!W)return T[K]=[];T[K]=T[K].filter(k=>k!==W)}r($,"off");function te(K,...W){T[K].forEach(k=>k(...W))}r(te,"trigger");var oe=!1;function re(K,W,k,ue){if(ue!=null&&typeof ue!="function")throw new Error("task callback must be a function");ie.started=!0;var ve,we;function We(vt,...Mt){if(vt)return k?we(vt):ve();if(Mt.length<=1)return ve(Mt[0]);ve(Mt)}r(We,"promiseCallback");var nn=ie._createTaskItem(K,k?We:ue||We);if(W?ie._tasks.unshift(nn):ie._tasks.push(nn),oe||(oe=!0,I(()=>{oe=!1,ie.process()})),k||!ue)return new Promise((vt,Mt)=>{ve=vt,we=Mt})}r(re,"_insert");function ze(K){return function(W,...k){E-=1;for(var ue=0,ve=K.length;ue0&&A.splice(We,1),we.callback(W,...k),W!=null&&te("error",W,we.data)}E<=ie.concurrency-ie.buffer&&te("unsaturated"),ie.idle()&&te("drain"),ie.process()}}r(ze,"_createCB");function en(K){return K.length===0&&ie.idle()?(I(()=>te("drain")),!0):!1}r(en,"_maybeDrain");let Bt=r(K=>W=>{if(!W)return new Promise((k,ue)=>{x(K,(ve,we)=>{if(ve)return ue(ve);k(we)})});$(K),O(K,W)},"eventMethod");var tn=!1,ie={_tasks:new bt,_createTaskItem(K,W){return{data:K,callback:W}},*[Symbol.iterator](){yield*ie._tasks[Symbol.iterator]()},concurrency:f,payload:h,buffer:f/4,started:!1,paused:!1,push(K,W){return Array.isArray(K)?en(K)?void 0:K.map(k=>re(k,!1,!1,W)):re(K,!1,!1,W)},pushAsync(K,W){return Array.isArray(K)?en(K)?void 0:K.map(k=>re(k,!1,!0,W)):re(K,!1,!0,W)},kill(){$(),ie._tasks.empty()},unshift(K,W){return Array.isArray(K)?en(K)?void 0:K.map(k=>re(k,!0,!1,W)):re(K,!0,!1,W)},unshiftAsync(K,W){return Array.isArray(K)?en(K)?void 0:K.map(k=>re(k,!0,!0,W)):re(K,!0,!0,W)},remove(K){ie._tasks.remove(K)},process(){if(!tn){for(tn=!0;!ie.paused&&E{E(f,A,(x,$)=>{f=$,O(x)})},A=>_(A,f))}r(wn,"reduce");var He=Y(wn,4);function En(...l){var f=l.map(z);return function(...h){var _=this,E=h[h.length-1];return typeof E=="function"?h.pop():E=Pt(),He(f,h,(A,T,O)=>{T.apply(_,A.concat((x,...$)=>{O(x,$)}))},(A,T)=>E(A,...T)),E[gt]}}r(En,"seq");function zn(...l){return En(...l.reverse())}r(zn,"compose");function Mr(l,f,h,_){return ke(Te(f),l,h,_)}r(Mr,"mapLimit");var Nt=Y(Mr,4);function Ur(l,f,h,_){var E=z(h);return Nt(l,f,(A,T)=>{E(A,(O,...x)=>O?T(O):T(O,x))},(A,T)=>{for(var O=[],x=0;x{var T=!1,O;let x=z(E);h(_,($,te,oe)=>{x($,(re,ze)=>{if(re||re===!1)return oe(re);if(l(ze)&&!O)return T=!0,O=f(!0,$),oe(null,At);oe()})},$=>{if($)return A($);A(null,T?O:f(!1))})}}r(_t,"_createTester");function Mi(l,f,h){return _t(_=>_,(_,E)=>E)($e,l,f,h)}r(Mi,"detect");var An=Y(Mi,3);function fs(l,f,h,_){return _t(E=>E,(E,A)=>A)(Te(f),l,h,_)}r(fs,"detectLimit");var Jn=Y(fs,4);function os(l,f,h){return _t(_=>_,(_,E)=>E)(Te(1),l,f,h)}r(os,"detectSeries");var Qn=Y(os,3);function Hr(l){return(f,...h)=>z(f)(...h,(_,...E)=>{typeof console=="object"&&(_?console.error&&console.error(_):console[l]&&E.forEach(A=>console[l](A)))})}r(Hr,"consoleFunc");var Ui=Hr("dir");function cs(l,f,h){h=Ct(h);var _=z(l),E=z(f),A;function T(x,...$){if(x)return h(x);x!==!1&&(A=$,E(...$,O))}r(T,"next");function O(x,$){if(x)return h(x);if(x!==!1){if(!$)return h(null,...A);_(T)}}return r(O,"check"),O(null,!0)}r(cs,"doWhilst");var Cn=Y(cs,3);function Zn(l,f,h){let _=z(f);return Cn(l,(...E)=>{let A=E.pop();_(...E,(T,O)=>A(T,!O))},h)}r(Zn,"doUntil");function $i(l){return(f,h,_)=>l(f,_)}r($i,"_withoutIndex");function Wr(l,f,h){return $e(l,$i(z(f)),h)}r(Wr,"eachLimit$2");var Vn=Y(Wr,3);function ls(l,f,h,_){return Te(f)(l,$i(z(h)),_)}r(ls,"eachLimit");var In=Y(ls,4);function hs(l,f,h){return In(l,1,f,h)}r(hs,"eachSeries");var Tn=Y(hs,3);function qr(l){return de(l)?l:function(...f){var h=f.pop(),_=!0;f.push((...E)=>{_?I(()=>h(...E)):h(...E)}),l.apply(this,f),_=!1}}r(qr,"ensureAsync");function ps(l,f,h){return _t(_=>!_,_=>!_)($e,l,f,h)}r(ps,"every");var jn=Y(ps,3);function Fi(l,f,h,_){return _t(E=>!E,E=>!E)(Te(f),l,h,_)}r(Fi,"everyLimit");var er=Y(Fi,4);function gs(l,f,h){return _t(_=>!_,_=>!_)(De,l,f,h)}r(gs,"everySeries");var tr=Y(gs,3);function ds(l,f,h,_){var E=new Array(f.length);l(f,(A,T,O)=>{h(A,(x,$)=>{E[T]=!!$,O(x)})},A=>{if(A)return _(A);for(var T=[],O=0;O{h(A,(x,$)=>{if(x)return O(x);$&&E.push({index:T,value:A}),O(x)})},A=>{if(A)return _(A);_(null,E.sort((T,O)=>T.index-O.index).map(T=>T.value))})}r(_s,"filterGeneric");function nr(l,f,h,_){var E=ht(f)?ds:_s;return E(l,f,z(h),_)}r(nr,"_filter");function rr(l,f,h){return nr($e,l,f,h)}r(rr,"filter");var ir=Y(rr,3);function ur(l,f,h,_){return nr(Te(f),l,h,_)}r(ur,"filterLimit");var sr=Y(ur,4);function vs(l,f,h){return nr(De,l,f,h)}r(vs,"filterSeries");var ar=Y(vs,3);function Hi(l,f){var h=Ct(f),_=z(qr(l));function E(A){if(A)return h(A);A!==!1&&_(E)}return r(E,"next"),E()}r(Hi,"forever");var Gr=Y(Hi,2);function Wi(l,f,h,_){var E=z(h);return Nt(l,f,(A,T)=>{E(A,(O,x)=>O?T(O):T(O,{key:x,val:A}))},(A,T)=>{for(var O={},{hasOwnProperty:x}=Object.prototype,$=0;${A(T,O,($,te)=>{if($)return x($);E[O]=te,x($)})},T=>_(T,E))}r(ki,"mapValuesLimit");var On=Y(ki,4);function Kr(l,f,h){return On(l,1/0,f,h)}r(Kr,"mapValues");function or(l,f,h){return On(l,1,f,h)}r(or,"mapValuesSeries");function Yi(l,f=h=>h){var h=Object.create(null),_=Object.create(null),E=z(l),A=p((T,O)=>{var x=f(...T);x in h?I(()=>O(null,...h[x])):x in _?_[x].push(O):(_[x]=[O],E(...T,($,...te)=>{$||(h[x]=te);var oe=_[x];delete _[x];for(var re=0,ze=oe.length;re{var _=ht(f)?[]:{};l(f,(E,A,T)=>{z(E)((O,...x)=>{x.length<2&&([x]=x),_[A]=x,T(O)})},E=>h(E,_))},3);function zi(l,f){return cr($e,l,f)}r(zi,"parallel");function kr(l,f,h){return cr(Te(f),l,h)}r(kr,"parallelLimit");function lr(l,f){var h=z(l);return Br((_,E)=>{h(_[0],E)},f,1)}r(lr,"queue");let Sr=class Sr{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(f){let h;for(;f>0&&Dn(this.heap[f],this.heap[h=Yr(f)]);){let _=this.heap[f];this.heap[f]=this.heap[h],this.heap[h]=_,f=h}}percDown(f){let h;for(;(h=ys(f))=0;_--)this.percDown(_);return this}};r(Sr,"Heap");let Rn=Sr;function ys(l){return(l<<1)+1}r(ys,"leftChi");function Yr(l){return(l+1>>1)-1}r(Yr,"parent");function Dn(l,f){return l.priority!==f.priority?l.priority({data:T,priority:O,callback:x});function A(T,O){return Array.isArray(T)?T.map(x=>({data:x,priority:O})):{data:T,priority:O}}return r(A,"createDataItems"),h.push=function(T,O=0,x){return _(A(T,O),x)},h.pushAsync=function(T,O=0,x){return E(A(T,O),x)},delete h.unshift,delete h.unshiftAsync,h}r(hr,"priorityQueue");function jt(l,f){if(f=rt(f),!Array.isArray(l))return f(new TypeError("First argument to race must be an array of functions"));if(!l.length)return f();for(var h=0,_=l.length;h<_;h++)z(l[h])(f)}r(jt,"race");var zr=Y(jt,2);function Pn(l,f,h,_){var E=[...l].reverse();return He(E,f,h,_)}r(Pn,"reduceRight");function pr(l){var f=z(l);return p(r(function(_,E){return _.push((A,...T)=>{let O={};if(A&&(O.error=A),T.length>0){var x=T;T.length<=1&&([x]=T),O.value=x}E(null,O)}),f.apply(this,_)},"reflectOn"))}r(pr,"reflect");function Xr(l){var f;return Array.isArray(l)?f=l.map(pr):(f={},Object.keys(l).forEach(h=>{f[h]=pr.call(this,l[h])})),f}r(Xr,"reflectAll");function gr(l,f,h,_){let E=z(h);return nr(l,f,(A,T)=>{E(A,(O,x)=>{T(O,!x)})},_)}r(gr,"reject$2");function Xi(l,f,h){return gr($e,l,f,h)}r(Xi,"reject");var Jr=Y(Xi,3);function ms(l,f,h,_){return gr(Te(f),l,h,_)}r(ms,"rejectLimit");var Ji=Y(ms,4);function Ss(l,f,h){return gr(De,l,f,h)}r(Ss,"rejectSeries");var Qr=Y(Ss,3);function Qi(l){return function(){return l}}r(Qi,"constant");let Zr=5,Zi=0;function dr(l,f,h){var _={times:Zr,intervalFunc:Qi(Zi)};if(arguments.length<3&&typeof l=="function"?(h=f||Pt(),f=l):(Vr(_,l),h=h||Pt()),typeof f!="function")throw new Error("Invalid arguments for async.retry");var E=z(f),A=1;function T(){E((O,...x)=>{O!==!1&&(O&&A++<_.times&&(typeof _.errorFilter!="function"||_.errorFilter(O))?setTimeout(T,_.intervalFunc(A-1)):h(O,...x))})}return r(T,"retryAttempt"),T(),h[gt]}r(dr,"retry");function Vr(l,f){if(typeof f=="object")l.times=+f.times||Zr,l.intervalFunc=typeof f.interval=="function"?f.interval:Qi(+f.interval||Zi),l.errorFilter=f.errorFilter;else if(typeof f=="number"||typeof f=="string")l.times=+f||Zr;else throw new Error("Invalid arguments for async.retry")}r(Vr,"parseTimes");function Vi(l,f){f||(f=l,l=null);let h=l&&l.arity||f.length;de(f)&&(h+=1);var _=z(f);return p((E,A)=>{(E.length_)($e,l,f,h)}r(ws,"some");var _r=Y(ws,3);function Es(l,f,h,_){return _t(Boolean,E=>E)(Te(f),l,h,_)}r(Es,"someLimit");var he=Y(Es,4);function _e(l,f,h){return _t(Boolean,_=>_)(De,l,f,h)}r(_e,"someSeries");var vr=Y(_e,3);function As(l,f,h){var _=z(f);return pt(l,(A,T)=>{_(A,(O,x)=>{if(O)return T(O);T(O,{value:A,criteria:x})})},(A,T)=>{if(A)return h(A);h(null,T.sort(E).map(O=>O.value))});function E(A,T){var O=A.criteria,x=T.criteria;return Ox?1:0}}r(As,"sortBy");var eu=Y(As,3);function tu(l,f,h){var _=z(l);return p((E,A)=>{var T=!1,O;function x(){var $=l.name||"anonymous",te=new Error('Callback function "'+$+'" timed out.');te.code="ETIMEDOUT",h&&(te.info=h),T=!0,A(te)}r(x,"timeoutCallback"),E.push((...$)=>{T||(A(...$),clearTimeout(O))}),O=setTimeout(x,f),_(...E)})}r(tu,"timeout");function Cs(l){for(var f=Array(l);l--;)f[l]=l;return f}r(Cs,"range");function yr(l,f,h,_){var E=z(h);return Nt(Cs(l),f,E,_)}r(yr,"timesLimit");function jr(l,f,h){return yr(l,1/0,f,h)}r(jr,"times");function nu(l,f,h){return yr(l,1,f,h)}r(nu,"timesSeries");function Ae(l,f,h,_){arguments.length<=3&&typeof f=="function"&&(_=h,h=f,f=Array.isArray(l)?[]:{}),_=rt(_||Pt());var E=z(h);return $e(l,(A,T,O)=>{E(f,A,T,O)},A=>_(A,f)),_[gt]}r(Ae,"transform");function ei(l,f){var h=null,_;return Tn(l,(E,A)=>{z(E)((T,...O)=>{if(T===!1)return A(T);O.length<2?[_]=O:_=O,h=T,A(T?null:{})})},()=>f(h,_))}r(ei,"tryEach");var Ot=Y(ei);function ti(l){return(...f)=>(l.unmemoized||l)(...f)}r(ti,"unmemoize");function ni(l,f,h){h=Ct(h);var _=z(f),E=z(l),A=[];function T(x,...$){if(x)return h(x);A=$,x!==!1&&E(O)}r(T,"next");function O(x,$){if(x)return h(x);if(x!==!1){if(!$)return h(null,...A);_(T)}}return r(O,"check"),E(O)}r(ni,"whilst");var Le=Y(ni,3);function ri(l,f,h){let _=z(l);return Le(E=>_((A,T)=>E(A,!T)),f,h)}r(ri,"until");function ru(l,f){if(f=rt(f),!Array.isArray(l))return f(new Error("First argument to waterfall must be an array of functions"));if(!l.length)return f();var h=0;function _(A){var T=z(l[h++]);T(...A,Ct(E))}r(_,"nextTask");function E(A,...T){if(A!==!1){if(A||h===l.length)return f(A,...T);_(T)}}r(E,"next"),_([])}r(ru,"waterfall");var ii=Y(ru),iu={apply:a,applyEach:dn,applyEachSeries:vn,asyncify:B,auto:Fe,autoInject:Ye,cargo:Zt,cargoQueue:Ni,compose:zn,concat:Vt,concatLimit:Tt,concatSeries:Xn,constant:Bi,detect:An,detectLimit:Jn,detectSeries:Qn,dir:Ui,doUntil:Zn,doWhilst:Cn,each:Vn,eachLimit:In,eachOf:$e,eachOfLimit:Qt,eachOfSeries:De,eachSeries:Tn,ensureAsync:qr,every:jn,everyLimit:er,everySeries:tr,filter:ir,filterLimit:sr,filterSeries:ar,forever:Gr,groupBy:qi,groupByLimit:fr,groupBySeries:Gi,log:Ki,map:pt,mapLimit:Nt,mapSeries:Nr,mapValues:Kr,mapValuesLimit:On,mapValuesSeries:or,memoize:Yi,nextTick:Ln,parallel:zi,parallelLimit:kr,priorityQueue:hr,queue:lr,race:zr,reduce:He,reduceRight:Pn,reflect:pr,reflectAll:Xr,reject:Jr,rejectLimit:Ji,rejectSeries:Qr,retry:dr,retryable:Vi,seq:En,series:ji,setImmediate:I,some:_r,someLimit:he,someSeries:vr,sortBy:eu,timeout:tu,times:jr,timesLimit:yr,timesSeries:nu,transform:Ae,tryEach:Ot,unmemoize:ti,until:ri,waterfall:ii,whilst:Le,all:jn,allLimit:er,allSeries:tr,any:_r,anyLimit:he,anySeries:vr,find:An,findLimit:Jn,findSeries:Qn,flatMap:Vt,flatMapLimit:Tt,flatMapSeries:Xn,forEach:Vn,forEachSeries:Tn,forEachLimit:In,forEachOf:$e,forEachOfSeries:De,forEachOfLimit:Qt,inject:He,foldl:He,foldr:Pn,select:ir,selectLimit:sr,selectSeries:ar,wrapSync:B,during:Le,doDuring:Cn};i.all=jn,i.allLimit=er,i.allSeries=tr,i.any=_r,i.anyLimit=he,i.anySeries=vr,i.apply=a,i.applyEach=dn,i.applyEachSeries=vn,i.asyncify=B,i.auto=Fe,i.autoInject=Ye,i.cargo=Zt,i.cargoQueue=Ni,i.compose=zn,i.concat=Vt,i.concatLimit=Tt,i.concatSeries=Xn,i.constant=Bi,i.default=iu,i.detect=An,i.detectLimit=Jn,i.detectSeries=Qn,i.dir=Ui,i.doDuring=Cn,i.doUntil=Zn,i.doWhilst=Cn,i.during=Le,i.each=Vn,i.eachLimit=In,i.eachOf=$e,i.eachOfLimit=Qt,i.eachOfSeries=De,i.eachSeries=Tn,i.ensureAsync=qr,i.every=jn,i.everyLimit=er,i.everySeries=tr,i.filter=ir,i.filterLimit=sr,i.filterSeries=ar,i.find=An,i.findLimit=Jn,i.findSeries=Qn,i.flatMap=Vt,i.flatMapLimit=Tt,i.flatMapSeries=Xn,i.foldl=He,i.foldr=Pn,i.forEach=Vn,i.forEachLimit=In,i.forEachOf=$e,i.forEachOfLimit=Qt,i.forEachOfSeries=De,i.forEachSeries=Tn,i.forever=Gr,i.groupBy=qi,i.groupByLimit=fr,i.groupBySeries=Gi,i.inject=He,i.log=Ki,i.map=pt,i.mapLimit=Nt,i.mapSeries=Nr,i.mapValues=Kr,i.mapValuesLimit=On,i.mapValuesSeries=or,i.memoize=Yi,i.nextTick=Ln,i.parallel=zi,i.parallelLimit=kr,i.priorityQueue=hr,i.queue=lr,i.race=zr,i.reduce=He,i.reduceRight=Pn,i.reflect=pr,i.reflectAll=Xr,i.reject=Jr,i.rejectLimit=Ji,i.rejectSeries=Qr,i.retry=dr,i.retryable=Vi,i.select=ir,i.selectLimit=sr,i.selectSeries=ar,i.seq=En,i.series=ji,i.setImmediate=I,i.some=_r,i.someLimit=he,i.someSeries=vr,i.sortBy=eu,i.timeout=tu,i.times=jr,i.timesLimit=yr,i.timesSeries=nu,i.transform=Ae,i.tryEach=Ot,i.unmemoize=ti,i.until=ri,i.waterfall=ii,i.whilst=Le,i.wrapSync=B,Object.defineProperty(i,"__esModule",{value:!0})})});var hn=le((Bm,Zo)=>{var pv={usernamePassword:"username_password",securityCertificate:"security_certificate"},gv={selfHosted:"couchbase://",cloud:"couchbases://"},dv={bucketIsEmpty:0,primaryIndexDoesNotExist:4e3,n1qlMethodsAreNotSupported:19,userDoesNotHaveAccessToPrivilegeCluster:13014,parseSyntaxError:3e3,inferMethodIsNotSupport:16003,collectionDoesNotExist:12003,indexAlreadyCreated:4300,duplicateDocumentKey:12009,authorizationFailure:6},_v={hasError:"hasError"},vv={capella:"Capella",selfHosted:"Self-hosted"},yv="",mv=1e3,Sv="_default",wv=3,Ev=11210,Av="Something went wrong. Please, check logs for more details",Cv=/\(meta\(\)\.(.*?)\)/,Iv=/"nodes":(\[.*?\])/,Tv=/(HASH|hash)\((.*?)\)$/;Zo.exports={AUTH_TYPE:pv,COUCHBASE_ERROR_CODE:dv,COUCHBASE_HOST_PREFIX:gv,COUCHBASE_DEFAULT_KV_CONNECTION_PORT:Ev,DEFAULT_KEY_NAME:yv,DEFAULT_LIMIT:mv,DEFAULT_NAME:Sv,NUM_SAMPLE_VALUES:wv,DISABLED_TOOLTIP:Av,GET_META_REGEXP:Cv,GET_NODES_REGEXP:Iv,GET_PARTITION_HASH_REGEXP:Tv,HOSTING:vv,STATUS:_v}});var ec=le((Mm,jo)=>{var{isObject:Ov}=Wn(),{DEFAULT_LIMIT:xv}=hn(),Ia=class Ia extends Error{constructor({code:a,message:p}){super(),this.code=a,this.message=p}};r(Ia,"CustomError");var Aa=Ia,Ta=class Ta{constructor(a,p){this.host=a.host,this.port=a.port,a!=null&&a.couchbase_username&&(a!=null&&a.couchbase_password)&&(this.password=a.couchbase_password,this.username=a.couchbase_username),this.httpService=p}encodeCredentials(){return Buffer.from(`${this.username}:${this.password}`).toString("base64")}async fetch(a){try{let p=`http://${this.host}:${this.port}${a}`,d={headers:{Authorization:`Basic ${this.encodeCredentials()}`},useElectronNet:!0};return await this.httpService.get(p,d)}catch(p){throw new Aa({message:p.statusText||p.message,code:p.status||p.code})}}async getCollectionDocuments({bucketName:a,scopeName:p,collectionName:y,limit:d}){let m=`/pools/default/buckets/${a}/scopes/${p}/collections/${y}/docs?include_docs=true&limit=${d}&skip=0`;return await this.fetch(m)}async getLocalRandomKey({bucketName:a,scopeName:p,collectionName:y}){let d=`/pools/default/buckets/${a}/scopes/${p}/collections/${y}/localRandomKey`;return await this.fetch(d)}async getIndexes(){return await this.fetch("/indexStatus")}};r(Ta,"CouchbaseRestApiService");var Ca=Ta,Lv=r(i=>{try{return JSON.parse(i)}catch{return i}},"safeParse"),Rv=r(i=>Ov(i)&&!!i.base64&&!!i.meta,"isBinaryFile"),Vo=r(({connectionInfo:i,app:a})=>{let y=a.require("httpService").createInstance(i);return new Ca(i,y)},"createRestApiService"),Dv=r(async({connectionInfo:i,bucketName:a,scopeName:p,collectionName:y,logger:d,app:m})=>{try{d.info(`${a}.${p}.${y}: Start getting documents using REST API`);let b=Vo({connectionInfo:i,app:m}),{rows:N}=await b.getCollectionDocuments({bucketName:a,scopeName:p,collectionName:y,limit:xv});return N.filter(M=>!Rv(M)).map(M=>{var I;return{[a]:Lv((I=M.doc)==null?void 0:I.json),docid:M.id}})}catch(b){return d.error(b),[]}},"getCollectionDocuments"),Pv=r(async({connectionInfo:i,logger:a,app:p})=>{a.info("Start getting indexes using REST API");let y=Vo({connectionInfo:i,app:p}),{indexes:d}=await y.getIndexes();return d},"getIndexes");jo.exports={getCollectionDocuments:Dv,getIndexes:Pv}});var sc=le(($m,uc)=>{var{isPlainObject:bv,isEmpty:ic,isArray:tc}=Wn(),{DEFAULT_KEY_NAME:nc,NUM_SAMPLE_VALUES:Nv}=hn(),Bv=r(({documents:i,bucketName:a,scopeName:p,collectionName:y,collectionIndexes:d,includeEmptyCollection:m,standardDocument:b,fieldInference:N})=>{let M=i.filter(H=>bv(H[a])).map(H=>({[nc]:H.docid,...H[a]})),I=N.active==="field"?b:null,B=!m&&ic(M);return{dbName:p,collectionName:y,collectionDocs:{},standardDoc:I,bucketInfo:{bucket:a},emptyBucket:B,documents:M,containerLevelKeys:{key:nc},entityLevel:{indexes:d}}},"getDbCollectionData"),rc=r((i,a)=>i.length>a?i[a]:i[0],"getSafeValueByIndex"),Mv=r(({property:i,propertyName:a,amountOfSamples:p,result:y})=>{let{samples:d=[],type:m}=i;return[...Array(p).keys()].reduce((b,N)=>{let M=rc(d,N),I=tc(m)?rc(m,N):m,B=b[N]||{};return b[N]={...B,[a]:tc(M)&&I!=="array"?M[0]:M},b},y)},"reduceSamples"),Uv=r(({inference:i,bucketName:a})=>{if(ic(i==null?void 0:i.properties))return[];let p=Math.min(Nv,i["#docs"]??0);return Object.keys(i.properties).reduce((d,m)=>{let b=i.properties[m];return b?Mv({property:b,propertyName:m,amountOfSamples:p,result:d}):d},[]).map(d=>({docid:"",[a]:d}))},"convertInferSchemaToDocuments"),$v=r(({entitiesData:i,indexesByCollectionMap:a,scopeBucketNameMap:p})=>i.map(({bucketName:y,scopeName:d,collectionName:m,ifNotExists:b})=>{var N,M,I,B;return{doc:{bucketInfo:{bucket:y,ifNotExists:(M=(N=p[y])==null?void 0:N[d])==null?void 0:M.ifNotExists},emptyBucket:!m,dbName:d,collectionName:m,entityLevel:{ifNotExists:b,indexes:(B=(I=a==null?void 0:a[y])==null?void 0:I[d])==null?void 0:B[m]}},objectNames:{collectionName:m},collectionDocs:{},jsonSchema:{type:"object"}}}),"mapParsedResultToMultipleSchema"),Fv=r(i=>({}).toString.call(i).split(" ")[1].slice(0,-1).toLowerCase(),"typeOf");uc.exports={getDbCollectionData:Bv,convertInferSchemaToDocuments:Uv,mapParsedResultToMultipleSchema:$v,typeOf:Fv}});var fc=le((Hm,ac)=>{var{NUM_SAMPLE_VALUES:Hv}=hn(),Wv=r(({bucketName:i,scopeName:a,collectionName:p,limit:y})=>`INFER \`${i}\`.\`${a}\`.\`${p}\` WITH {"sample_size":${y}, "num_sample_values":${Hv}};`,"getInferCollectionDocumentsQuery"),qv=r(({bucketName:i,limit:a,offset:p})=>{let y=`SELECT * FROM \`${i}\``;return Oa({query:y,limit:a,offset:p})},"getSelectBucketDocumentsQuery"),Gv=r(({bucketName:i,scopeName:a,collectionName:p,limit:y,offset:d})=>{let m=`SELECT *, META().id AS docid FROM \`${i}\`.\`${a}\`.\`${p}\` AS \`${i}\``;return Oa({query:m,limit:y,offset:d})},"getSelectCollectionDocumentsQuery"),Kv=r(({bucketName:i,scopeName:a,collectionName:p})=>`SELECT COUNT(*) AS size FROM \`${i}\`.\`${a}\`.\`${p}\``,"getCountCollectionDocumentsQuery"),kv=r(()=>"SELECT * FROM system:indexes","getSelectIndexesQuery"),Oa=r(({query:i,limit:a,offset:p})=>i+(a?` LIMIT ${a}`:"")+(p?` OFFSET ${p}`:""),"getQueryOptions");ac.exports={getCountCollectionDocumentsQuery:Kv,getInferCollectionDocumentsQuery:Wv,getSelectBucketDocumentsQuery:qv,getSelectCollectionDocumentsQuery:Gv,getSelectIndexesQuery:kv,getQueryOptions:Oa}});var ku=le((Gm,lc)=>{var qm=Ea(),{get:Yv,uniq:zv,isEmpty:Xv}=Wn(),Jv=ec(),Ku=sc(),{COUCHBASE_ERROR_CODE:pn,DEFAULT_NAME:Qv,DISABLED_TOOLTIP:Zv,STATUS:Vv,DEFAULT_LIMIT:Ei}=hn(),qn=fc(),oc=r(async({cluster:i})=>await i.buckets().getAllBuckets(),"getAllBuckets"),jv=r(async({bucketName:i,cluster:a})=>(await a.buckets().createBucket({name:i}),a.bucket(i)),"createNewBucket"),e1=r(async({cluster:i,selectedBucket:a})=>a?[{name:a}]:oc({cluster:i}),"getBucketsForReverse"),t1=r(async({cluster:i,bucketName:a,logger:p})=>{try{let m=await(await(await i.bucket(a)).collections()).getAllScopes();return n1({scopes:m})}catch(y){return p.error(y),[]}},"getBucketScopes"),n1=r(({scopes:i})=>{let a=r(({name:p})=>p===Qv,"isDefault");return i.reduce((p,y)=>{if(!a(y))return[...p,y];let d=y.collections.filter(m=>!a(m));return Xv(d)?p:[...p,{...y,collections:d}]},[])},"getNonDefaultScopesAndCollections"),r1=r(async({cluster:i,connectionInfo:a,logger:p})=>(await t1({cluster:i,bucketName:a.database,logger:p})).map(d=>{let m=d.collections.map(b=>b.name);return s1({scopeName:d.name,collectionNames:m})}),"getDbCollectionsNames"),i1=r(async({cluster:i,bucketName:a,limit:p=Ei})=>{let y=qn.getSelectBucketDocumentsQuery({bucketName:a,limit:p}),{rows:d}=await i.query(y);return d},"getDocumentsBySelectStatement"),xa=r(({error:i})=>{var a;return((a=i==null?void 0:i.cause)==null?void 0:a.first_error_code)??(i==null?void 0:i.code)},"getErrorCode"),u1=r(({error:i})=>{var p;switch(xa({error:i})){case pn.bucketIsEmpty:return"Collection is empty.";case pn.n1qlMethodsAreNotSupported:return"N1QL methods are not supported.";case pn.parseSyntaxError:case pn.inferMethodIsNotSupport:return"Infer method is not supported.";case pn.userDoesNotHaveAccessToPrivilegeCluster:return"User doesn`t have credentials for privileged cluster.";default:return((p=i==null?void 0:i.cause)==null?void 0:p.first_error_message)||(i==null?void 0:i.message)||""}},"getErrorMessage"),s1=r(({scopeName:i,collectionNames:a,status:p})=>{let y=p===Vv.hasError;return{dbCollections:y?[]:zv(a),dbName:i,...p&&{status:p},...y&&{disabledTooltip:Zv}}},"prepareBucketCollectionNamesData"),cc=r(async({cluster:i,options:a,query:p,logger:y})=>{let{bucketName:d,scopeName:m,collectionName:b,pagination:N,limit:M}=a;if(y.progress("Get data from database",d+"."+m,b),!(N!=null&&N.enabled)){let de=qn.getQueryOptions({query:p,limit:M}),{rows:me}=await i.query(de);return me}let I=Number(a.pagination.value)||Ei,B=Math.ceil(a.limit/I),H=[],q=0;for(let de of B){let me=I*de,Ue=a.limit-me{if(a.active==="absolute")return Number(a.absolute.value);let p=Math.ceil(i*a.relative.value/100);return Math.min(p,a.maxValue)},"getDocSamplingSize"),f1=r(async({cluster:i,bucketName:a,scopeName:p,collectionName:y,recordSamplingSettings:d,logger:m})=>{var b;try{let N=qn.getCountCollectionDocumentsQuery({bucketName:a,scopeName:p,collectionName:y}),{rows:M}=await i.query(N),I=(b=M==null?void 0:M[0])==null?void 0:b.size;return a1({size:I,recordSamplingSettings:d})||Ei}catch(N){return m.error(N),Ei}},"getCollectionSamplingSize"),o1=r(async({cluster:i,bucketName:a,scopeName:p,collectionName:y,limit:d})=>{let m=qn.getInferCollectionDocumentsQuery({bucketName:a,scopeName:p,collectionName:y,limit:d}),{rows:b,meta:N}=await i.query(m),M=Yv(N,"errors.[0]");if(M)throw M;let[[I]]=b;return Ku.convertInferSchemaToDocuments({inference:I,bucketName:a})},"getCollectionDocumentsByInfer"),c1=r(async({cluster:i,data:a,bucketName:p,scopeName:y,collectionName:d,collectionIndexes:m,includeEmptyCollection:b,logger:N,app:M})=>{var I;try{let H={limit:await f1({cluster:i,bucketName:p,scopeName:y,collectionName:d,recordSamplingSettings:a.recordSamplingSettings,logger:N}),pagination:a.pagination,bucketName:p,scopeName:y,collectionName:d},q=qn.getSelectCollectionDocumentsQuery({bucketName:p,scopeName:y,collectionName:d}),de=await cc({cluster:i,options:H,query:q,logger:N}),me=await p1({cluster:i,bucketName:p,scopeName:y,collectionName:d,documentId:(I=de[0])==null?void 0:I.docid,logger:N});return Ku.getDbCollectionData({bucketName:p,scopeName:y,collectionName:d,documents:de,collectionIndexes:m,includeEmptyCollection:b,standardDocument:me,fieldInference:a.fieldInference})}catch(B){return N.error(B),l1({error:B,cluster:i,data:a,bucketName:p,scopeName:y,collectionName:d,collectionIndexes:m,includeEmptyCollection:b,logger:N,app:M})}},"getDbCollectionData"),l1=r(async({error:i,cluster:a,data:p,bucketName:y,scopeName:d,collectionName:m,collectionIndexes:b,includeEmptyCollection:N,logger:M,app:I})=>{try{let B=xa({error:i}),H=[];switch(B){case pn.primaryIndexDoesNotExist:H=await o1({cluster:a,bucketName:y,scopeName:d,collectionName:m,limit:Ei});break;case pn.inferMethodIsNotSupport:case pn.n1qlMethodsAreNotSupported:H=await Jv.getCollectionDocuments({connectionInfo:p.connectionInfo,bucketName:y,scopeName:d,collectionName:m,logger:M,app:I});break}return Ku.getDbCollectionData({bucketName:y,scopeName:d,collectionName:m,documents:H,collectionIndexes:b,includeEmptyCollection:N,fieldInference:p.fieldInference})}catch(B){return M.error(B),Ku.getDbCollectionData({bucketName:y,scopeName:d,collectionName:m,documents:[],collectionIndexes:b,includeEmptyCollection:N,fieldInference:p.fieldInference})}},"getDbCollectionDataByErrorHandling"),h1=r(async({cluster:i,logger:a})=>{try{let p=qn.getSelectIndexesQuery(),{rows:y}=await i.query(p);return y.map(d=>d.indexes)}catch(p){return a.error(p),[]}},"getIndexes"),p1=r(async({cluster:i,bucketName:a,scopeName:p,collectionName:y,documentId:d,logger:m})=>{try{let M=i.bucket(a).scope(p).collection(y),{content:I}=await M.get(d);return I}catch(b){return m.error(b),null}},"getCollectionDocumentByDocumentId");lc.exports={getAllBuckets:oc,createNewBucket:jv,getBucketsForReverse:e1,getDbCollectionsNames:r1,getDbCollectionData:c1,getDocumentsBySelectStatement:i1,getErrorCode:xa,getErrorMessage:u1,getIndexes:h1,getPaginatedQuery:cc}});var vc=le((km,_c)=>{var g1=ku(),{AUTH_TYPE:d1,COUCHBASE_HOST_PREFIX:gc,COUCHBASE_DEFAULT_KV_CONNECTION_PORT:_1,HOSTING:hc}=hn(),lt=null,dc=r(({connectionInfo:i})=>i.host.startsWith(gc.cloud),"isCloudStorage"),pc=r(({connectionInfo:i})=>{if(dc({connectionInfo:i}))return i.host;let a=i.kv_port||_1;return`${gc.selfHosted}${i.host}:${a}`},"generateUrl"),v1=r(({connectionInfo:i})=>i.authType===d1.securityCertificate?{url:pc({connectionInfo:i}),options:{authenticator:{certificatePath:i.security_certificate,keyPath:i.security_certificate_key}}}:{url:pc({connectionInfo:i}),options:{username:i.couchbase_username,password:i.couchbase_password}},"generateConnectionParams"),y1=r(async({connectionInfo:i,app:a})=>{if(lt)return lt;let p=await a.require("couchbase"),{url:y,options:d}=v1({connectionInfo:i});lt=await p.connect(y,d);let m=await g1.getAllBuckets({cluster:lt}),b=i.couchbase_bucket;if(b&&!m.includes(b))throw new Error(`Bucket ${b} doesn't exist`);return lt},"connect"),m1=r(async()=>{await(lt==null?void 0:lt.close()),lt=null},"disconnect"),S1=r(()=>{let i=(lt==null?void 0:lt._connStr)||"";return{hosting:dc({connectionInfo:{host:i}})?hc.capella:hc.selfHosted}},"getConnectionInfo");_c.exports={connect:y1,disconnect:m1,getConnectionInfo:S1}});var yc=le((zm,w1)=>{w1.exports={name:"CouchbaseV7Plus",version:"0.1.2",versionDate:"2024-03-08",author:"hackolade",engines:{hackolade:"7.0.0",hackoladePlugin:"1.0.1"},contributes:{target:{applicationTarget:"CouchbaseV7Plus",title:"Couchbase w/ collections",versions:["7.x"]},features:{enableForwardEngineering:!0,enableArrayCollections:!1}},description:"Hackolade plugin for Couchbase with scopes and collections","lint-staged":{"*.{js,json}":"prettier --write"},"simple-git-hooks":{"pre-commit":"npx lint-staged","pre-push":"npx eslint ."},scripts:{lint:"eslint . --max-warnings=0",package:"node esbuild.package.js"},dependencies:{async:"3.2.5","exponential-backoff":"3.1.1",lodash:"4.17.21",uuid:"9.0.1",antlr4:"4.9.2"},devDependencies:{"@hackolade/hck-esbuild-plugins-pack":"0.0.1","@types/couchbase":"2.4.9",esbuild:"0.19.12","esbuild-plugin-clean":"1.0.1",eslint:"8.56.0","eslint-config-prettier":"9.1.0","eslint-plugin-prettier":"5.1.3","lint-staged":"14.0.1",prettier:"3.2.4","simple-git-hooks":"2.9.0"}}});var wc=le((Xm,Sc)=>{var Yt=require("os"),E1=yc(),{COUCHBASE_ERROR_CODE:A1}=hn(),C1=r(()=>E1.version,"getPluginVersion"),I1=r(i=>`Date: ${new Date} +`+f);let[,_]=h;return _.replace(/\s/g,"").split(dt).map(E=>E.replace(bi,"").trim())}r(mn,"parseParams");function Ye(l,f){var h={};return Object.keys(l).forEach(_=>{var E=l[_],A,T=de(E),O=!T&&E.length===1||T&&E.length===0;if(Array.isArray(E))A=[...E],E=A.pop(),h[_]=A.concat(A.length>0?x:E);else if(O)h[_]=E;else{if(A=mn(E),E.length===0&&!T&&A.length===0)throw new Error("autoInject task functions require explicit parameters.");T||A.pop(),h[_]=A.concat(x)}function x($,te){var oe=A.map(re=>$[re]);oe.push(te),z(E)(...oe)}r(x,"newTask")}),Fe(h,f)}r(Ye,"autoInject");let mr=class mr{constructor(){this.head=this.tail=null,this.length=0}removeLink(f){return f.prev?f.prev.next=f.next:this.head=f.next,f.next?f.next.prev=f.prev:this.tail=f.prev,f.prev=f.next=null,this.length-=1,f}empty(){for(;this.head;)this.shift();return this}insertAfter(f,h){h.prev=f,h.next=f.next,f.next?f.next.prev=h:this.tail=h,f.next=h,this.length+=1}insertBefore(f,h){h.prev=f.prev,h.next=f,f.prev?f.prev.next=h:this.head=h,f.prev=h,this.length+=1}unshift(f){this.head?this.insertBefore(this.head,f):Sn(this,f)}push(f){this.tail?this.insertAfter(this.tail,f):Sn(this,f)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var f=this.head;f;)yield f.data,f=f.next}remove(f){for(var h=this.head;h;){var{next:_}=h;f(h)&&this.removeLink(h),h=_}return this}};r(mr,"DLL");let bt=mr;function Sn(l,f){l.length=1,l.head=l.tail=f}r(Sn,"setInitial");function Br(l,f,h){if(f==null)f=1;else if(f===0)throw new RangeError("Concurrency must not be zero");var _=z(l),E=0,A=[];let T={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function O(K,W){T[K].push(W)}r(O,"on");function x(K,W){let k=r((...ue)=>{$(K,k),W(...ue)},"handleAndRemove");T[K].push(k)}r(x,"once");function $(K,W){if(!K)return Object.keys(T).forEach(k=>T[k]=[]);if(!W)return T[K]=[];T[K]=T[K].filter(k=>k!==W)}r($,"off");function te(K,...W){T[K].forEach(k=>k(...W))}r(te,"trigger");var oe=!1;function re(K,W,k,ue){if(ue!=null&&typeof ue!="function")throw new Error("task callback must be a function");ie.started=!0;var ve,we;function We(vt,...Mt){if(vt)return k?we(vt):ve();if(Mt.length<=1)return ve(Mt[0]);ve(Mt)}r(We,"promiseCallback");var nn=ie._createTaskItem(K,k?We:ue||We);if(W?ie._tasks.unshift(nn):ie._tasks.push(nn),oe||(oe=!0,I(()=>{oe=!1,ie.process()})),k||!ue)return new Promise((vt,Mt)=>{ve=vt,we=Mt})}r(re,"_insert");function ze(K){return function(W,...k){E-=1;for(var ue=0,ve=K.length;ue0&&A.splice(We,1),we.callback(W,...k),W!=null&&te("error",W,we.data)}E<=ie.concurrency-ie.buffer&&te("unsaturated"),ie.idle()&&te("drain"),ie.process()}}r(ze,"_createCB");function en(K){return K.length===0&&ie.idle()?(I(()=>te("drain")),!0):!1}r(en,"_maybeDrain");let Bt=r(K=>W=>{if(!W)return new Promise((k,ue)=>{x(K,(ve,we)=>{if(ve)return ue(ve);k(we)})});$(K),O(K,W)},"eventMethod");var tn=!1,ie={_tasks:new bt,_createTaskItem(K,W){return{data:K,callback:W}},*[Symbol.iterator](){yield*ie._tasks[Symbol.iterator]()},concurrency:f,payload:h,buffer:f/4,started:!1,paused:!1,push(K,W){return Array.isArray(K)?en(K)?void 0:K.map(k=>re(k,!1,!1,W)):re(K,!1,!1,W)},pushAsync(K,W){return Array.isArray(K)?en(K)?void 0:K.map(k=>re(k,!1,!0,W)):re(K,!1,!0,W)},kill(){$(),ie._tasks.empty()},unshift(K,W){return Array.isArray(K)?en(K)?void 0:K.map(k=>re(k,!0,!1,W)):re(K,!0,!1,W)},unshiftAsync(K,W){return Array.isArray(K)?en(K)?void 0:K.map(k=>re(k,!0,!0,W)):re(K,!0,!0,W)},remove(K){ie._tasks.remove(K)},process(){if(!tn){for(tn=!0;!ie.paused&&E{E(f,A,(x,$)=>{f=$,O(x)})},A=>_(A,f))}r(wn,"reduce");var He=Y(wn,4);function En(...l){var f=l.map(z);return function(...h){var _=this,E=h[h.length-1];return typeof E=="function"?h.pop():E=Pt(),He(f,h,(A,T,O)=>{T.apply(_,A.concat((x,...$)=>{O(x,$)}))},(A,T)=>E(A,...T)),E[gt]}}r(En,"seq");function zn(...l){return En(...l.reverse())}r(zn,"compose");function Mr(l,f,h,_){return ke(Te(f),l,h,_)}r(Mr,"mapLimit");var Nt=Y(Mr,4);function Ur(l,f,h,_){var E=z(h);return Nt(l,f,(A,T)=>{E(A,(O,...x)=>O?T(O):T(O,x))},(A,T)=>{for(var O=[],x=0;x{var T=!1,O;let x=z(E);h(_,($,te,oe)=>{x($,(re,ze)=>{if(re||re===!1)return oe(re);if(l(ze)&&!O)return T=!0,O=f(!0,$),oe(null,At);oe()})},$=>{if($)return A($);A(null,T?O:f(!1))})}}r(_t,"_createTester");function Mi(l,f,h){return _t(_=>_,(_,E)=>E)($e,l,f,h)}r(Mi,"detect");var An=Y(Mi,3);function fs(l,f,h,_){return _t(E=>E,(E,A)=>A)(Te(f),l,h,_)}r(fs,"detectLimit");var Jn=Y(fs,4);function os(l,f,h){return _t(_=>_,(_,E)=>E)(Te(1),l,f,h)}r(os,"detectSeries");var Qn=Y(os,3);function Hr(l){return(f,...h)=>z(f)(...h,(_,...E)=>{typeof console=="object"&&(_?console.error&&console.error(_):console[l]&&E.forEach(A=>console[l](A)))})}r(Hr,"consoleFunc");var Ui=Hr("dir");function cs(l,f,h){h=Ct(h);var _=z(l),E=z(f),A;function T(x,...$){if(x)return h(x);x!==!1&&(A=$,E(...$,O))}r(T,"next");function O(x,$){if(x)return h(x);if(x!==!1){if(!$)return h(null,...A);_(T)}}return r(O,"check"),O(null,!0)}r(cs,"doWhilst");var Cn=Y(cs,3);function Zn(l,f,h){let _=z(f);return Cn(l,(...E)=>{let A=E.pop();_(...E,(T,O)=>A(T,!O))},h)}r(Zn,"doUntil");function $i(l){return(f,h,_)=>l(f,_)}r($i,"_withoutIndex");function Wr(l,f,h){return $e(l,$i(z(f)),h)}r(Wr,"eachLimit$2");var Vn=Y(Wr,3);function ls(l,f,h,_){return Te(f)(l,$i(z(h)),_)}r(ls,"eachLimit");var In=Y(ls,4);function hs(l,f,h){return In(l,1,f,h)}r(hs,"eachSeries");var Tn=Y(hs,3);function qr(l){return de(l)?l:function(...f){var h=f.pop(),_=!0;f.push((...E)=>{_?I(()=>h(...E)):h(...E)}),l.apply(this,f),_=!1}}r(qr,"ensureAsync");function ps(l,f,h){return _t(_=>!_,_=>!_)($e,l,f,h)}r(ps,"every");var jn=Y(ps,3);function Fi(l,f,h,_){return _t(E=>!E,E=>!E)(Te(f),l,h,_)}r(Fi,"everyLimit");var er=Y(Fi,4);function gs(l,f,h){return _t(_=>!_,_=>!_)(De,l,f,h)}r(gs,"everySeries");var tr=Y(gs,3);function ds(l,f,h,_){var E=new Array(f.length);l(f,(A,T,O)=>{h(A,(x,$)=>{E[T]=!!$,O(x)})},A=>{if(A)return _(A);for(var T=[],O=0;O{h(A,(x,$)=>{if(x)return O(x);$&&E.push({index:T,value:A}),O(x)})},A=>{if(A)return _(A);_(null,E.sort((T,O)=>T.index-O.index).map(T=>T.value))})}r(_s,"filterGeneric");function nr(l,f,h,_){var E=ht(f)?ds:_s;return E(l,f,z(h),_)}r(nr,"_filter");function rr(l,f,h){return nr($e,l,f,h)}r(rr,"filter");var ir=Y(rr,3);function ur(l,f,h,_){return nr(Te(f),l,h,_)}r(ur,"filterLimit");var sr=Y(ur,4);function vs(l,f,h){return nr(De,l,f,h)}r(vs,"filterSeries");var ar=Y(vs,3);function Hi(l,f){var h=Ct(f),_=z(qr(l));function E(A){if(A)return h(A);A!==!1&&_(E)}return r(E,"next"),E()}r(Hi,"forever");var Gr=Y(Hi,2);function Wi(l,f,h,_){var E=z(h);return Nt(l,f,(A,T)=>{E(A,(O,x)=>O?T(O):T(O,{key:x,val:A}))},(A,T)=>{for(var O={},{hasOwnProperty:x}=Object.prototype,$=0;${A(T,O,($,te)=>{if($)return x($);E[O]=te,x($)})},T=>_(T,E))}r(ki,"mapValuesLimit");var On=Y(ki,4);function Kr(l,f,h){return On(l,1/0,f,h)}r(Kr,"mapValues");function or(l,f,h){return On(l,1,f,h)}r(or,"mapValuesSeries");function Yi(l,f=h=>h){var h=Object.create(null),_=Object.create(null),E=z(l),A=p((T,O)=>{var x=f(...T);x in h?I(()=>O(null,...h[x])):x in _?_[x].push(O):(_[x]=[O],E(...T,($,...te)=>{$||(h[x]=te);var oe=_[x];delete _[x];for(var re=0,ze=oe.length;re{var _=ht(f)?[]:{};l(f,(E,A,T)=>{z(E)((O,...x)=>{x.length<2&&([x]=x),_[A]=x,T(O)})},E=>h(E,_))},3);function zi(l,f){return cr($e,l,f)}r(zi,"parallel");function kr(l,f,h){return cr(Te(f),l,h)}r(kr,"parallelLimit");function lr(l,f){var h=z(l);return Br((_,E)=>{h(_[0],E)},f,1)}r(lr,"queue");let Sr=class Sr{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(f){let h;for(;f>0&&Dn(this.heap[f],this.heap[h=Yr(f)]);){let _=this.heap[f];this.heap[f]=this.heap[h],this.heap[h]=_,f=h}}percDown(f){let h;for(;(h=ys(f))=0;_--)this.percDown(_);return this}};r(Sr,"Heap");let Rn=Sr;function ys(l){return(l<<1)+1}r(ys,"leftChi");function Yr(l){return(l+1>>1)-1}r(Yr,"parent");function Dn(l,f){return l.priority!==f.priority?l.priority({data:T,priority:O,callback:x});function A(T,O){return Array.isArray(T)?T.map(x=>({data:x,priority:O})):{data:T,priority:O}}return r(A,"createDataItems"),h.push=function(T,O=0,x){return _(A(T,O),x)},h.pushAsync=function(T,O=0,x){return E(A(T,O),x)},delete h.unshift,delete h.unshiftAsync,h}r(hr,"priorityQueue");function jt(l,f){if(f=rt(f),!Array.isArray(l))return f(new TypeError("First argument to race must be an array of functions"));if(!l.length)return f();for(var h=0,_=l.length;h<_;h++)z(l[h])(f)}r(jt,"race");var zr=Y(jt,2);function Pn(l,f,h,_){var E=[...l].reverse();return He(E,f,h,_)}r(Pn,"reduceRight");function pr(l){var f=z(l);return p(r(function(_,E){return _.push((A,...T)=>{let O={};if(A&&(O.error=A),T.length>0){var x=T;T.length<=1&&([x]=T),O.value=x}E(null,O)}),f.apply(this,_)},"reflectOn"))}r(pr,"reflect");function Xr(l){var f;return Array.isArray(l)?f=l.map(pr):(f={},Object.keys(l).forEach(h=>{f[h]=pr.call(this,l[h])})),f}r(Xr,"reflectAll");function gr(l,f,h,_){let E=z(h);return nr(l,f,(A,T)=>{E(A,(O,x)=>{T(O,!x)})},_)}r(gr,"reject$2");function Xi(l,f,h){return gr($e,l,f,h)}r(Xi,"reject");var Jr=Y(Xi,3);function ms(l,f,h,_){return gr(Te(f),l,h,_)}r(ms,"rejectLimit");var Ji=Y(ms,4);function Ss(l,f,h){return gr(De,l,f,h)}r(Ss,"rejectSeries");var Qr=Y(Ss,3);function Qi(l){return function(){return l}}r(Qi,"constant");let Zr=5,Zi=0;function dr(l,f,h){var _={times:Zr,intervalFunc:Qi(Zi)};if(arguments.length<3&&typeof l=="function"?(h=f||Pt(),f=l):(Vr(_,l),h=h||Pt()),typeof f!="function")throw new Error("Invalid arguments for async.retry");var E=z(f),A=1;function T(){E((O,...x)=>{O!==!1&&(O&&A++<_.times&&(typeof _.errorFilter!="function"||_.errorFilter(O))?setTimeout(T,_.intervalFunc(A-1)):h(O,...x))})}return r(T,"retryAttempt"),T(),h[gt]}r(dr,"retry");function Vr(l,f){if(typeof f=="object")l.times=+f.times||Zr,l.intervalFunc=typeof f.interval=="function"?f.interval:Qi(+f.interval||Zi),l.errorFilter=f.errorFilter;else if(typeof f=="number"||typeof f=="string")l.times=+f||Zr;else throw new Error("Invalid arguments for async.retry")}r(Vr,"parseTimes");function Vi(l,f){f||(f=l,l=null);let h=l&&l.arity||f.length;de(f)&&(h+=1);var _=z(f);return p((E,A)=>{(E.length_)($e,l,f,h)}r(ws,"some");var _r=Y(ws,3);function Es(l,f,h,_){return _t(Boolean,E=>E)(Te(f),l,h,_)}r(Es,"someLimit");var he=Y(Es,4);function _e(l,f,h){return _t(Boolean,_=>_)(De,l,f,h)}r(_e,"someSeries");var vr=Y(_e,3);function As(l,f,h){var _=z(f);return pt(l,(A,T)=>{_(A,(O,x)=>{if(O)return T(O);T(O,{value:A,criteria:x})})},(A,T)=>{if(A)return h(A);h(null,T.sort(E).map(O=>O.value))});function E(A,T){var O=A.criteria,x=T.criteria;return Ox?1:0}}r(As,"sortBy");var eu=Y(As,3);function tu(l,f,h){var _=z(l);return p((E,A)=>{var T=!1,O;function x(){var $=l.name||"anonymous",te=new Error('Callback function "'+$+'" timed out.');te.code="ETIMEDOUT",h&&(te.info=h),T=!0,A(te)}r(x,"timeoutCallback"),E.push((...$)=>{T||(A(...$),clearTimeout(O))}),O=setTimeout(x,f),_(...E)})}r(tu,"timeout");function Cs(l){for(var f=Array(l);l--;)f[l]=l;return f}r(Cs,"range");function yr(l,f,h,_){var E=z(h);return Nt(Cs(l),f,E,_)}r(yr,"timesLimit");function jr(l,f,h){return yr(l,1/0,f,h)}r(jr,"times");function nu(l,f,h){return yr(l,1,f,h)}r(nu,"timesSeries");function Ae(l,f,h,_){arguments.length<=3&&typeof f=="function"&&(_=h,h=f,f=Array.isArray(l)?[]:{}),_=rt(_||Pt());var E=z(h);return $e(l,(A,T,O)=>{E(f,A,T,O)},A=>_(A,f)),_[gt]}r(Ae,"transform");function ei(l,f){var h=null,_;return Tn(l,(E,A)=>{z(E)((T,...O)=>{if(T===!1)return A(T);O.length<2?[_]=O:_=O,h=T,A(T?null:{})})},()=>f(h,_))}r(ei,"tryEach");var Ot=Y(ei);function ti(l){return(...f)=>(l.unmemoized||l)(...f)}r(ti,"unmemoize");function ni(l,f,h){h=Ct(h);var _=z(f),E=z(l),A=[];function T(x,...$){if(x)return h(x);A=$,x!==!1&&E(O)}r(T,"next");function O(x,$){if(x)return h(x);if(x!==!1){if(!$)return h(null,...A);_(T)}}return r(O,"check"),E(O)}r(ni,"whilst");var Le=Y(ni,3);function ri(l,f,h){let _=z(l);return Le(E=>_((A,T)=>E(A,!T)),f,h)}r(ri,"until");function ru(l,f){if(f=rt(f),!Array.isArray(l))return f(new Error("First argument to waterfall must be an array of functions"));if(!l.length)return f();var h=0;function _(A){var T=z(l[h++]);T(...A,Ct(E))}r(_,"nextTask");function E(A,...T){if(A!==!1){if(A||h===l.length)return f(A,...T);_(T)}}r(E,"next"),_([])}r(ru,"waterfall");var ii=Y(ru),iu={apply:a,applyEach:dn,applyEachSeries:vn,asyncify:B,auto:Fe,autoInject:Ye,cargo:Zt,cargoQueue:Ni,compose:zn,concat:Vt,concatLimit:Tt,concatSeries:Xn,constant:Bi,detect:An,detectLimit:Jn,detectSeries:Qn,dir:Ui,doUntil:Zn,doWhilst:Cn,each:Vn,eachLimit:In,eachOf:$e,eachOfLimit:Qt,eachOfSeries:De,eachSeries:Tn,ensureAsync:qr,every:jn,everyLimit:er,everySeries:tr,filter:ir,filterLimit:sr,filterSeries:ar,forever:Gr,groupBy:qi,groupByLimit:fr,groupBySeries:Gi,log:Ki,map:pt,mapLimit:Nt,mapSeries:Nr,mapValues:Kr,mapValuesLimit:On,mapValuesSeries:or,memoize:Yi,nextTick:Ln,parallel:zi,parallelLimit:kr,priorityQueue:hr,queue:lr,race:zr,reduce:He,reduceRight:Pn,reflect:pr,reflectAll:Xr,reject:Jr,rejectLimit:Ji,rejectSeries:Qr,retry:dr,retryable:Vi,seq:En,series:ji,setImmediate:I,some:_r,someLimit:he,someSeries:vr,sortBy:eu,timeout:tu,times:jr,timesLimit:yr,timesSeries:nu,transform:Ae,tryEach:Ot,unmemoize:ti,until:ri,waterfall:ii,whilst:Le,all:jn,allLimit:er,allSeries:tr,any:_r,anyLimit:he,anySeries:vr,find:An,findLimit:Jn,findSeries:Qn,flatMap:Vt,flatMapLimit:Tt,flatMapSeries:Xn,forEach:Vn,forEachSeries:Tn,forEachLimit:In,forEachOf:$e,forEachOfSeries:De,forEachOfLimit:Qt,inject:He,foldl:He,foldr:Pn,select:ir,selectLimit:sr,selectSeries:ar,wrapSync:B,during:Le,doDuring:Cn};i.all=jn,i.allLimit=er,i.allSeries=tr,i.any=_r,i.anyLimit=he,i.anySeries=vr,i.apply=a,i.applyEach=dn,i.applyEachSeries=vn,i.asyncify=B,i.auto=Fe,i.autoInject=Ye,i.cargo=Zt,i.cargoQueue=Ni,i.compose=zn,i.concat=Vt,i.concatLimit=Tt,i.concatSeries=Xn,i.constant=Bi,i.default=iu,i.detect=An,i.detectLimit=Jn,i.detectSeries=Qn,i.dir=Ui,i.doDuring=Cn,i.doUntil=Zn,i.doWhilst=Cn,i.during=Le,i.each=Vn,i.eachLimit=In,i.eachOf=$e,i.eachOfLimit=Qt,i.eachOfSeries=De,i.eachSeries=Tn,i.ensureAsync=qr,i.every=jn,i.everyLimit=er,i.everySeries=tr,i.filter=ir,i.filterLimit=sr,i.filterSeries=ar,i.find=An,i.findLimit=Jn,i.findSeries=Qn,i.flatMap=Vt,i.flatMapLimit=Tt,i.flatMapSeries=Xn,i.foldl=He,i.foldr=Pn,i.forEach=Vn,i.forEachLimit=In,i.forEachOf=$e,i.forEachOfLimit=Qt,i.forEachOfSeries=De,i.forEachSeries=Tn,i.forever=Gr,i.groupBy=qi,i.groupByLimit=fr,i.groupBySeries=Gi,i.inject=He,i.log=Ki,i.map=pt,i.mapLimit=Nt,i.mapSeries=Nr,i.mapValues=Kr,i.mapValuesLimit=On,i.mapValuesSeries=or,i.memoize=Yi,i.nextTick=Ln,i.parallel=zi,i.parallelLimit=kr,i.priorityQueue=hr,i.queue=lr,i.race=zr,i.reduce=He,i.reduceRight=Pn,i.reflect=pr,i.reflectAll=Xr,i.reject=Jr,i.rejectLimit=Ji,i.rejectSeries=Qr,i.retry=dr,i.retryable=Vi,i.select=ir,i.selectLimit=sr,i.selectSeries=ar,i.seq=En,i.series=ji,i.setImmediate=I,i.some=_r,i.someLimit=he,i.someSeries=vr,i.sortBy=eu,i.timeout=tu,i.times=jr,i.timesLimit=yr,i.timesSeries=nu,i.transform=Ae,i.tryEach=Ot,i.unmemoize=ti,i.until=ri,i.waterfall=ii,i.whilst=Le,i.wrapSync=B,Object.defineProperty(i,"__esModule",{value:!0})})});var hn=le((Bm,Zo)=>{var pv={usernamePassword:"username_password",securityCertificate:"security_certificate"},gv={selfHosted:"couchbase://",cloud:"couchbases://"},dv={bucketIsEmpty:0,primaryIndexDoesNotExist:4e3,n1qlMethodsAreNotSupported:19,userDoesNotHaveAccessToPrivilegeCluster:13014,parseSyntaxError:3e3,inferMethodIsNotSupport:16003,collectionDoesNotExist:12003,indexAlreadyCreated:4300,duplicateDocumentKey:12009,authorizationFailure:6},_v={hasError:"hasError"},vv={capella:"Capella",selfHosted:"Self-hosted"},yv="",mv=1e3,Sv="_default",wv=3,Ev=11210,Av="Something went wrong. Please, check logs for more details",Cv=/\(meta\(\)\.(.*?)\)/,Iv=/"nodes":(\[.*?\])/,Tv=/(HASH|hash)\((.*?)\)$/;Zo.exports={AUTH_TYPE:pv,COUCHBASE_ERROR_CODE:dv,COUCHBASE_HOST_PREFIX:gv,COUCHBASE_DEFAULT_KV_CONNECTION_PORT:Ev,DEFAULT_KEY_NAME:yv,DEFAULT_LIMIT:mv,DEFAULT_NAME:Sv,NUM_SAMPLE_VALUES:wv,DISABLED_TOOLTIP:Av,GET_META_REGEXP:Cv,GET_NODES_REGEXP:Iv,GET_PARTITION_HASH_REGEXP:Tv,HOSTING:vv,STATUS:_v}});var ec=le((Mm,jo)=>{var{isObject:Ov}=Wn(),{DEFAULT_LIMIT:xv}=hn(),Ia=class Ia extends Error{constructor({code:a,message:p}){super(),this.code=a,this.message=p}};r(Ia,"CustomError");var Aa=Ia,Ta=class Ta{constructor(a,p){this.host=a.host,this.port=a.port,a!=null&&a.couchbase_username&&(a!=null&&a.couchbase_password)&&(this.password=a.couchbase_password,this.username=a.couchbase_username),this.httpService=p}encodeCredentials(){return Buffer.from(`${this.username}:${this.password}`).toString("base64")}async fetch(a){try{let p=`http://${this.host}:${this.port}${a}`,d={headers:{Authorization:`Basic ${this.encodeCredentials()}`},useElectronNet:!0};return await this.httpService.get(p,d)}catch(p){throw new Aa({message:p.statusText||p.message,code:p.status||p.code})}}async getCollectionDocuments({bucketName:a,scopeName:p,collectionName:y,limit:d}){let m=`/pools/default/buckets/${a}/scopes/${p}/collections/${y}/docs?include_docs=true&limit=${d}&skip=0`;return await this.fetch(m)}async getLocalRandomKey({bucketName:a,scopeName:p,collectionName:y}){let d=`/pools/default/buckets/${a}/scopes/${p}/collections/${y}/localRandomKey`;return await this.fetch(d)}async getIndexes(){return await this.fetch("/indexStatus")}};r(Ta,"CouchbaseRestApiService");var Ca=Ta,Lv=r(i=>{try{return JSON.parse(i)}catch{return i}},"safeParse"),Rv=r(i=>Ov(i)&&!!i.base64&&!!i.meta,"isBinaryFile"),Vo=r(({connectionInfo:i,app:a})=>{let y=a.require("httpService").createInstance(i);return new Ca(i,y)},"createRestApiService"),Dv=r(async({connectionInfo:i,bucketName:a,scopeName:p,collectionName:y,logger:d,app:m})=>{try{d.info(`${a}.${p}.${y}: Start getting documents using REST API`);let b=Vo({connectionInfo:i,app:m}),{rows:N}=await b.getCollectionDocuments({bucketName:a,scopeName:p,collectionName:y,limit:xv});return N.filter(M=>!Rv(M)).map(M=>{var I;return{[a]:Lv((I=M.doc)==null?void 0:I.json),docid:M.id}})}catch(b){return d.error(b),[]}},"getCollectionDocuments"),Pv=r(async({connectionInfo:i,logger:a,app:p})=>{a.info("Start getting indexes using REST API");let y=Vo({connectionInfo:i,app:p}),{indexes:d}=await y.getIndexes();return d},"getIndexes");jo.exports={getCollectionDocuments:Dv,getIndexes:Pv}});var sc=le(($m,uc)=>{var{isPlainObject:bv,isEmpty:ic,isArray:tc}=Wn(),{DEFAULT_KEY_NAME:nc,NUM_SAMPLE_VALUES:Nv}=hn(),Bv=r(({documents:i,bucketName:a,scopeName:p,collectionName:y,collectionIndexes:d,includeEmptyCollection:m,standardDocument:b,fieldInference:N})=>{let M=i.filter(H=>bv(H[a])).map(H=>({[nc]:H.docid,...H[a]})),I=N.active==="field"?b:null,B=!m&&ic(M);return{dbName:p,collectionName:y,collectionDocs:{},standardDoc:I,bucketInfo:{bucket:a},emptyBucket:B,documents:M,containerLevelKeys:{key:nc},entityLevel:{indexes:d}}},"getDbCollectionData"),rc=r((i,a)=>i.length>a?i[a]:i[0],"getSafeValueByIndex"),Mv=r(({property:i,propertyName:a,amountOfSamples:p,result:y})=>{let{samples:d=[],type:m}=i;return[...Array(p).keys()].reduce((b,N)=>{let M=rc(d,N),I=tc(m)?rc(m,N):m,B=b[N]||{};return b[N]={...B,[a]:tc(M)&&I!=="array"?M[0]:M},b},y)},"reduceSamples"),Uv=r(({inference:i,bucketName:a})=>{if(ic(i==null?void 0:i.properties))return[];let p=Math.min(Nv,i["#docs"]??0);return Object.keys(i.properties).reduce((d,m)=>{let b=i.properties[m];return b?Mv({property:b,propertyName:m,amountOfSamples:p,result:d}):d},[]).map(d=>({docid:"",[a]:d}))},"convertInferSchemaToDocuments"),$v=r(({entitiesData:i,indexesByCollectionMap:a,scopeBucketNameMap:p})=>i.map(({bucketName:y,scopeName:d,collectionName:m,ifNotExists:b})=>{var N,M,I,B;return{doc:{bucketInfo:{bucket:y,ifNotExists:(M=(N=p[y])==null?void 0:N[d])==null?void 0:M.ifNotExists},emptyBucket:!m,dbName:d,collectionName:m,entityLevel:{ifNotExists:b,indexes:(B=(I=a==null?void 0:a[y])==null?void 0:I[d])==null?void 0:B[m]}},objectNames:{collectionName:m},collectionDocs:{},jsonSchema:{type:"object"}}}),"mapParsedResultToMultipleSchema"),Fv=r(i=>({}).toString.call(i).split(" ")[1].slice(0,-1).toLowerCase(),"typeOf");uc.exports={getDbCollectionData:Bv,convertInferSchemaToDocuments:Uv,mapParsedResultToMultipleSchema:$v,typeOf:Fv}});var fc=le((Hm,ac)=>{var{NUM_SAMPLE_VALUES:Hv}=hn(),Wv=r(({bucketName:i,scopeName:a,collectionName:p,limit:y})=>`INFER \`${i}\`.\`${a}\`.\`${p}\` WITH {"sample_size":${y}, "num_sample_values":${Hv}};`,"getInferCollectionDocumentsQuery"),qv=r(({bucketName:i,limit:a,offset:p})=>{let y=`SELECT * FROM \`${i}\``;return Oa({query:y,limit:a,offset:p})},"getSelectBucketDocumentsQuery"),Gv=r(({bucketName:i,scopeName:a,collectionName:p,limit:y,offset:d})=>{let m=`SELECT *, META().id AS docid FROM \`${i}\`.\`${a}\`.\`${p}\` AS \`${i}\``;return Oa({query:m,limit:y,offset:d})},"getSelectCollectionDocumentsQuery"),Kv=r(({bucketName:i,scopeName:a,collectionName:p})=>`SELECT COUNT(*) AS size FROM \`${i}\`.\`${a}\`.\`${p}\``,"getCountCollectionDocumentsQuery"),kv=r(()=>"SELECT * FROM system:indexes","getSelectIndexesQuery"),Oa=r(({query:i,limit:a,offset:p})=>i+(a?` LIMIT ${a}`:"")+(p?` OFFSET ${p}`:""),"getQueryOptions");ac.exports={getCountCollectionDocumentsQuery:Kv,getInferCollectionDocumentsQuery:Wv,getSelectBucketDocumentsQuery:qv,getSelectCollectionDocumentsQuery:Gv,getSelectIndexesQuery:kv,getQueryOptions:Oa}});var ku=le((Gm,lc)=>{var qm=Ea(),{get:Yv,uniq:zv,isEmpty:Xv}=Wn(),Jv=ec(),Ku=sc(),{COUCHBASE_ERROR_CODE:pn,DEFAULT_NAME:Qv,DISABLED_TOOLTIP:Zv,STATUS:Vv,DEFAULT_LIMIT:Ei}=hn(),qn=fc(),oc=r(async({cluster:i})=>await i.buckets().getAllBuckets(),"getAllBuckets"),jv=r(async({bucketName:i,cluster:a})=>(await a.buckets().createBucket({name:i}),a.bucket(i)),"createNewBucket"),e1=r(async({cluster:i,selectedBucket:a})=>a?[{name:a}]:oc({cluster:i}),"getBucketsForReverse"),t1=r(async({cluster:i,bucketName:a,logger:p})=>{try{let m=await(await(await i.bucket(a)).collections()).getAllScopes();return n1({scopes:m})}catch(y){return p.error(y),[]}},"getBucketScopes"),n1=r(({scopes:i})=>{let a=r(({name:p})=>p===Qv,"isDefault");return i.reduce((p,y)=>{if(!a(y))return[...p,y];let d=y.collections.filter(m=>!a(m));return Xv(d)?p:[...p,{...y,collections:d}]},[])},"getNonDefaultScopesAndCollections"),r1=r(async({cluster:i,connectionInfo:a,logger:p})=>(await t1({cluster:i,bucketName:a.database,logger:p})).map(d=>{let m=d.collections.map(b=>b.name);return s1({scopeName:d.name,collectionNames:m})}),"getDbCollectionsNames"),i1=r(async({cluster:i,bucketName:a,limit:p=Ei})=>{let y=qn.getSelectBucketDocumentsQuery({bucketName:a,limit:p}),{rows:d}=await i.query(y);return d},"getDocumentsBySelectStatement"),xa=r(({error:i})=>{var a;return((a=i==null?void 0:i.cause)==null?void 0:a.first_error_code)??(i==null?void 0:i.code)},"getErrorCode"),u1=r(({error:i})=>{var p;switch(xa({error:i})){case pn.bucketIsEmpty:return"Collection is empty.";case pn.n1qlMethodsAreNotSupported:return"N1QL methods are not supported.";case pn.parseSyntaxError:case pn.inferMethodIsNotSupport:return"Infer method is not supported.";case pn.userDoesNotHaveAccessToPrivilegeCluster:return"User doesn`t have credentials for privileged cluster.";default:return((p=i==null?void 0:i.cause)==null?void 0:p.first_error_message)||(i==null?void 0:i.message)||""}},"getErrorMessage"),s1=r(({scopeName:i,collectionNames:a,status:p})=>{let y=p===Vv.hasError;return{dbCollections:y?[]:zv(a),dbName:i,...p&&{status:p},...y&&{disabledTooltip:Zv}}},"prepareBucketCollectionNamesData"),cc=r(async({cluster:i,options:a,query:p,logger:y})=>{let{bucketName:d,scopeName:m,collectionName:b,pagination:N,limit:M}=a;if(y.progress("Get data from database",d+"."+m,b),!(N!=null&&N.enabled)){let de=qn.getQueryOptions({query:p,limit:M}),{rows:me}=await i.query(de);return me}let I=Number(a.pagination.value)||Ei,B=Math.ceil(a.limit/I),H=[],q=0;for(let de of B){let me=I*de,Ue=a.limit-me{if(a.active==="absolute")return Number(a.absolute.value);let p=Math.ceil(i*a.relative.value/100);return Math.min(p,a.maxValue)},"getDocSamplingSize"),f1=r(async({cluster:i,bucketName:a,scopeName:p,collectionName:y,recordSamplingSettings:d,logger:m})=>{var b;try{let N=qn.getCountCollectionDocumentsQuery({bucketName:a,scopeName:p,collectionName:y}),{rows:M}=await i.query(N),I=(b=M==null?void 0:M[0])==null?void 0:b.size;return a1({size:I,recordSamplingSettings:d})||Ei}catch(N){return m.error(N),Ei}},"getCollectionSamplingSize"),o1=r(async({cluster:i,bucketName:a,scopeName:p,collectionName:y,limit:d})=>{let m=qn.getInferCollectionDocumentsQuery({bucketName:a,scopeName:p,collectionName:y,limit:d}),{rows:b,meta:N}=await i.query(m),M=Yv(N,"errors.[0]");if(M)throw M;let[[I]]=b;return Ku.convertInferSchemaToDocuments({inference:I,bucketName:a})},"getCollectionDocumentsByInfer"),c1=r(async({cluster:i,data:a,bucketName:p,scopeName:y,collectionName:d,collectionIndexes:m,includeEmptyCollection:b,logger:N,app:M})=>{var I;try{let H={limit:await f1({cluster:i,bucketName:p,scopeName:y,collectionName:d,recordSamplingSettings:a.recordSamplingSettings,logger:N}),pagination:a.pagination,bucketName:p,scopeName:y,collectionName:d},q=qn.getSelectCollectionDocumentsQuery({bucketName:p,scopeName:y,collectionName:d}),de=await cc({cluster:i,options:H,query:q,logger:N}),me=await p1({cluster:i,bucketName:p,scopeName:y,collectionName:d,documentId:(I=de[0])==null?void 0:I.docid,logger:N});return Ku.getDbCollectionData({bucketName:p,scopeName:y,collectionName:d,documents:de,collectionIndexes:m,includeEmptyCollection:b,standardDocument:me,fieldInference:a.fieldInference})}catch(B){return N.error(B),l1({error:B,cluster:i,data:a,bucketName:p,scopeName:y,collectionName:d,collectionIndexes:m,includeEmptyCollection:b,logger:N,app:M})}},"getDbCollectionData"),l1=r(async({error:i,cluster:a,data:p,bucketName:y,scopeName:d,collectionName:m,collectionIndexes:b,includeEmptyCollection:N,logger:M,app:I})=>{try{let B=xa({error:i}),H=[];switch(B){case pn.primaryIndexDoesNotExist:H=await o1({cluster:a,bucketName:y,scopeName:d,collectionName:m,limit:Ei});break;case pn.inferMethodIsNotSupport:case pn.n1qlMethodsAreNotSupported:H=await Jv.getCollectionDocuments({connectionInfo:p.connectionInfo,bucketName:y,scopeName:d,collectionName:m,logger:M,app:I});break}return Ku.getDbCollectionData({bucketName:y,scopeName:d,collectionName:m,documents:H,collectionIndexes:b,includeEmptyCollection:N,fieldInference:p.fieldInference})}catch(B){return M.error(B),Ku.getDbCollectionData({bucketName:y,scopeName:d,collectionName:m,documents:[],collectionIndexes:b,includeEmptyCollection:N,fieldInference:p.fieldInference})}},"getDbCollectionDataByErrorHandling"),h1=r(async({cluster:i,logger:a})=>{try{let p=qn.getSelectIndexesQuery(),{rows:y}=await i.query(p);return y.map(d=>d.indexes)}catch(p){return a.error(p),[]}},"getIndexes"),p1=r(async({cluster:i,bucketName:a,scopeName:p,collectionName:y,documentId:d,logger:m})=>{try{let M=i.bucket(a).scope(p).collection(y),{content:I}=await M.get(d);return I}catch(b){return m.error(b),null}},"getCollectionDocumentByDocumentId");lc.exports={getAllBuckets:oc,createNewBucket:jv,getBucketsForReverse:e1,getDbCollectionsNames:r1,getDbCollectionData:c1,getDocumentsBySelectStatement:i1,getErrorCode:xa,getErrorMessage:u1,getIndexes:h1,getPaginatedQuery:cc}});var vc=le((km,_c)=>{var g1=ku(),{AUTH_TYPE:d1,COUCHBASE_HOST_PREFIX:gc,COUCHBASE_DEFAULT_KV_CONNECTION_PORT:_1,HOSTING:hc}=hn(),lt=null,dc=r(({connectionInfo:i})=>i.host.startsWith(gc.cloud),"isCloudStorage"),pc=r(({connectionInfo:i})=>{if(dc({connectionInfo:i}))return i.host;let a=i.kv_port||_1;return`${gc.selfHosted}${i.host}:${a}`},"generateUrl"),v1=r(({connectionInfo:i})=>i.authType===d1.securityCertificate?{url:pc({connectionInfo:i}),options:{authenticator:{certificatePath:i.security_certificate,keyPath:i.security_certificate_key}}}:{url:pc({connectionInfo:i}),options:{username:i.couchbase_username,password:i.couchbase_password}},"generateConnectionParams"),y1=r(async({connectionInfo:i,app:a})=>{if(lt)return lt;let p=await a.require("couchbase"),{url:y,options:d}=v1({connectionInfo:i});lt=await p.connect(y,d);let m=await g1.getAllBuckets({cluster:lt}),b=i.couchbase_bucket;if(b&&!m.includes(b))throw new Error(`Bucket ${b} doesn't exist`);return lt},"connect"),m1=r(async()=>{await(lt==null?void 0:lt.close()),lt=null},"disconnect"),S1=r(()=>{let i=(lt==null?void 0:lt._connStr)||"";return{hosting:dc({connectionInfo:{host:i}})?hc.capella:hc.selfHosted}},"getConnectionInfo");_c.exports={connect:y1,disconnect:m1,getConnectionInfo:S1}});var yc=le((zm,w1)=>{w1.exports={name:"CouchbaseV7Plus",version:"0.1.3",versionDate:"2024-03-08",author:"hackolade",engines:{hackolade:"7.0.0",hackoladePlugin:"1.0.1"},contributes:{target:{applicationTarget:"CouchbaseV7Plus",title:"Couchbase w/ collections",versions:["7.x"]},features:{enableForwardEngineering:!0,enableArrayCollections:!1}},description:"Hackolade plugin for Couchbase with scopes and collections","lint-staged":{"*.{js,json}":"prettier --write"},"simple-git-hooks":{"pre-commit":"npx lint-staged","pre-push":"npx eslint ."},scripts:{lint:"eslint . --max-warnings=0",package:"node esbuild.package.js"},dependencies:{async:"3.2.5","exponential-backoff":"3.1.1",lodash:"4.17.21",uuid:"9.0.1",antlr4:"4.9.2"},devDependencies:{"@hackolade/hck-esbuild-plugins-pack":"0.0.1","@types/couchbase":"2.4.9",esbuild:"0.19.12","esbuild-plugin-clean":"1.0.1",eslint:"8.56.0","eslint-config-prettier":"9.1.0","eslint-plugin-prettier":"5.1.3","lint-staged":"14.0.1",prettier:"3.2.4","simple-git-hooks":"2.9.0"}}});var wc=le((Xm,Sc)=>{var Yt=require("os"),E1=yc(),{COUCHBASE_ERROR_CODE:A1}=hn(),C1=r(()=>E1.version,"getPluginVersion"),I1=r(i=>`Date: ${new Date} Application version: ${i} Plugin version: ${C1()} diff --git a/package.json b/package.json index da91e6f..f14be89 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "CouchbaseV7Plus", - "version": "0.1.2", + "version": "0.1.3", "versionDate": "2024-03-08", "author": "hackolade", "engines": { diff --git a/properties_pane/container_level/containerLevelConfig.json b/properties_pane/container_level/containerLevelConfig.json index 90775d8..375f5ee 100644 --- a/properties_pane/container_level/containerLevelConfig.json +++ b/properties_pane/container_level/containerLevelConfig.json @@ -117,13 +117,6 @@ making sure that you maintain a proper JSON format. { "lowerTab": "Details", "structure": [ - { - "propertyKeyword": "name", - "validation": { - "regex": "^(^\\b_default\\b$|(?!(_|%))[a-zA-Z0-9%_\\-]{1,251})$", - "required": true - } - }, { "propertyKeyword": "code", "validation": { diff --git a/properties_pane/entity_level/entityLevelConfig.json b/properties_pane/entity_level/entityLevelConfig.json index 10c1a1e..23ca40b 100644 --- a/properties_pane/entity_level/entityLevelConfig.json +++ b/properties_pane/entity_level/entityLevelConfig.json @@ -118,13 +118,6 @@ making sure that you maintain a proper JSON format. { "lowerTab": "Details", "structure": [ - { - "propertyKeyword": "collectionName", - "validation": { - "regex": "^(^\\b_default\\b$|(?!(_|%))[a-zA-Z0-9%_\\-]{1,251})$", - "required": true - } - }, { "propertyKeyword": "code", "validation": { diff --git a/properties_pane/field_level/fieldLevelConfig.json b/properties_pane/field_level/fieldLevelConfig.json index 460f4ea..a2a8557 100644 --- a/properties_pane/field_level/fieldLevelConfig.json +++ b/properties_pane/field_level/fieldLevelConfig.json @@ -117,13 +117,6 @@ making sure that you maintain a proper JSON format. "lowerTab": "JsonDetails", "structure": { "string": [ - { - "fieldKeyword": "name", - "validation": { - "regex": "^(\\$id|\\$ref|\\$db|(?![\\s\\S]*\\.)(?!\\$[\\s\\S]*)([\\s\\S]*))$", - "required": true - } - }, { "fieldKeyword": "code", "validation": { @@ -149,13 +142,6 @@ making sure that you maintain a proper JSON format. "comments" ], "number": [ - { - "fieldKeyword": "name", - "validation": { - "regex": "^(\\$id|\\$ref|\\$db|(?![\\s\\S]*\\.)(?!\\$[\\s\\S]*)([\\s\\S]*))$", - "required": true - } - }, { "fieldKeyword": "code", "validation": { @@ -184,13 +170,6 @@ making sure that you maintain a proper JSON format. "comments" ], "boolean": [ - { - "fieldKeyword": "name", - "validation": { - "regex": "^(\\$id|\\$ref|\\$db|(?![\\s\\S]*\\.)(?!\\$[\\s\\S]*)([\\s\\S]*))$", - "required": true - } - }, { "fieldKeyword": "code", "validation": { @@ -207,13 +186,6 @@ making sure that you maintain a proper JSON format. "comments" ], "object": [ - { - "fieldKeyword": "name", - "validation": { - "regex": "^(\\$id|\\$ref|\\$db|(?![\\s\\S]*\\.)(?!\\$[\\s\\S]*)([\\s\\S]*))$", - "required": true - } - }, { "fieldKeyword": "code", "validation": { @@ -231,13 +203,6 @@ making sure that you maintain a proper JSON format. "comments" ], "array": [ - { - "fieldKeyword": "name", - "validation": { - "regex": "^(\\$id|\\$ref|\\$db|(?![\\s\\S]*\\.)(?!\\$[\\s\\S]*)([\\s\\S]*))$", - "required": true - } - }, { "fieldKeyword": "code", "validation": { @@ -256,13 +221,6 @@ making sure that you maintain a proper JSON format. "comments" ], "null": [ - { - "fieldKeyword": "name", - "validation": { - "regex": "^(\\$id|\\$ref|\\$db|(?![\\s\\S]*\\.)(?!\\$[\\s\\S]*)([\\s\\S]*))$", - "required": true - } - }, { "fieldKeyword": "code", "validation": { diff --git a/reverse_engineering/api.js b/reverse_engineering/api.js index ee32f4e..480ffbe 100644 --- a/reverse_engineering/api.js +++ b/reverse_engineering/api.js @@ -20,7 +20,7 @@ function print() { __p += __j.call(arguments, '') } }`;var c0=u4(function(){return A0(b,Q+"return "+q).apply(l,L)});if(c0.source=q,Kd(c0))throw c0;return c0}h(mC,"template");function AC(s){return g0(s).toLowerCase()}h(AC,"toLower");function CC(s){return g0(s).toUpperCase()}h(CC,"toUpper");function gC(s,i,c){if(s=g0(s),s&&(c||i===l))return cR(s);if(!s||!(i=bu(i)))return s;var f=Yu(s),x=Yu(i),b=lR(f,x),L=oR(f,x)+1;return le(f,b,L).join("")}h(gC,"trim");function LC(s,i,c){if(s=g0(s),s&&(c||i===l))return s.slice(0,fR(s)+1);if(!s||!(i=bu(i)))return s;var f=Yu(s),x=oR(f,Yu(i))+1;return le(f,0,x).join("")}h(LC,"trimEnd");function yC(s,i,c){if(s=g0(s),s&&(c||i===l))return s.replace(tn,"");if(!s||!(i=bu(i)))return s;var f=Yu(s),x=lR(f,Yu(i));return le(f,x).join("")}h(yC,"trimStart");function NC(s,i){var c=Po,f=So;if(I0(i)){var x="separator"in i?i.separator:x;c="length"in i?a0(i.length):c,f="omission"in i?bu(i.omission):f}s=g0(s);var b=s.length;if(nr(s)){var L=Yu(s);b=L.length}if(c>=b)return s;var w=c-hr(f);if(w<1)return f;var I=L?le(L,0,w).join(""):s.slice(0,w);if(x===l)return I+f;if(L&&(w+=I.length-w),Wd(x)){if(s.slice(w).search(x)){var F,B=I;for(x.global||(x=hd(x.source,g0(fc.exec(x))+"g")),x.lastIndex=0;F=x.exec(B);)var q=F.index;I=I.slice(0,q===l?w:q)}}else if(s.indexOf(bu(x),w)!=w){var W=I.lastIndexOf(x);W>-1&&(I=I.slice(0,W))}return I+f}h(NC,"truncate");function wC(s){return s=g0(s),s&&Go.test(s)?s.replace(lc,s6):s}h(wC,"unescape");var OC=fr(function(s,i,c){return s+(c?" ":"")+i.toUpperCase()}),$d=t7("toUpperCase");function Z7(s,i,c){return s=g0(s),i=c?l:i,i===l?JT(s)?n6(s):Ot(s):s.match(i)||[]}h(Z7,"words");var u4=o0(function(s,i){try{return m(s,l,i)}catch(c){return Kd(c)?c:new i0(c)}}),IC=Dt(function(s,i){return A(i,function(c){c=_t(c),Pt(s,c,Gd(s[c],s))}),s});function UC(s){var i=s==null?0:s.length,c=e0();return s=i?M(s,function(f){if(typeof f[1]!="function")throw new Nu(a);return[c(f[0]),f[1]]}):[],o0(function(f){for(var x=-1;++xlt)return[];var c=yu,f=Q0(s,yu);i=e0(i),s-=yu;for(var x=It(f,i);++c0||i<0)?new R0(c):(s<0?c=c.takeRight(-s):s&&(c=c.drop(s)),i!==l&&(i=a0(i),c=i<0?c.dropRight(-i):c.take(i-s)),c)},R0.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},R0.prototype.toArray=function(){return this.take(yu)},ft(R0.prototype,function(s,i){var c=/^(?:filter|find|map|reject)|While$/.test(i),f=/^(?:head|last)$/.test(i),x=T[f?"take"+(i=="last"?"Right":""):i],b=f||/^find/.test(i);x&&(T.prototype[i]=function(){var L=this.__wrapped__,w=f?[1]:arguments,I=L instanceof R0,F=w[0],B=I||n0(L),q=h(function(x0){var T0=x.apply(T,Y([x0],w));return f&&W?T0[0]:T0},"interceptor");B&&c&&typeof F=="function"&&F.length!=1&&(I=B=!1);var W=this.__chain__,Q=!!this.__actions__.length,s0=b&&!W,c0=I&&!Q;if(!b&&B){L=c0?L:new R0(this);var r0=s.apply(L,w);return r0.__actions__.push({func:al,args:[q],thisArg:l}),new wu(r0,W)}return s0&&c0?s.apply(this,w):(r0=this.thru(q),s0?f?r0.value()[0]:r0.value():r0)})}),A(["pop","push","shift","sort","splice","unshift"],function(s){var i=Sc[s],c=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",f=/^(?:pop|shift)$/.test(s);T.prototype[s]=function(){var x=arguments;if(f&&!this.__chain__){var b=this.value();return i.apply(n0(b)?b:[],x)}return this[c](function(L){return i.apply(n0(L)?L:[],x)})}}),ft(R0.prototype,function(s,i){var c=T[i];if(c){var f=c.name+"";L0.call(lr,f)||(lr[f]=[]),lr[f].push({name:i,func:c})}}),lr[tl(l,w0).name]=[{name:"wrapper",func:l}],R0.prototype.clone=w6,R0.prototype.reverse=O6,R0.prototype.value=I6,T.prototype.at=im,T.prototype.chain=nm,T.prototype.commit=hm,T.prototype.next=am,T.prototype.plant=lm,T.prototype.reverse=om,T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=dm,T.prototype.first=T.prototype.head,mn&&(T.prototype[mn]=cm),T},"runInContext"),ie=h6();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(P0._=ie,define(function(){return ie})):dt?((dt.exports=ie)._=ie,_n._=ie):P0._=ie}).call(Er)});var i4=$((xl,r4)=>{(function(l,u){typeof xl=="object"&&typeof r4<"u"?u(xl):typeof define=="function"&&define.amd?define(["exports"],u):(l=typeof globalThis<"u"?globalThis:l||self,u(l.async={}))})(xl,function(l){"use strict";function u(m,...R){return(...A)=>m(...R,...A)}h(u,"apply");function t(m){return function(...R){var A=R.pop();return m.call(this,R,A)}}h(t,"initialParams");var e=typeof queueMicrotask=="function"&&queueMicrotask,a=typeof setImmediate=="function"&&setImmediate,d=typeof process=="object"&&typeof process.nextTick=="function";function p(m){setTimeout(m,0)}h(p,"fallback");function _(m){return(R,...A)=>m(()=>R(...A))}h(_,"wrap");var E;e?E=queueMicrotask:a?E=setImmediate:d?E=process.nextTick:E=p;var y=_(E);function H(m){return t0(m)?function(...R){let A=R.pop(),N=m.apply(this,R);return V(N,A)}:t(function(R,A){var N;try{N=m.apply(this,R)}catch(U){return A(U)}if(N&&typeof N.then=="function")return V(N,A);A(null,N)})}h(H,"asyncify");function V(m,R){return m.then(A=>{K(R,null,A)},A=>{K(R,A&&(A instanceof Error||A.message)?A:new Error(A))})}h(V,"handlePromise");function K(m,R,A){try{m(R,A)}catch(N){y(U=>{throw U},N)}}h(K,"invokeCallback");function t0(m){return m[Symbol.toStringTag]==="AsyncFunction"}h(t0,"isAsync");function f0(m){return m[Symbol.toStringTag]==="AsyncGenerator"}h(f0,"isAsyncGenerator");function w0(m){return typeof m[Symbol.asyncIterator]=="function"}h(w0,"isAsyncIterable");function j(m){if(typeof m!="function")throw new Error("expected a function");return t0(m)?H(m):m}h(j,"wrapAsync");function Z(m,R){if(R||(R=m.length),!R)throw new Error("arity is undefined");function A(...N){return typeof N[R-1]=="function"?m.apply(this,N):new Promise((U,v)=>{N[R-1]=(S,...D)=>{if(S)return v(S);U(D.length>1?D:D[0])},m.apply(this,N)})}return h(A,"awaitable"),A}h(Z,"awaitify");function Fu(m){return h(function(A,...N){return Z(function(v){var S=this;return m(A,(D,M)=>{j(D).apply(S,N.concat(M))},v)})},"applyEach")}h(Fu,"applyEach$1");function z0(m,R,A,N){R=R||[];var U=[],v=0,S=j(A);return m(R,(D,M,Y)=>{var l0=v++;S(D,(b0,d0)=>{U[l0]=d0,Y(b0)})},D=>{N(D,U)})}h(z0,"_asyncMap");function Bu(m){return m&&typeof m.length=="number"&&m.length>=0&&m.length%1===0}h(Bu,"isArrayLike");var at={};function Lu(m){function R(...A){if(m!==null){var N=m;m=null,N.apply(this,A)}}return h(R,"wrapper"),Object.assign(R,m),R}h(Lu,"once");function Po(m){return m[Symbol.iterator]&&m[Symbol.iterator]()}h(Po,"getIterator");function So(m){var R=-1,A=m.length;return h(function(){return++R=R||S||U||(S=!0,m.next().then(({value:d0,done:fu})=>{if(!(v||U)){if(S=!1,fu){U=!0,D<=0&&N(null);return}D++,A(d0,M,l0),M++,Y()}}).catch(b0))}h(Y,"replenish");function l0(d0,fu){if(D-=1,!v){if(d0)return b0(d0);if(d0===!1){U=!0,v=!0;return}if(fu===at||U&&D<=0)return U=!0,N(null);Y()}}h(l0,"iterateeCallback");function b0(d0){v||(S=!1,U=!0,N(d0))}h(b0,"handleError"),Y()}h(nc,"asyncEachOfLimit");var B0=h(m=>(R,A,N)=>{if(N=Lu(N),m<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!R)return N(null);if(f0(R))return nc(R,m,A,N);if(w0(R))return nc(R[Symbol.asyncIterator](),m,A,N);var U=ic(R),v=!1,S=!1,D=0,M=!1;function Y(b0,d0){if(!S)if(D-=1,b0)v=!0,N(b0);else if(b0===!1)v=!0,S=!0;else{if(d0===at||v&&D<=0)return v=!0,N(null);M||l0()}}h(Y,"iterateeCallback");function l0(){for(M=!0;D1?U:U[0])}return h(A,"callback"),A[Gu]=new Promise((N,U)=>{m=N,R=U}),A}h(yt,"promiseCallback");function tu(m,R,A){typeof R!="number"&&(A=R,R=null),A=Lu(A||yt());var N=Object.keys(m).length;if(!N)return A(null);R||(R=N);var U={},v=0,S=!1,D=!1,M=Object.create(null),Y=[],l0=[],b0={};Object.keys(m).forEach(z=>{var u0=m[z];if(!Array.isArray(u0)){d0(z,[u0]),l0.push(z);return}var _0=u0.slice(0,u0.length-1),N0=_0.length;if(N0===0){d0(z,u0),l0.push(z);return}b0[z]=N0,_0.forEach(U0=>{if(!m[U0])throw new Error("async.auto task `"+z+"` has a non-existent dependency `"+U0+"` in "+_0.join(", "));te(U0,()=>{N0--,N0===0&&d0(z,u0)})})}),p0(),fu();function d0(z,u0){Y.push(()=>ee(z,u0))}h(d0,"enqueueTask");function fu(){if(!S){if(Y.length===0&&v===0)return A(null,U);for(;Y.length&&v_0()),fu()}h(Ot,"taskComplete");function ee(z,u0){if(!D){var _0=ct((U0,...su)=>{if(v--,U0===!1){S=!0;return}if(su.length<2&&([su]=su),U0){var se={};if(Object.keys(U).forEach(Wu=>{se[Wu]=U[Wu]}),se[z]=su,D=!0,M=Object.create(null),S)return;A(U0,se)}else U[z]=su,Ot(z)});v++;var N0=j(u0[u0.length-1]);u0.length>1?N0(U,_0):N0(_0)}}h(ee,"runTask");function p0(){for(var z,u0=0;l0.length;)z=l0.pop(),u0++,J(z).forEach(_0=>{--b0[_0]===0&&l0.push(_0)});if(u0!==N)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}h(p0,"checkForDeadlocks");function J(z){var u0=[];return Object.keys(m).forEach(_0=>{let N0=m[_0];Array.isArray(N0)&&N0.indexOf(z)>=0&&u0.push(_0)}),u0}return h(J,"getDependents"),A[Gu]}h(tu,"auto");var ve=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,Bo=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,Vu=/,/,hc=/(=.+)?(\s*)$/;function qo(m){let R="",A=0,N=m.indexOf("*/");for(;AU.replace(hc,"").trim())}h(Pe,"parseParams");function du(m,R){var A={};return Object.keys(m).forEach(N=>{var U=m[N],v,S=t0(U),D=!S&&U.length===1||S&&U.length===0;if(Array.isArray(U))v=[...U],U=v.pop(),A[N]=v.concat(v.length>0?M:U);else if(D)A[N]=U;else{if(v=Pe(U),U.length===0&&!S&&v.length===0)throw new Error("autoInject task functions require explicit parameters.");S||v.pop(),A[N]=v.concat(M)}function M(Y,l0){var b0=v.map(d0=>Y[d0]);b0.push(l0),j(U)(...b0)}h(M,"newTask")}),tu(A,R)}h(du,"autoInject");let rr=class rr{constructor(){this.head=this.tail=null,this.length=0}removeLink(R){return R.prev?R.prev.next=R.next:this.head=R.next,R.next?R.next.prev=R.prev:this.tail=R.prev,R.prev=R.next=null,this.length-=1,R}empty(){for(;this.head;)this.shift();return this}insertAfter(R,A){A.prev=R,A.next=R.next,R.next?R.next.prev=A:this.tail=A,R.next=A,this.length+=1}insertBefore(R,A){A.prev=R.prev,A.next=R,R.prev?R.prev.next=A:this.head=A,R.prev=A,this.length+=1}unshift(R){this.head?this.insertBefore(this.head,R):Se(this,R)}push(R){this.tail?this.insertAfter(this.tail,R):Se(this,R)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var R=this.head;R;)yield R.data,R=R.next}remove(R){for(var A=this.head;A;){var{next:N}=A;R(A)&&this.removeLink(A),A=N}return this}};h(rr,"DLL");let Nt=rr;function Se(m,R){m.length=1,m.head=m.tail=R}h(Se,"setInitial");function zi(m,R,A){if(R==null)R=1;else if(R===0)throw new RangeError("Concurrency must not be zero");var N=j(m),U=0,v=[];let S={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function D(J,z){S[J].push(z)}h(D,"on");function M(J,z){let u0=h((..._0)=>{Y(J,u0),z(..._0)},"handleAndRemove");S[J].push(u0)}h(M,"once");function Y(J,z){if(!J)return Object.keys(S).forEach(u0=>S[u0]=[]);if(!z)return S[J]=[];S[J]=S[J].filter(u0=>u0!==z)}h(Y,"off");function l0(J,...z){S[J].forEach(u0=>u0(...z))}h(l0,"trigger");var b0=!1;function d0(J,z,u0,_0){if(_0!=null&&typeof _0!="function")throw new Error("task callback must be a function");p0.started=!0;var N0,U0;function su(Wu,...It){if(Wu)return u0?U0(Wu):N0();if(It.length<=1)return N0(It[0]);N0(It)}h(su,"promiseCallback");var se=p0._createTaskItem(J,u0?su:_0||su);if(z?p0._tasks.unshift(se):p0._tasks.push(se),b0||(b0=!0,y(()=>{b0=!1,p0.process()})),u0||!_0)return new Promise((Wu,It)=>{N0=Wu,U0=It})}h(d0,"_insert");function fu(J){return function(z,...u0){U-=1;for(var _0=0,N0=J.length;_00&&v.splice(su,1),U0.callback(z,...u0),z!=null&&l0("error",z,U0.data)}U<=p0.concurrency-p0.buffer&&l0("unsaturated"),p0.idle()&&l0("drain"),p0.process()}}h(fu,"_createCB");function te(J){return J.length===0&&p0.idle()?(y(()=>l0("drain")),!0):!1}h(te,"_maybeDrain");let Ot=h(J=>z=>{if(!z)return new Promise((u0,_0)=>{M(J,(N0,U0)=>{if(N0)return _0(N0);u0(U0)})});Y(J),D(J,z)},"eventMethod");var ee=!1,p0={_tasks:new Nt,_createTaskItem(J,z){return{data:J,callback:z}},*[Symbol.iterator](){yield*p0._tasks[Symbol.iterator]()},concurrency:R,payload:A,buffer:R/4,started:!1,paused:!1,push(J,z){return Array.isArray(J)?te(J)?void 0:J.map(u0=>d0(u0,!1,!1,z)):d0(J,!1,!1,z)},pushAsync(J,z){return Array.isArray(J)?te(J)?void 0:J.map(u0=>d0(u0,!1,!0,z)):d0(J,!1,!0,z)},kill(){Y(),p0._tasks.empty()},unshift(J,z){return Array.isArray(J)?te(J)?void 0:J.map(u0=>d0(u0,!0,!1,z)):d0(J,!0,!1,z)},unshiftAsync(J,z){return Array.isArray(J)?te(J)?void 0:J.map(u0=>d0(u0,!0,!0,z)):d0(J,!0,!0,z)},remove(J){p0._tasks.remove(J)},process(){if(!ee){for(ee=!0;!p0.paused&&U{U(R,v,(M,Y)=>{R=Y,D(M)})},v=>N(v,R))}h(De,"reduce");var eu=Z(De,4);function He(...m){var R=m.map(j);return function(...A){var N=this,U=A[A.length-1];return typeof U=="function"?A.pop():U=yt(),eu(R,A,(v,S,D)=>{S.apply(N,v.concat((M,...Y)=>{D(M,Y)}))},(v,S)=>U(v,...S)),U[Gu]}}h(He,"seq");function vs(...m){return He(...m.reverse())}h(vs,"compose");function Qi(m,R,A,N){return z0(B0(R),m,A,N)}h(Qi,"mapLimit");var wt=Z(Qi,4);function ji(m,R,A,N){var U=j(A);return wt(m,R,(v,S)=>{U(v,(D,...M)=>D?S(D):S(D,M))},(v,S)=>{for(var D=[],M=0;M{var S=!1,D;let M=j(U);A(N,(Y,l0,b0)=>{M(Y,(d0,fu)=>{if(d0||d0===!1)return b0(d0);if(m(fu)&&!D)return S=!0,D=R(!0,Y),b0(null,at);b0()})},Y=>{if(Y)return v(Y);v(null,S?D:R(!1))})}}h(Ku,"_createTester");function lc(m,R,A){return Ku(N=>N,(N,U)=>U)(uu,m,R,A)}h(lc,"detect");var Me=Z(lc,3);function Go(m,R,A,N){return Ku(U=>U,(U,v)=>v)(B0(R),m,A,N)}h(Go,"detectLimit");var Ss=Z(Go,4);function Vo(m,R,A){return Ku(N=>N,(N,U)=>U)(B0(1),m,R,A)}h(Vo,"detectSeries");var Ds=Z(Vo,3);function un(m){return(R,...A)=>j(R)(...A,(N,...U)=>{typeof console=="object"&&(N?console.error&&console.error(N):console[m]&&U.forEach(v=>console[m](v)))})}h(un,"consoleFunc");var oc=un("dir");function Ko(m,R,A){A=ct(A);var N=j(m),U=j(R),v;function S(M,...Y){if(M)return A(M);M!==!1&&(v=Y,U(...Y,D))}h(S,"next");function D(M,Y){if(M)return A(M);if(M!==!1){if(!Y)return A(null,...v);N(S)}}return h(D,"check"),D(null,!0)}h(Ko,"doWhilst");var ke=Z(Ko,3);function Hs(m,R,A){let N=j(R);return ke(m,(...U)=>{let v=U.pop();N(...U,(S,D)=>v(S,!D))},A)}h(Hs,"doUntil");function dc(m){return(R,A,N)=>m(R,N)}h(dc,"_withoutIndex");function tn(m,R,A){return uu(m,dc(j(R)),A)}h(tn,"eachLimit$2");var Ms=Z(tn,3);function Wo(m,R,A,N){return B0(R)(m,dc(j(A)),N)}h(Wo,"eachLimit");var Fe=Z(Wo,4);function Yo(m,R,A){return Fe(m,1,R,A)}h(Yo,"eachSeries");var Be=Z(Yo,3);function en(m){return t0(m)?m:function(...R){var A=R.pop(),N=!0;R.push((...U)=>{N?y(()=>A(...U)):A(...U)}),m.apply(this,R),N=!1}}h(en,"ensureAsync");function Xo(m,R,A){return Ku(N=>!N,N=>!N)(uu,m,R,A)}h(Xo,"every");var ks=Z(Xo,3);function fc(m,R,A,N){return Ku(U=>!U,U=>!U)(B0(R),m,A,N)}h(fc,"everyLimit");var Fs=Z(fc,4);function $o(m,R,A){return Ku(N=>!N,N=>!N)(W0,m,R,A)}h($o,"everySeries");var Bs=Z($o,3);function zo(m,R,A,N){var U=new Array(R.length);m(R,(v,S,D)=>{A(v,(M,Y)=>{U[S]=!!Y,D(M)})},v=>{if(v)return N(v);for(var S=[],D=0;D{A(v,(M,Y)=>{if(M)return D(M);Y&&U.push({index:S,value:v}),D(M)})},v=>{if(v)return N(v);N(null,U.sort((S,D)=>S.index-D.index).map(S=>S.value))})}h(Qo,"filterGeneric");function qs(m,R,A,N){var U=Bu(R)?zo:Qo;return U(m,R,j(A),N)}h(qs,"_filter");function Gs(m,R,A){return qs(uu,m,R,A)}h(Gs,"filter");var Vs=Z(Gs,3);function Ks(m,R,A,N){return qs(B0(R),m,A,N)}h(Ks,"filterLimit");var Ws=Z(Ks,4);function jo(m,R,A){return qs(W0,m,R,A)}h(jo,"filterSeries");var Ys=Z(jo,3);function pc(m,R){var A=ct(R),N=j(en(m));function U(v){if(v)return A(v);v!==!1&&N(U)}return h(U,"next"),U()}h(pc,"forever");var sn=Z(pc,2);function _c(m,R,A,N){var U=j(A);return wt(m,R,(v,S)=>{U(v,(D,M)=>D?S(D):S(D,{key:M,val:v}))},(v,S)=>{for(var D={},{hasOwnProperty:M}=Object.prototype,Y=0;Y{v(S,D,(Y,l0)=>{if(Y)return M(Y);U[D]=l0,M(Y)})},S=>N(S,U))}h(Tc,"mapValuesLimit");var qe=Z(Tc,4);function rn(m,R,A){return qe(m,1/0,R,A)}h(rn,"mapValues");function $s(m,R,A){return qe(m,1,R,A)}h($s,"mapValuesSeries");function bc(m,R=A=>A){var A=Object.create(null),N=Object.create(null),U=j(m),v=t((S,D)=>{var M=R(...S);M in A?y(()=>D(null,...A[M])):M in N?N[M].push(D):(N[M]=[D],U(...S,(Y,...l0)=>{Y||(A[M]=l0);var b0=N[M];delete N[M];for(var d0=0,fu=b0.length;d0{var N=Bu(R)?[]:{};m(R,(U,v,S)=>{j(U)((D,...M)=>{M.length<2&&([M]=M),N[v]=M,S(D)})},U=>A(U,N))},3);function mc(m,R){return zs(uu,m,R)}h(mc,"parallel");function nn(m,R,A){return zs(B0(R),m,A)}h(nn,"parallelLimit");function Qs(m,R){var A=j(m);return zi((N,U)=>{A(N[0],U)},R,1)}h(Qs,"queue");let ir=class ir{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(R){let A;for(;R>0&&We(this.heap[R],this.heap[A=hn(R)]);){let N=this.heap[R];this.heap[R]=this.heap[A],this.heap[A]=N,R=A}}percDown(R){let A;for(;(A=Jo(R))=0;N--)this.percDown(N);return this}};h(ir,"Heap");let Ke=ir;function Jo(m){return(m<<1)+1}h(Jo,"leftChi");function hn(m){return(m+1>>1)-1}h(hn,"parent");function We(m,R){return m.priority!==R.priority?m.priority({data:S,priority:D,callback:M});function v(S,D){return Array.isArray(S)?S.map(M=>({data:M,priority:D})):{data:S,priority:D}}return h(v,"createDataItems"),A.push=function(S,D=0,M){return N(v(S,D),M)},A.pushAsync=function(S,D=0,M){return U(v(S,D),M)},delete A.unshift,delete A.unshiftAsync,A}h(js,"priorityQueue");function ue(m,R){if(R=Lu(R),!Array.isArray(m))return R(new TypeError("First argument to race must be an array of functions"));if(!m.length)return R();for(var A=0,N=m.length;A{let D={};if(v&&(D.error=v),S.length>0){var M=S;S.length<=1&&([M]=S),D.value=M}U(null,D)}),R.apply(this,N)},"reflectOn"))}h(Js,"reflect");function cn(m){var R;return Array.isArray(m)?R=m.map(Js):(R={},Object.keys(m).forEach(A=>{R[A]=Js.call(this,m[A])})),R}h(cn,"reflectAll");function Zs(m,R,A,N){let U=j(A);return qs(m,R,(v,S)=>{U(v,(D,M)=>{S(D,!M)})},N)}h(Zs,"reject$2");function Ac(m,R,A){return Zs(uu,m,R,A)}h(Ac,"reject");var ln=Z(Ac,3);function Zo(m,R,A,N){return Zs(B0(R),m,A,N)}h(Zo,"rejectLimit");var Cc=Z(Zo,4);function ud(m,R,A){return Zs(W0,m,R,A)}h(ud,"rejectSeries");var on=Z(ud,3);function gc(m){return function(){return m}}h(gc,"constant");let dn=5,Lc=0;function ur(m,R,A){var N={times:dn,intervalFunc:gc(Lc)};if(arguments.length<3&&typeof m=="function"?(A=R||yt(),R=m):(fn(N,m),A=A||yt()),typeof R!="function")throw new Error("Invalid arguments for async.retry");var U=j(R),v=1;function S(){U((D,...M)=>{D!==!1&&(D&&v++{(U.lengthN)(uu,m,R,A)}h(td,"some");var tr=Z(td,3);function ed(m,R,A,N){return Ku(Boolean,U=>U)(B0(R),m,A,N)}h(ed,"someLimit");var C0=Z(ed,4);function y0(m,R,A){return Ku(Boolean,N=>N)(W0,m,R,A)}h(y0,"someSeries");var er=Z(y0,3);function sd(m,R,A){var N=j(R);return qu(m,(v,S)=>{N(v,(D,M)=>{if(D)return S(D);S(D,{value:v,criteria:M})})},(v,S)=>{if(v)return A(v);A(null,S.sort(U).map(D=>D.value))});function U(v,S){var D=v.criteria,M=S.criteria;return DM?1:0}}h(sd,"sortBy");var wc=Z(sd,3);function Oc(m,R,A){var N=j(m);return t((U,v)=>{var S=!1,D;function M(){var Y=m.name||"anonymous",l0=new Error('Callback function "'+Y+'" timed out.');l0.code="ETIMEDOUT",A&&(l0.info=A),S=!0,v(l0)}h(M,"timeoutCallback"),U.push((...Y)=>{S||(v(...Y),clearTimeout(D))}),D=setTimeout(M,R),N(...U)})}h(Oc,"timeout");function rd(m){for(var R=Array(m);m--;)R[m]=m;return R}h(rd,"range");function sr(m,R,A,N){var U=j(A);return wt(rd(m),R,U,N)}h(sr,"timesLimit");function pn(m,R,A){return sr(m,1/0,R,A)}h(pn,"times");function Ic(m,R,A){return sr(m,1,R,A)}h(Ic,"timesSeries");function P0(m,R,A,N){arguments.length<=3&&typeof R=="function"&&(N=A,A=R,R=Array.isArray(m)?[]:{}),N=Lu(N||yt());var U=j(A);return uu(m,(v,S,D)=>{U(R,v,S,D)},v=>N(v,R)),N[Gu]}h(P0,"transform");function _n(m,R){var A=null,N;return Be(m,(U,v)=>{j(U)((S,...D)=>{if(S===!1)return v(S);D.length<2?[N]=D:N=D,A=S,v(S?null:{})})},()=>R(A,N))}h(_n,"tryEach");var dt=Z(_n);function xn(m){return(...R)=>(m.unmemoized||m)(...R)}h(xn,"unmemoize");function En(m,R,A){A=ct(A);var N=j(R),U=j(m),v=[];function S(M,...Y){if(M)return A(M);v=Y,M!==!1&&U(D)}h(S,"next");function D(M,Y){if(M)return A(M);if(M!==!1){if(!Y)return A(null,...v);N(S)}}return h(D,"check"),U(D)}h(En,"whilst");var V0=Z(En,3);function Rn(m,R,A){let N=j(m);return V0(U=>N((v,S)=>U(v,!S)),R,A)}h(Rn,"until");function Uc(m,R){if(R=Lu(R),!Array.isArray(m))return R(new Error("First argument to waterfall must be an array of functions"));if(!m.length)return R();var A=0;function N(v){var S=j(m[A++]);S(...v,ct(U))}h(N,"nextTask");function U(v,...S){if(v!==!1){if(v||A===m.length)return R(v,...S);N(S)}}h(U,"next"),N([])}h(Uc,"waterfall");var Tn=Z(Uc),vc={apply:u,applyEach:Oe,applyEachSeries:Ue,asyncify:H,auto:tu,autoInject:du,cargo:Jt,cargoQueue:ac,compose:vs,concat:Zt,concatLimit:ot,concatSeries:Ps,constant:cc,detect:Me,detectLimit:Ss,detectSeries:Ds,dir:oc,doUntil:Hs,doWhilst:ke,each:Ms,eachLimit:Fe,eachOf:uu,eachOfLimit:jt,eachOfSeries:W0,eachSeries:Be,ensureAsync:en,every:ks,everyLimit:Fs,everySeries:Bs,filter:Vs,filterLimit:Ws,filterSeries:Ys,forever:sn,groupBy:xc,groupByLimit:Xs,groupBySeries:Ec,log:Rc,map:qu,mapLimit:wt,mapSeries:$i,mapValues:rn,mapValuesLimit:qe,mapValuesSeries:$s,memoize:bc,nextTick:Ve,parallel:mc,parallelLimit:nn,priorityQueue:js,queue:Qs,race:an,reduce:eu,reduceRight:Ye,reflect:Js,reflectAll:cn,reject:ln,rejectLimit:Cc,rejectSeries:on,retry:ur,retryable:yc,seq:He,series:Nc,setImmediate:y,some:tr,someLimit:C0,someSeries:er,sortBy:wc,timeout:Oc,times:pn,timesLimit:sr,timesSeries:Ic,transform:P0,tryEach:dt,unmemoize:xn,until:Rn,waterfall:Tn,whilst:V0,all:ks,allLimit:Fs,allSeries:Bs,any:tr,anyLimit:C0,anySeries:er,find:Me,findLimit:Ss,findSeries:Ds,flatMap:Zt,flatMapLimit:ot,flatMapSeries:Ps,forEach:Ms,forEachSeries:Be,forEachLimit:Fe,forEachOf:uu,forEachOfSeries:W0,forEachOfLimit:jt,inject:eu,foldl:eu,foldr:Ye,select:Vs,selectLimit:Ws,selectSeries:Ys,wrapSync:H,during:V0,doDuring:ke};l.all=ks,l.allLimit=Fs,l.allSeries=Bs,l.any=tr,l.anyLimit=C0,l.anySeries=er,l.apply=u,l.applyEach=Oe,l.applyEachSeries=Ue,l.asyncify=H,l.auto=tu,l.autoInject=du,l.cargo=Jt,l.cargoQueue=ac,l.compose=vs,l.concat=Zt,l.concatLimit=ot,l.concatSeries=Ps,l.constant=cc,l.default=vc,l.detect=Me,l.detectLimit=Ss,l.detectSeries=Ds,l.dir=oc,l.doDuring=ke,l.doUntil=Hs,l.doWhilst=ke,l.during=V0,l.each=Ms,l.eachLimit=Fe,l.eachOf=uu,l.eachOfLimit=jt,l.eachOfSeries=W0,l.eachSeries=Be,l.ensureAsync=en,l.every=ks,l.everyLimit=Fs,l.everySeries=Bs,l.filter=Vs,l.filterLimit=Ws,l.filterSeries=Ys,l.find=Me,l.findLimit=Ss,l.findSeries=Ds,l.flatMap=Zt,l.flatMapLimit=ot,l.flatMapSeries=Ps,l.foldl=eu,l.foldr=Ye,l.forEach=Ms,l.forEachLimit=Fe,l.forEachOf=uu,l.forEachOfLimit=jt,l.forEachOfSeries=W0,l.forEachSeries=Be,l.forever=sn,l.groupBy=xc,l.groupByLimit=Xs,l.groupBySeries=Ec,l.inject=eu,l.log=Rc,l.map=qu,l.mapLimit=wt,l.mapSeries=$i,l.mapValues=rn,l.mapValuesLimit=qe,l.mapValuesSeries=$s,l.memoize=bc,l.nextTick=Ve,l.parallel=mc,l.parallelLimit=nn,l.priorityQueue=js,l.queue=Qs,l.race=an,l.reduce=eu,l.reduceRight=Ye,l.reflect=Js,l.reflectAll=cn,l.reject=ln,l.rejectLimit=Cc,l.rejectSeries=on,l.retry=ur,l.retryable=yc,l.select=Vs,l.selectLimit=Ws,l.selectSeries=Ys,l.seq=He,l.series=Nc,l.setImmediate=y,l.some=tr,l.someLimit=C0,l.someSeries=er,l.sortBy=wc,l.timeout=Oc,l.times=pn,l.timesLimit=sr,l.timesSeries=Ic,l.transform=P0,l.tryEach=dt,l.unmemoize=xn,l.until=Rn,l.waterfall=Tn,l.whilst=V0,l.wrapSync=H,Object.defineProperty(l,"__esModule",{value:!0})})});var Bt=$((Vw,n4)=>{var xg={usernamePassword:"username_password",securityCertificate:"security_certificate"},Eg={selfHosted:"couchbase://",cloud:"couchbases://"},Rg={bucketIsEmpty:0,primaryIndexDoesNotExist:4e3,n1qlMethodsAreNotSupported:19,userDoesNotHaveAccessToPrivilegeCluster:13014,parseSyntaxError:3e3,inferMethodIsNotSupport:16003,collectionDoesNotExist:12003,indexAlreadyCreated:4300,duplicateDocumentKey:12009,authorizationFailure:6},Tg={hasError:"hasError"},bg={capella:"Capella",selfHosted:"Self-hosted"},mg="",Ag=1e3,Cg="_default",gg=3,Lg=11210,yg="Something went wrong. Please, check logs for more details",Ng=/\(meta\(\)\.(.*?)\)/,wg=/"nodes":(\[.*?\])/,Og=/(HASH|hash)\((.*?)\)$/;n4.exports={AUTH_TYPE:xg,COUCHBASE_ERROR_CODE:Rg,COUCHBASE_HOST_PREFIX:Eg,COUCHBASE_DEFAULT_KV_CONNECTION_PORT:Lg,DEFAULT_KEY_NAME:mg,DEFAULT_LIMIT:Ag,DEFAULT_NAME:Cg,NUM_SAMPLE_VALUES:gg,DISABLED_TOOLTIP:yg,GET_META_REGEXP:Ng,GET_NODES_REGEXP:wg,GET_PARTITION_HASH_REGEXP:Og,HOSTING:bg,STATUS:Tg}});var nf=$((Kw,a4)=>{var{isObject:Ig}=ts(),{DEFAULT_LIMIT:Ug}=Bt(),sf=class sf extends Error{constructor({code:u,message:t}){super(),this.code=u,this.message=t}};h(sf,"CustomError");var tf=sf,rf=class rf{constructor(u,t){this.host=u.host,this.port=u.port,u!=null&&u.couchbase_username&&(u!=null&&u.couchbase_password)&&(this.password=u.couchbase_password,this.username=u.couchbase_username),this.httpService=t}encodeCredentials(){return Buffer.from(`${this.username}:${this.password}`).toString("base64")}async fetch(u){try{let t=`http://${this.host}:${this.port}${u}`,a={headers:{Authorization:`Basic ${this.encodeCredentials()}`},useElectronNet:!0};return await this.httpService.get(t,a)}catch(t){throw new tf({message:t.statusText||t.message,code:t.status||t.code})}}async getCollectionDocuments({bucketName:u,scopeName:t,collectionName:e,limit:a}){let d=`/pools/default/buckets/${u}/scopes/${t}/collections/${e}/docs?include_docs=true&limit=${a}&skip=0`;return await this.fetch(d)}async getLocalRandomKey({bucketName:u,scopeName:t,collectionName:e}){let a=`/pools/default/buckets/${u}/scopes/${t}/collections/${e}/localRandomKey`;return await this.fetch(a)}async getIndexes(){return await this.fetch("/indexStatus")}};h(rf,"CouchbaseRestApiService");var ef=rf,vg=h(l=>{try{return JSON.parse(l)}catch{return l}},"safeParse"),Pg=h(l=>Ig(l)&&!!l.base64&&!!l.meta,"isBinaryFile"),h4=h(({connectionInfo:l,app:u})=>{let e=u.require("httpService").createInstance(l);return new ef(l,e)},"createRestApiService"),Sg=h(async({connectionInfo:l,bucketName:u,scopeName:t,collectionName:e,logger:a,app:d})=>{try{a.info(`${u}.${t}.${e}: Start getting documents using REST API`);let p=h4({connectionInfo:l,app:d}),{rows:_}=await p.getCollectionDocuments({bucketName:u,scopeName:t,collectionName:e,limit:Ug});return _.filter(E=>!Pg(E)).map(E=>{var y;return{[u]:vg((y=E.doc)==null?void 0:y.json),docid:E.id}})}catch(p){return a.error(p),[]}},"getCollectionDocuments"),Dg=h(async({connectionInfo:l,logger:u,app:t})=>{u.info("Start getting indexes using REST API");let e=h4({connectionInfo:l,app:t}),{indexes:a}=await e.getIndexes();return a},"getIndexes");a4.exports={getCollectionDocuments:Sg,getIndexes:Dg}});var hf=$((Yw,f4)=>{var{isPlainObject:Hg,isEmpty:d4,isArray:c4}=ts(),{DEFAULT_KEY_NAME:l4,NUM_SAMPLE_VALUES:Mg}=Bt(),kg=h(({documents:l,bucketName:u,scopeName:t,collectionName:e,collectionIndexes:a,includeEmptyCollection:d,standardDocument:p,fieldInference:_})=>{let E=l.filter(V=>Hg(V[u])).map(V=>({[l4]:V.docid,...V[u]})),y=_.active==="field"?p:null,H=!d&&d4(E);return{dbName:t,collectionName:e,collectionDocs:{},standardDoc:y,bucketInfo:{bucket:u},emptyBucket:H,documents:E,containerLevelKeys:{key:l4},entityLevel:{indexes:a}}},"getDbCollectionData"),o4=h((l,u)=>l.length>u?l[u]:l[0],"getSafeValueByIndex"),Fg=h(({property:l,propertyName:u,amountOfSamples:t,result:e})=>{let{samples:a=[],type:d}=l;return[...Array(t).keys()].reduce((p,_)=>{let E=o4(a,_),y=c4(d)?o4(d,_):d,H=p[_]||{};return p[_]={...H,[u]:c4(E)&&y!=="array"?E[0]:E},p},e)},"reduceSamples"),Bg=h(({inference:l,bucketName:u})=>{if(d4(l==null?void 0:l.properties))return[];let t=Math.min(Mg,l["#docs"]??0);return Object.keys(l.properties).reduce((a,d)=>{let p=l.properties[d];return p?Fg({property:p,propertyName:d,amountOfSamples:t,result:a}):a},[]).map(a=>({docid:"",[u]:a}))},"convertInferSchemaToDocuments"),qg=h(({entitiesData:l,indexesByCollectionMap:u,scopeBucketNameMap:t})=>l.map(({bucketName:e,scopeName:a,collectionName:d,ifNotExists:p})=>{var _,E,y,H;return{doc:{bucketInfo:{bucket:e,ifNotExists:(E=(_=t[e])==null?void 0:_[a])==null?void 0:E.ifNotExists},emptyBucket:!d,dbName:a,collectionName:d,entityLevel:{ifNotExists:p,indexes:(H=(y=u==null?void 0:u[e])==null?void 0:y[a])==null?void 0:H[d]}},objectNames:{collectionName:d},collectionDocs:{},jsonSchema:{type:"object"}}}),"mapParsedResultToMultipleSchema"),Gg=h(l=>({}).toString.call(l).split(" ")[1].slice(0,-1).toLowerCase(),"typeOf");f4.exports={getDbCollectionData:kg,convertInferSchemaToDocuments:Bg,mapParsedResultToMultipleSchema:qg,typeOf:Gg}});var _4=$(($w,p4)=>{var{NUM_SAMPLE_VALUES:Vg}=Bt(),Kg=h(({bucketName:l,scopeName:u,collectionName:t,limit:e})=>`INFER \`${l}\`.\`${u}\`.\`${t}\` WITH {"sample_size":${e}, "num_sample_values":${Vg}};`,"getInferCollectionDocumentsQuery"),Wg=h(({bucketName:l,limit:u,offset:t})=>{let e=`SELECT * FROM \`${l}\``;return af({query:e,limit:u,offset:t})},"getSelectBucketDocumentsQuery"),Yg=h(({bucketName:l,scopeName:u,collectionName:t,limit:e,offset:a})=>{let d=`SELECT *, META().id AS docid FROM \`${l}\`.\`${u}\`.\`${t}\` AS \`${l}\``;return af({query:d,limit:e,offset:a})},"getSelectCollectionDocumentsQuery"),Xg=h(({bucketName:l,scopeName:u,collectionName:t})=>`SELECT COUNT(*) AS size FROM \`${l}\`.\`${u}\`.\`${t}\``,"getCountCollectionDocumentsQuery"),$g=h(()=>"SELECT * FROM system:indexes","getSelectIndexesQuery"),af=h(({query:l,limit:u,offset:t})=>l+(u?` LIMIT ${u}`:"")+(t?` OFFSET ${t}`:""),"getQueryOptions");p4.exports={getCountCollectionDocumentsQuery:Xg,getInferCollectionDocumentsQuery:Kg,getSelectBucketDocumentsQuery:Wg,getSelectCollectionDocumentsQuery:Yg,getSelectIndexesQuery:$g,getQueryOptions:af}});var Rl=$((jw,R4)=>{var Qw=i4(),{get:zg,uniq:Qg,isEmpty:jg}=ts(),Jg=nf(),El=hf(),{COUCHBASE_ERROR_CODE:de,DEFAULT_NAME:Zg,DISABLED_TOOLTIP:uL,STATUS:tL,DEFAULT_LIMIT:Hn}=Bt(),es=_4(),x4=h(async({cluster:l})=>await l.buckets().getAllBuckets(),"getAllBuckets"),eL=h(async({bucketName:l,cluster:u})=>(await u.buckets().createBucket({name:l}),u.bucket(l)),"createNewBucket"),sL=h(async({cluster:l,selectedBucket:u})=>u?[{name:u}]:x4({cluster:l}),"getBucketsForReverse"),rL=h(async({cluster:l,bucketName:u,logger:t})=>{try{let d=await(await(await l.bucket(u)).collections()).getAllScopes();return iL({scopes:d})}catch(e){return t.error(e),[]}},"getBucketScopes"),iL=h(({scopes:l})=>{let u=h(({name:t})=>t===Zg,"isDefault");return l.reduce((t,e)=>{if(!u(e))return[...t,e];let a=e.collections.filter(d=>!u(d));return jg(a)?t:[...t,{...e,collections:a}]},[])},"getNonDefaultScopesAndCollections"),nL=h(async({cluster:l,connectionInfo:u,logger:t})=>(await rL({cluster:l,bucketName:u.database,logger:t})).map(a=>{let d=a.collections.map(p=>p.name);return cL({scopeName:a.name,collectionNames:d})}),"getDbCollectionsNames"),hL=h(async({cluster:l,bucketName:u,limit:t=Hn})=>{let e=es.getSelectBucketDocumentsQuery({bucketName:u,limit:t}),{rows:a}=await l.query(e);return a},"getDocumentsBySelectStatement"),cf=h(({error:l})=>{var u;return((u=l==null?void 0:l.cause)==null?void 0:u.first_error_code)??(l==null?void 0:l.code)},"getErrorCode"),aL=h(({error:l})=>{var t;switch(cf({error:l})){case de.bucketIsEmpty:return"Collection is empty.";case de.n1qlMethodsAreNotSupported:return"N1QL methods are not supported.";case de.parseSyntaxError:case de.inferMethodIsNotSupport:return"Infer method is not supported.";case de.userDoesNotHaveAccessToPrivilegeCluster:return"User doesn`t have credentials for privileged cluster.";default:return((t=l==null?void 0:l.cause)==null?void 0:t.first_error_message)||(l==null?void 0:l.message)||""}},"getErrorMessage"),cL=h(({scopeName:l,collectionNames:u,status:t})=>{let e=t===tL.hasError;return{dbCollections:e?[]:Qg(u),dbName:l,...t&&{status:t},...e&&{disabledTooltip:uL}}},"prepareBucketCollectionNamesData"),E4=h(async({cluster:l,options:u,query:t,logger:e})=>{let{bucketName:a,scopeName:d,collectionName:p,pagination:_,limit:E}=u;if(e.progress("Get data from database",a+"."+d,p),!(_!=null&&_.enabled)){let t0=es.getQueryOptions({query:t,limit:E}),{rows:f0}=await l.query(t0);return f0}let y=Number(u.pagination.value)||Hn,H=Math.ceil(u.limit/y),V=[],K=0;for(let t0 of H){let f0=y*t0,w0=u.limit-f0{if(u.active==="absolute")return Number(u.absolute.value);let t=Math.ceil(l*u.relative.value/100);return Math.min(t,u.maxValue)},"getDocSamplingSize"),oL=h(async({cluster:l,bucketName:u,scopeName:t,collectionName:e,recordSamplingSettings:a,logger:d})=>{var p;try{let _=es.getCountCollectionDocumentsQuery({bucketName:u,scopeName:t,collectionName:e}),{rows:E}=await l.query(_),y=(p=E==null?void 0:E[0])==null?void 0:p.size;return lL({size:y,recordSamplingSettings:a})||Hn}catch(_){return d.error(_),Hn}},"getCollectionSamplingSize"),dL=h(async({cluster:l,bucketName:u,scopeName:t,collectionName:e,limit:a})=>{let d=es.getInferCollectionDocumentsQuery({bucketName:u,scopeName:t,collectionName:e,limit:a}),{rows:p,meta:_}=await l.query(d),E=zg(_,"errors.[0]");if(E)throw E;let[[y]]=p;return El.convertInferSchemaToDocuments({inference:y,bucketName:u})},"getCollectionDocumentsByInfer"),fL=h(async({cluster:l,data:u,bucketName:t,scopeName:e,collectionName:a,collectionIndexes:d,includeEmptyCollection:p,logger:_,app:E})=>{var y;try{let V={limit:await oL({cluster:l,bucketName:t,scopeName:e,collectionName:a,recordSamplingSettings:u.recordSamplingSettings,logger:_}),pagination:u.pagination,bucketName:t,scopeName:e,collectionName:a},K=es.getSelectCollectionDocumentsQuery({bucketName:t,scopeName:e,collectionName:a}),t0=await E4({cluster:l,options:V,query:K,logger:_}),f0=await xL({cluster:l,bucketName:t,scopeName:e,collectionName:a,documentId:(y=t0[0])==null?void 0:y.docid,logger:_});return El.getDbCollectionData({bucketName:t,scopeName:e,collectionName:a,documents:t0,collectionIndexes:d,includeEmptyCollection:p,standardDocument:f0,fieldInference:u.fieldInference})}catch(H){return _.error(H),pL({error:H,cluster:l,data:u,bucketName:t,scopeName:e,collectionName:a,collectionIndexes:d,includeEmptyCollection:p,logger:_,app:E})}},"getDbCollectionData"),pL=h(async({error:l,cluster:u,data:t,bucketName:e,scopeName:a,collectionName:d,collectionIndexes:p,includeEmptyCollection:_,logger:E,app:y})=>{try{let H=cf({error:l}),V=[];switch(H){case de.primaryIndexDoesNotExist:V=await dL({cluster:u,bucketName:e,scopeName:a,collectionName:d,limit:Hn});break;case de.inferMethodIsNotSupport:case de.n1qlMethodsAreNotSupported:V=await Jg.getCollectionDocuments({connectionInfo:t.connectionInfo,bucketName:e,scopeName:a,collectionName:d,logger:E,app:y});break}return El.getDbCollectionData({bucketName:e,scopeName:a,collectionName:d,documents:V,collectionIndexes:p,includeEmptyCollection:_,fieldInference:t.fieldInference})}catch(H){return E.error(H),El.getDbCollectionData({bucketName:e,scopeName:a,collectionName:d,documents:[],collectionIndexes:p,includeEmptyCollection:_,fieldInference:t.fieldInference})}},"getDbCollectionDataByErrorHandling"),_L=h(async({cluster:l,logger:u})=>{try{let t=es.getSelectIndexesQuery(),{rows:e}=await l.query(t);return e.map(a=>a.indexes)}catch(t){return u.error(t),[]}},"getIndexes"),xL=h(async({cluster:l,bucketName:u,scopeName:t,collectionName:e,documentId:a,logger:d})=>{try{let E=l.bucket(u).scope(t).collection(e),{content:y}=await E.get(a);return y}catch(p){return d.error(p),null}},"getCollectionDocumentByDocumentId");R4.exports={getAllBuckets:x4,createNewBucket:eL,getBucketsForReverse:sL,getDbCollectionsNames:nL,getDbCollectionData:fL,getDocumentsBySelectStatement:hL,getErrorCode:cf,getErrorMessage:aL,getIndexes:_L,getPaginatedQuery:E4}});var g4=$((Zw,C4)=>{var EL=Rl(),{AUTH_TYPE:RL,COUCHBASE_HOST_PREFIX:m4,COUCHBASE_DEFAULT_KV_CONNECTION_PORT:TL,HOSTING:T4}=Bt(),Su=null,A4=h(({connectionInfo:l})=>l.host.startsWith(m4.cloud),"isCloudStorage"),b4=h(({connectionInfo:l})=>{if(A4({connectionInfo:l}))return l.host;let u=l.kv_port||TL;return`${m4.selfHosted}${l.host}:${u}`},"generateUrl"),bL=h(({connectionInfo:l})=>l.authType===RL.securityCertificate?{url:b4({connectionInfo:l}),options:{authenticator:{certificatePath:l.security_certificate,keyPath:l.security_certificate_key}}}:{url:b4({connectionInfo:l}),options:{username:l.couchbase_username,password:l.couchbase_password}},"generateConnectionParams"),mL=h(async({connectionInfo:l,app:u})=>{if(Su)return Su;let t=await u.require("couchbase"),{url:e,options:a}=bL({connectionInfo:l});Su=await t.connect(e,a);let d=await EL.getAllBuckets({cluster:Su}),p=l.couchbase_bucket;if(p&&!d.includes(p))throw new Error(`Bucket ${p} doesn't exist`);return Su},"connect"),AL=h(async()=>{await(Su==null?void 0:Su.close()),Su=null},"disconnect"),CL=h(()=>{let l=(Su==null?void 0:Su._connStr)||"";return{hosting:A4({connectionInfo:{host:l}})?T4.capella:T4.selfHosted}},"getConnectionInfo");C4.exports={connect:mL,disconnect:AL,getConnectionInfo:CL}});var L4=$((tO,gL)=>{gL.exports={name:"CouchbaseV7Plus",version:"0.1.2",versionDate:"2024-03-08",author:"hackolade",engines:{hackolade:"7.0.0",hackoladePlugin:"1.0.1"},contributes:{target:{applicationTarget:"CouchbaseV7Plus",title:"Couchbase w/ collections",versions:["7.x"]},features:{enableForwardEngineering:!0,enableArrayCollections:!1}},description:"Hackolade plugin for Couchbase with scopes and collections","lint-staged":{"*.{js,json}":"prettier --write"},"simple-git-hooks":{"pre-commit":"npx lint-staged","pre-push":"npx eslint ."},scripts:{lint:"eslint . --max-warnings=0",package:"node esbuild.package.js"},dependencies:{async:"3.2.5","exponential-backoff":"3.1.1",lodash:"4.17.21",uuid:"9.0.1",antlr4:"4.9.2"},devDependencies:{"@hackolade/hck-esbuild-plugins-pack":"0.0.1","@types/couchbase":"2.4.9",esbuild:"0.19.12","esbuild-plugin-clean":"1.0.1",eslint:"8.56.0","eslint-config-prettier":"9.1.0","eslint-plugin-prettier":"5.1.3","lint-staged":"14.0.1",prettier:"3.2.4","simple-git-hooks":"2.9.0"}}});var w4=$((eO,N4)=>{var qt=require("os"),LL=L4(),{COUCHBASE_ERROR_CODE:yL}=Bt(),NL=h(()=>LL.version,"getPluginVersion"),wL=h(l=>`Date: ${new Date} +`+R);let[,N]=A;return N.replace(/\s/g,"").split(Vu).map(U=>U.replace(hc,"").trim())}h(Pe,"parseParams");function du(m,R){var A={};return Object.keys(m).forEach(N=>{var U=m[N],v,S=t0(U),D=!S&&U.length===1||S&&U.length===0;if(Array.isArray(U))v=[...U],U=v.pop(),A[N]=v.concat(v.length>0?M:U);else if(D)A[N]=U;else{if(v=Pe(U),U.length===0&&!S&&v.length===0)throw new Error("autoInject task functions require explicit parameters.");S||v.pop(),A[N]=v.concat(M)}function M(Y,l0){var b0=v.map(d0=>Y[d0]);b0.push(l0),j(U)(...b0)}h(M,"newTask")}),tu(A,R)}h(du,"autoInject");let rr=class rr{constructor(){this.head=this.tail=null,this.length=0}removeLink(R){return R.prev?R.prev.next=R.next:this.head=R.next,R.next?R.next.prev=R.prev:this.tail=R.prev,R.prev=R.next=null,this.length-=1,R}empty(){for(;this.head;)this.shift();return this}insertAfter(R,A){A.prev=R,A.next=R.next,R.next?R.next.prev=A:this.tail=A,R.next=A,this.length+=1}insertBefore(R,A){A.prev=R.prev,A.next=R,R.prev?R.prev.next=A:this.head=A,R.prev=A,this.length+=1}unshift(R){this.head?this.insertBefore(this.head,R):Se(this,R)}push(R){this.tail?this.insertAfter(this.tail,R):Se(this,R)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var R=this.head;R;)yield R.data,R=R.next}remove(R){for(var A=this.head;A;){var{next:N}=A;R(A)&&this.removeLink(A),A=N}return this}};h(rr,"DLL");let Nt=rr;function Se(m,R){m.length=1,m.head=m.tail=R}h(Se,"setInitial");function zi(m,R,A){if(R==null)R=1;else if(R===0)throw new RangeError("Concurrency must not be zero");var N=j(m),U=0,v=[];let S={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function D(J,z){S[J].push(z)}h(D,"on");function M(J,z){let u0=h((..._0)=>{Y(J,u0),z(..._0)},"handleAndRemove");S[J].push(u0)}h(M,"once");function Y(J,z){if(!J)return Object.keys(S).forEach(u0=>S[u0]=[]);if(!z)return S[J]=[];S[J]=S[J].filter(u0=>u0!==z)}h(Y,"off");function l0(J,...z){S[J].forEach(u0=>u0(...z))}h(l0,"trigger");var b0=!1;function d0(J,z,u0,_0){if(_0!=null&&typeof _0!="function")throw new Error("task callback must be a function");p0.started=!0;var N0,U0;function su(Wu,...It){if(Wu)return u0?U0(Wu):N0();if(It.length<=1)return N0(It[0]);N0(It)}h(su,"promiseCallback");var se=p0._createTaskItem(J,u0?su:_0||su);if(z?p0._tasks.unshift(se):p0._tasks.push(se),b0||(b0=!0,y(()=>{b0=!1,p0.process()})),u0||!_0)return new Promise((Wu,It)=>{N0=Wu,U0=It})}h(d0,"_insert");function fu(J){return function(z,...u0){U-=1;for(var _0=0,N0=J.length;_00&&v.splice(su,1),U0.callback(z,...u0),z!=null&&l0("error",z,U0.data)}U<=p0.concurrency-p0.buffer&&l0("unsaturated"),p0.idle()&&l0("drain"),p0.process()}}h(fu,"_createCB");function te(J){return J.length===0&&p0.idle()?(y(()=>l0("drain")),!0):!1}h(te,"_maybeDrain");let Ot=h(J=>z=>{if(!z)return new Promise((u0,_0)=>{M(J,(N0,U0)=>{if(N0)return _0(N0);u0(U0)})});Y(J),D(J,z)},"eventMethod");var ee=!1,p0={_tasks:new Nt,_createTaskItem(J,z){return{data:J,callback:z}},*[Symbol.iterator](){yield*p0._tasks[Symbol.iterator]()},concurrency:R,payload:A,buffer:R/4,started:!1,paused:!1,push(J,z){return Array.isArray(J)?te(J)?void 0:J.map(u0=>d0(u0,!1,!1,z)):d0(J,!1,!1,z)},pushAsync(J,z){return Array.isArray(J)?te(J)?void 0:J.map(u0=>d0(u0,!1,!0,z)):d0(J,!1,!0,z)},kill(){Y(),p0._tasks.empty()},unshift(J,z){return Array.isArray(J)?te(J)?void 0:J.map(u0=>d0(u0,!0,!1,z)):d0(J,!0,!1,z)},unshiftAsync(J,z){return Array.isArray(J)?te(J)?void 0:J.map(u0=>d0(u0,!0,!0,z)):d0(J,!0,!0,z)},remove(J){p0._tasks.remove(J)},process(){if(!ee){for(ee=!0;!p0.paused&&U{U(R,v,(M,Y)=>{R=Y,D(M)})},v=>N(v,R))}h(De,"reduce");var eu=Z(De,4);function He(...m){var R=m.map(j);return function(...A){var N=this,U=A[A.length-1];return typeof U=="function"?A.pop():U=yt(),eu(R,A,(v,S,D)=>{S.apply(N,v.concat((M,...Y)=>{D(M,Y)}))},(v,S)=>U(v,...S)),U[Gu]}}h(He,"seq");function vs(...m){return He(...m.reverse())}h(vs,"compose");function Qi(m,R,A,N){return z0(B0(R),m,A,N)}h(Qi,"mapLimit");var wt=Z(Qi,4);function ji(m,R,A,N){var U=j(A);return wt(m,R,(v,S)=>{U(v,(D,...M)=>D?S(D):S(D,M))},(v,S)=>{for(var D=[],M=0;M{var S=!1,D;let M=j(U);A(N,(Y,l0,b0)=>{M(Y,(d0,fu)=>{if(d0||d0===!1)return b0(d0);if(m(fu)&&!D)return S=!0,D=R(!0,Y),b0(null,at);b0()})},Y=>{if(Y)return v(Y);v(null,S?D:R(!1))})}}h(Ku,"_createTester");function lc(m,R,A){return Ku(N=>N,(N,U)=>U)(uu,m,R,A)}h(lc,"detect");var Me=Z(lc,3);function Go(m,R,A,N){return Ku(U=>U,(U,v)=>v)(B0(R),m,A,N)}h(Go,"detectLimit");var Ss=Z(Go,4);function Vo(m,R,A){return Ku(N=>N,(N,U)=>U)(B0(1),m,R,A)}h(Vo,"detectSeries");var Ds=Z(Vo,3);function un(m){return(R,...A)=>j(R)(...A,(N,...U)=>{typeof console=="object"&&(N?console.error&&console.error(N):console[m]&&U.forEach(v=>console[m](v)))})}h(un,"consoleFunc");var oc=un("dir");function Ko(m,R,A){A=ct(A);var N=j(m),U=j(R),v;function S(M,...Y){if(M)return A(M);M!==!1&&(v=Y,U(...Y,D))}h(S,"next");function D(M,Y){if(M)return A(M);if(M!==!1){if(!Y)return A(null,...v);N(S)}}return h(D,"check"),D(null,!0)}h(Ko,"doWhilst");var ke=Z(Ko,3);function Hs(m,R,A){let N=j(R);return ke(m,(...U)=>{let v=U.pop();N(...U,(S,D)=>v(S,!D))},A)}h(Hs,"doUntil");function dc(m){return(R,A,N)=>m(R,N)}h(dc,"_withoutIndex");function tn(m,R,A){return uu(m,dc(j(R)),A)}h(tn,"eachLimit$2");var Ms=Z(tn,3);function Wo(m,R,A,N){return B0(R)(m,dc(j(A)),N)}h(Wo,"eachLimit");var Fe=Z(Wo,4);function Yo(m,R,A){return Fe(m,1,R,A)}h(Yo,"eachSeries");var Be=Z(Yo,3);function en(m){return t0(m)?m:function(...R){var A=R.pop(),N=!0;R.push((...U)=>{N?y(()=>A(...U)):A(...U)}),m.apply(this,R),N=!1}}h(en,"ensureAsync");function Xo(m,R,A){return Ku(N=>!N,N=>!N)(uu,m,R,A)}h(Xo,"every");var ks=Z(Xo,3);function fc(m,R,A,N){return Ku(U=>!U,U=>!U)(B0(R),m,A,N)}h(fc,"everyLimit");var Fs=Z(fc,4);function $o(m,R,A){return Ku(N=>!N,N=>!N)(W0,m,R,A)}h($o,"everySeries");var Bs=Z($o,3);function zo(m,R,A,N){var U=new Array(R.length);m(R,(v,S,D)=>{A(v,(M,Y)=>{U[S]=!!Y,D(M)})},v=>{if(v)return N(v);for(var S=[],D=0;D{A(v,(M,Y)=>{if(M)return D(M);Y&&U.push({index:S,value:v}),D(M)})},v=>{if(v)return N(v);N(null,U.sort((S,D)=>S.index-D.index).map(S=>S.value))})}h(Qo,"filterGeneric");function qs(m,R,A,N){var U=Bu(R)?zo:Qo;return U(m,R,j(A),N)}h(qs,"_filter");function Gs(m,R,A){return qs(uu,m,R,A)}h(Gs,"filter");var Vs=Z(Gs,3);function Ks(m,R,A,N){return qs(B0(R),m,A,N)}h(Ks,"filterLimit");var Ws=Z(Ks,4);function jo(m,R,A){return qs(W0,m,R,A)}h(jo,"filterSeries");var Ys=Z(jo,3);function pc(m,R){var A=ct(R),N=j(en(m));function U(v){if(v)return A(v);v!==!1&&N(U)}return h(U,"next"),U()}h(pc,"forever");var sn=Z(pc,2);function _c(m,R,A,N){var U=j(A);return wt(m,R,(v,S)=>{U(v,(D,M)=>D?S(D):S(D,{key:M,val:v}))},(v,S)=>{for(var D={},{hasOwnProperty:M}=Object.prototype,Y=0;Y{v(S,D,(Y,l0)=>{if(Y)return M(Y);U[D]=l0,M(Y)})},S=>N(S,U))}h(Tc,"mapValuesLimit");var qe=Z(Tc,4);function rn(m,R,A){return qe(m,1/0,R,A)}h(rn,"mapValues");function $s(m,R,A){return qe(m,1,R,A)}h($s,"mapValuesSeries");function bc(m,R=A=>A){var A=Object.create(null),N=Object.create(null),U=j(m),v=t((S,D)=>{var M=R(...S);M in A?y(()=>D(null,...A[M])):M in N?N[M].push(D):(N[M]=[D],U(...S,(Y,...l0)=>{Y||(A[M]=l0);var b0=N[M];delete N[M];for(var d0=0,fu=b0.length;d0{var N=Bu(R)?[]:{};m(R,(U,v,S)=>{j(U)((D,...M)=>{M.length<2&&([M]=M),N[v]=M,S(D)})},U=>A(U,N))},3);function mc(m,R){return zs(uu,m,R)}h(mc,"parallel");function nn(m,R,A){return zs(B0(R),m,A)}h(nn,"parallelLimit");function Qs(m,R){var A=j(m);return zi((N,U)=>{A(N[0],U)},R,1)}h(Qs,"queue");let ir=class ir{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(R){let A;for(;R>0&&We(this.heap[R],this.heap[A=hn(R)]);){let N=this.heap[R];this.heap[R]=this.heap[A],this.heap[A]=N,R=A}}percDown(R){let A;for(;(A=Jo(R))=0;N--)this.percDown(N);return this}};h(ir,"Heap");let Ke=ir;function Jo(m){return(m<<1)+1}h(Jo,"leftChi");function hn(m){return(m+1>>1)-1}h(hn,"parent");function We(m,R){return m.priority!==R.priority?m.priority({data:S,priority:D,callback:M});function v(S,D){return Array.isArray(S)?S.map(M=>({data:M,priority:D})):{data:S,priority:D}}return h(v,"createDataItems"),A.push=function(S,D=0,M){return N(v(S,D),M)},A.pushAsync=function(S,D=0,M){return U(v(S,D),M)},delete A.unshift,delete A.unshiftAsync,A}h(js,"priorityQueue");function ue(m,R){if(R=Lu(R),!Array.isArray(m))return R(new TypeError("First argument to race must be an array of functions"));if(!m.length)return R();for(var A=0,N=m.length;A{let D={};if(v&&(D.error=v),S.length>0){var M=S;S.length<=1&&([M]=S),D.value=M}U(null,D)}),R.apply(this,N)},"reflectOn"))}h(Js,"reflect");function cn(m){var R;return Array.isArray(m)?R=m.map(Js):(R={},Object.keys(m).forEach(A=>{R[A]=Js.call(this,m[A])})),R}h(cn,"reflectAll");function Zs(m,R,A,N){let U=j(A);return qs(m,R,(v,S)=>{U(v,(D,M)=>{S(D,!M)})},N)}h(Zs,"reject$2");function Ac(m,R,A){return Zs(uu,m,R,A)}h(Ac,"reject");var ln=Z(Ac,3);function Zo(m,R,A,N){return Zs(B0(R),m,A,N)}h(Zo,"rejectLimit");var Cc=Z(Zo,4);function ud(m,R,A){return Zs(W0,m,R,A)}h(ud,"rejectSeries");var on=Z(ud,3);function gc(m){return function(){return m}}h(gc,"constant");let dn=5,Lc=0;function ur(m,R,A){var N={times:dn,intervalFunc:gc(Lc)};if(arguments.length<3&&typeof m=="function"?(A=R||yt(),R=m):(fn(N,m),A=A||yt()),typeof R!="function")throw new Error("Invalid arguments for async.retry");var U=j(R),v=1;function S(){U((D,...M)=>{D!==!1&&(D&&v++{(U.lengthN)(uu,m,R,A)}h(td,"some");var tr=Z(td,3);function ed(m,R,A,N){return Ku(Boolean,U=>U)(B0(R),m,A,N)}h(ed,"someLimit");var C0=Z(ed,4);function y0(m,R,A){return Ku(Boolean,N=>N)(W0,m,R,A)}h(y0,"someSeries");var er=Z(y0,3);function sd(m,R,A){var N=j(R);return qu(m,(v,S)=>{N(v,(D,M)=>{if(D)return S(D);S(D,{value:v,criteria:M})})},(v,S)=>{if(v)return A(v);A(null,S.sort(U).map(D=>D.value))});function U(v,S){var D=v.criteria,M=S.criteria;return DM?1:0}}h(sd,"sortBy");var wc=Z(sd,3);function Oc(m,R,A){var N=j(m);return t((U,v)=>{var S=!1,D;function M(){var Y=m.name||"anonymous",l0=new Error('Callback function "'+Y+'" timed out.');l0.code="ETIMEDOUT",A&&(l0.info=A),S=!0,v(l0)}h(M,"timeoutCallback"),U.push((...Y)=>{S||(v(...Y),clearTimeout(D))}),D=setTimeout(M,R),N(...U)})}h(Oc,"timeout");function rd(m){for(var R=Array(m);m--;)R[m]=m;return R}h(rd,"range");function sr(m,R,A,N){var U=j(A);return wt(rd(m),R,U,N)}h(sr,"timesLimit");function pn(m,R,A){return sr(m,1/0,R,A)}h(pn,"times");function Ic(m,R,A){return sr(m,1,R,A)}h(Ic,"timesSeries");function P0(m,R,A,N){arguments.length<=3&&typeof R=="function"&&(N=A,A=R,R=Array.isArray(m)?[]:{}),N=Lu(N||yt());var U=j(A);return uu(m,(v,S,D)=>{U(R,v,S,D)},v=>N(v,R)),N[Gu]}h(P0,"transform");function _n(m,R){var A=null,N;return Be(m,(U,v)=>{j(U)((S,...D)=>{if(S===!1)return v(S);D.length<2?[N]=D:N=D,A=S,v(S?null:{})})},()=>R(A,N))}h(_n,"tryEach");var dt=Z(_n);function xn(m){return(...R)=>(m.unmemoized||m)(...R)}h(xn,"unmemoize");function En(m,R,A){A=ct(A);var N=j(R),U=j(m),v=[];function S(M,...Y){if(M)return A(M);v=Y,M!==!1&&U(D)}h(S,"next");function D(M,Y){if(M)return A(M);if(M!==!1){if(!Y)return A(null,...v);N(S)}}return h(D,"check"),U(D)}h(En,"whilst");var V0=Z(En,3);function Rn(m,R,A){let N=j(m);return V0(U=>N((v,S)=>U(v,!S)),R,A)}h(Rn,"until");function Uc(m,R){if(R=Lu(R),!Array.isArray(m))return R(new Error("First argument to waterfall must be an array of functions"));if(!m.length)return R();var A=0;function N(v){var S=j(m[A++]);S(...v,ct(U))}h(N,"nextTask");function U(v,...S){if(v!==!1){if(v||A===m.length)return R(v,...S);N(S)}}h(U,"next"),N([])}h(Uc,"waterfall");var Tn=Z(Uc),vc={apply:u,applyEach:Oe,applyEachSeries:Ue,asyncify:H,auto:tu,autoInject:du,cargo:Jt,cargoQueue:ac,compose:vs,concat:Zt,concatLimit:ot,concatSeries:Ps,constant:cc,detect:Me,detectLimit:Ss,detectSeries:Ds,dir:oc,doUntil:Hs,doWhilst:ke,each:Ms,eachLimit:Fe,eachOf:uu,eachOfLimit:jt,eachOfSeries:W0,eachSeries:Be,ensureAsync:en,every:ks,everyLimit:Fs,everySeries:Bs,filter:Vs,filterLimit:Ws,filterSeries:Ys,forever:sn,groupBy:xc,groupByLimit:Xs,groupBySeries:Ec,log:Rc,map:qu,mapLimit:wt,mapSeries:$i,mapValues:rn,mapValuesLimit:qe,mapValuesSeries:$s,memoize:bc,nextTick:Ve,parallel:mc,parallelLimit:nn,priorityQueue:js,queue:Qs,race:an,reduce:eu,reduceRight:Ye,reflect:Js,reflectAll:cn,reject:ln,rejectLimit:Cc,rejectSeries:on,retry:ur,retryable:yc,seq:He,series:Nc,setImmediate:y,some:tr,someLimit:C0,someSeries:er,sortBy:wc,timeout:Oc,times:pn,timesLimit:sr,timesSeries:Ic,transform:P0,tryEach:dt,unmemoize:xn,until:Rn,waterfall:Tn,whilst:V0,all:ks,allLimit:Fs,allSeries:Bs,any:tr,anyLimit:C0,anySeries:er,find:Me,findLimit:Ss,findSeries:Ds,flatMap:Zt,flatMapLimit:ot,flatMapSeries:Ps,forEach:Ms,forEachSeries:Be,forEachLimit:Fe,forEachOf:uu,forEachOfSeries:W0,forEachOfLimit:jt,inject:eu,foldl:eu,foldr:Ye,select:Vs,selectLimit:Ws,selectSeries:Ys,wrapSync:H,during:V0,doDuring:ke};l.all=ks,l.allLimit=Fs,l.allSeries=Bs,l.any=tr,l.anyLimit=C0,l.anySeries=er,l.apply=u,l.applyEach=Oe,l.applyEachSeries=Ue,l.asyncify=H,l.auto=tu,l.autoInject=du,l.cargo=Jt,l.cargoQueue=ac,l.compose=vs,l.concat=Zt,l.concatLimit=ot,l.concatSeries=Ps,l.constant=cc,l.default=vc,l.detect=Me,l.detectLimit=Ss,l.detectSeries=Ds,l.dir=oc,l.doDuring=ke,l.doUntil=Hs,l.doWhilst=ke,l.during=V0,l.each=Ms,l.eachLimit=Fe,l.eachOf=uu,l.eachOfLimit=jt,l.eachOfSeries=W0,l.eachSeries=Be,l.ensureAsync=en,l.every=ks,l.everyLimit=Fs,l.everySeries=Bs,l.filter=Vs,l.filterLimit=Ws,l.filterSeries=Ys,l.find=Me,l.findLimit=Ss,l.findSeries=Ds,l.flatMap=Zt,l.flatMapLimit=ot,l.flatMapSeries=Ps,l.foldl=eu,l.foldr=Ye,l.forEach=Ms,l.forEachLimit=Fe,l.forEachOf=uu,l.forEachOfLimit=jt,l.forEachOfSeries=W0,l.forEachSeries=Be,l.forever=sn,l.groupBy=xc,l.groupByLimit=Xs,l.groupBySeries=Ec,l.inject=eu,l.log=Rc,l.map=qu,l.mapLimit=wt,l.mapSeries=$i,l.mapValues=rn,l.mapValuesLimit=qe,l.mapValuesSeries=$s,l.memoize=bc,l.nextTick=Ve,l.parallel=mc,l.parallelLimit=nn,l.priorityQueue=js,l.queue=Qs,l.race=an,l.reduce=eu,l.reduceRight=Ye,l.reflect=Js,l.reflectAll=cn,l.reject=ln,l.rejectLimit=Cc,l.rejectSeries=on,l.retry=ur,l.retryable=yc,l.select=Vs,l.selectLimit=Ws,l.selectSeries=Ys,l.seq=He,l.series=Nc,l.setImmediate=y,l.some=tr,l.someLimit=C0,l.someSeries=er,l.sortBy=wc,l.timeout=Oc,l.times=pn,l.timesLimit=sr,l.timesSeries=Ic,l.transform=P0,l.tryEach=dt,l.unmemoize=xn,l.until=Rn,l.waterfall=Tn,l.whilst=V0,l.wrapSync=H,Object.defineProperty(l,"__esModule",{value:!0})})});var Bt=$((Vw,n4)=>{var xg={usernamePassword:"username_password",securityCertificate:"security_certificate"},Eg={selfHosted:"couchbase://",cloud:"couchbases://"},Rg={bucketIsEmpty:0,primaryIndexDoesNotExist:4e3,n1qlMethodsAreNotSupported:19,userDoesNotHaveAccessToPrivilegeCluster:13014,parseSyntaxError:3e3,inferMethodIsNotSupport:16003,collectionDoesNotExist:12003,indexAlreadyCreated:4300,duplicateDocumentKey:12009,authorizationFailure:6},Tg={hasError:"hasError"},bg={capella:"Capella",selfHosted:"Self-hosted"},mg="",Ag=1e3,Cg="_default",gg=3,Lg=11210,yg="Something went wrong. Please, check logs for more details",Ng=/\(meta\(\)\.(.*?)\)/,wg=/"nodes":(\[.*?\])/,Og=/(HASH|hash)\((.*?)\)$/;n4.exports={AUTH_TYPE:xg,COUCHBASE_ERROR_CODE:Rg,COUCHBASE_HOST_PREFIX:Eg,COUCHBASE_DEFAULT_KV_CONNECTION_PORT:Lg,DEFAULT_KEY_NAME:mg,DEFAULT_LIMIT:Ag,DEFAULT_NAME:Cg,NUM_SAMPLE_VALUES:gg,DISABLED_TOOLTIP:yg,GET_META_REGEXP:Ng,GET_NODES_REGEXP:wg,GET_PARTITION_HASH_REGEXP:Og,HOSTING:bg,STATUS:Tg}});var nf=$((Kw,a4)=>{var{isObject:Ig}=ts(),{DEFAULT_LIMIT:Ug}=Bt(),sf=class sf extends Error{constructor({code:u,message:t}){super(),this.code=u,this.message=t}};h(sf,"CustomError");var tf=sf,rf=class rf{constructor(u,t){this.host=u.host,this.port=u.port,u!=null&&u.couchbase_username&&(u!=null&&u.couchbase_password)&&(this.password=u.couchbase_password,this.username=u.couchbase_username),this.httpService=t}encodeCredentials(){return Buffer.from(`${this.username}:${this.password}`).toString("base64")}async fetch(u){try{let t=`http://${this.host}:${this.port}${u}`,a={headers:{Authorization:`Basic ${this.encodeCredentials()}`},useElectronNet:!0};return await this.httpService.get(t,a)}catch(t){throw new tf({message:t.statusText||t.message,code:t.status||t.code})}}async getCollectionDocuments({bucketName:u,scopeName:t,collectionName:e,limit:a}){let d=`/pools/default/buckets/${u}/scopes/${t}/collections/${e}/docs?include_docs=true&limit=${a}&skip=0`;return await this.fetch(d)}async getLocalRandomKey({bucketName:u,scopeName:t,collectionName:e}){let a=`/pools/default/buckets/${u}/scopes/${t}/collections/${e}/localRandomKey`;return await this.fetch(a)}async getIndexes(){return await this.fetch("/indexStatus")}};h(rf,"CouchbaseRestApiService");var ef=rf,vg=h(l=>{try{return JSON.parse(l)}catch{return l}},"safeParse"),Pg=h(l=>Ig(l)&&!!l.base64&&!!l.meta,"isBinaryFile"),h4=h(({connectionInfo:l,app:u})=>{let e=u.require("httpService").createInstance(l);return new ef(l,e)},"createRestApiService"),Sg=h(async({connectionInfo:l,bucketName:u,scopeName:t,collectionName:e,logger:a,app:d})=>{try{a.info(`${u}.${t}.${e}: Start getting documents using REST API`);let p=h4({connectionInfo:l,app:d}),{rows:_}=await p.getCollectionDocuments({bucketName:u,scopeName:t,collectionName:e,limit:Ug});return _.filter(E=>!Pg(E)).map(E=>{var y;return{[u]:vg((y=E.doc)==null?void 0:y.json),docid:E.id}})}catch(p){return a.error(p),[]}},"getCollectionDocuments"),Dg=h(async({connectionInfo:l,logger:u,app:t})=>{u.info("Start getting indexes using REST API");let e=h4({connectionInfo:l,app:t}),{indexes:a}=await e.getIndexes();return a},"getIndexes");a4.exports={getCollectionDocuments:Sg,getIndexes:Dg}});var hf=$((Yw,f4)=>{var{isPlainObject:Hg,isEmpty:d4,isArray:c4}=ts(),{DEFAULT_KEY_NAME:l4,NUM_SAMPLE_VALUES:Mg}=Bt(),kg=h(({documents:l,bucketName:u,scopeName:t,collectionName:e,collectionIndexes:a,includeEmptyCollection:d,standardDocument:p,fieldInference:_})=>{let E=l.filter(V=>Hg(V[u])).map(V=>({[l4]:V.docid,...V[u]})),y=_.active==="field"?p:null,H=!d&&d4(E);return{dbName:t,collectionName:e,collectionDocs:{},standardDoc:y,bucketInfo:{bucket:u},emptyBucket:H,documents:E,containerLevelKeys:{key:l4},entityLevel:{indexes:a}}},"getDbCollectionData"),o4=h((l,u)=>l.length>u?l[u]:l[0],"getSafeValueByIndex"),Fg=h(({property:l,propertyName:u,amountOfSamples:t,result:e})=>{let{samples:a=[],type:d}=l;return[...Array(t).keys()].reduce((p,_)=>{let E=o4(a,_),y=c4(d)?o4(d,_):d,H=p[_]||{};return p[_]={...H,[u]:c4(E)&&y!=="array"?E[0]:E},p},e)},"reduceSamples"),Bg=h(({inference:l,bucketName:u})=>{if(d4(l==null?void 0:l.properties))return[];let t=Math.min(Mg,l["#docs"]??0);return Object.keys(l.properties).reduce((a,d)=>{let p=l.properties[d];return p?Fg({property:p,propertyName:d,amountOfSamples:t,result:a}):a},[]).map(a=>({docid:"",[u]:a}))},"convertInferSchemaToDocuments"),qg=h(({entitiesData:l,indexesByCollectionMap:u,scopeBucketNameMap:t})=>l.map(({bucketName:e,scopeName:a,collectionName:d,ifNotExists:p})=>{var _,E,y,H;return{doc:{bucketInfo:{bucket:e,ifNotExists:(E=(_=t[e])==null?void 0:_[a])==null?void 0:E.ifNotExists},emptyBucket:!d,dbName:a,collectionName:d,entityLevel:{ifNotExists:p,indexes:(H=(y=u==null?void 0:u[e])==null?void 0:y[a])==null?void 0:H[d]}},objectNames:{collectionName:d},collectionDocs:{},jsonSchema:{type:"object"}}}),"mapParsedResultToMultipleSchema"),Gg=h(l=>({}).toString.call(l).split(" ")[1].slice(0,-1).toLowerCase(),"typeOf");f4.exports={getDbCollectionData:kg,convertInferSchemaToDocuments:Bg,mapParsedResultToMultipleSchema:qg,typeOf:Gg}});var _4=$(($w,p4)=>{var{NUM_SAMPLE_VALUES:Vg}=Bt(),Kg=h(({bucketName:l,scopeName:u,collectionName:t,limit:e})=>`INFER \`${l}\`.\`${u}\`.\`${t}\` WITH {"sample_size":${e}, "num_sample_values":${Vg}};`,"getInferCollectionDocumentsQuery"),Wg=h(({bucketName:l,limit:u,offset:t})=>{let e=`SELECT * FROM \`${l}\``;return af({query:e,limit:u,offset:t})},"getSelectBucketDocumentsQuery"),Yg=h(({bucketName:l,scopeName:u,collectionName:t,limit:e,offset:a})=>{let d=`SELECT *, META().id AS docid FROM \`${l}\`.\`${u}\`.\`${t}\` AS \`${l}\``;return af({query:d,limit:e,offset:a})},"getSelectCollectionDocumentsQuery"),Xg=h(({bucketName:l,scopeName:u,collectionName:t})=>`SELECT COUNT(*) AS size FROM \`${l}\`.\`${u}\`.\`${t}\``,"getCountCollectionDocumentsQuery"),$g=h(()=>"SELECT * FROM system:indexes","getSelectIndexesQuery"),af=h(({query:l,limit:u,offset:t})=>l+(u?` LIMIT ${u}`:"")+(t?` OFFSET ${t}`:""),"getQueryOptions");p4.exports={getCountCollectionDocumentsQuery:Xg,getInferCollectionDocumentsQuery:Kg,getSelectBucketDocumentsQuery:Wg,getSelectCollectionDocumentsQuery:Yg,getSelectIndexesQuery:$g,getQueryOptions:af}});var Rl=$((jw,R4)=>{var Qw=i4(),{get:zg,uniq:Qg,isEmpty:jg}=ts(),Jg=nf(),El=hf(),{COUCHBASE_ERROR_CODE:de,DEFAULT_NAME:Zg,DISABLED_TOOLTIP:uL,STATUS:tL,DEFAULT_LIMIT:Hn}=Bt(),es=_4(),x4=h(async({cluster:l})=>await l.buckets().getAllBuckets(),"getAllBuckets"),eL=h(async({bucketName:l,cluster:u})=>(await u.buckets().createBucket({name:l}),u.bucket(l)),"createNewBucket"),sL=h(async({cluster:l,selectedBucket:u})=>u?[{name:u}]:x4({cluster:l}),"getBucketsForReverse"),rL=h(async({cluster:l,bucketName:u,logger:t})=>{try{let d=await(await(await l.bucket(u)).collections()).getAllScopes();return iL({scopes:d})}catch(e){return t.error(e),[]}},"getBucketScopes"),iL=h(({scopes:l})=>{let u=h(({name:t})=>t===Zg,"isDefault");return l.reduce((t,e)=>{if(!u(e))return[...t,e];let a=e.collections.filter(d=>!u(d));return jg(a)?t:[...t,{...e,collections:a}]},[])},"getNonDefaultScopesAndCollections"),nL=h(async({cluster:l,connectionInfo:u,logger:t})=>(await rL({cluster:l,bucketName:u.database,logger:t})).map(a=>{let d=a.collections.map(p=>p.name);return cL({scopeName:a.name,collectionNames:d})}),"getDbCollectionsNames"),hL=h(async({cluster:l,bucketName:u,limit:t=Hn})=>{let e=es.getSelectBucketDocumentsQuery({bucketName:u,limit:t}),{rows:a}=await l.query(e);return a},"getDocumentsBySelectStatement"),cf=h(({error:l})=>{var u;return((u=l==null?void 0:l.cause)==null?void 0:u.first_error_code)??(l==null?void 0:l.code)},"getErrorCode"),aL=h(({error:l})=>{var t;switch(cf({error:l})){case de.bucketIsEmpty:return"Collection is empty.";case de.n1qlMethodsAreNotSupported:return"N1QL methods are not supported.";case de.parseSyntaxError:case de.inferMethodIsNotSupport:return"Infer method is not supported.";case de.userDoesNotHaveAccessToPrivilegeCluster:return"User doesn`t have credentials for privileged cluster.";default:return((t=l==null?void 0:l.cause)==null?void 0:t.first_error_message)||(l==null?void 0:l.message)||""}},"getErrorMessage"),cL=h(({scopeName:l,collectionNames:u,status:t})=>{let e=t===tL.hasError;return{dbCollections:e?[]:Qg(u),dbName:l,...t&&{status:t},...e&&{disabledTooltip:uL}}},"prepareBucketCollectionNamesData"),E4=h(async({cluster:l,options:u,query:t,logger:e})=>{let{bucketName:a,scopeName:d,collectionName:p,pagination:_,limit:E}=u;if(e.progress("Get data from database",a+"."+d,p),!(_!=null&&_.enabled)){let t0=es.getQueryOptions({query:t,limit:E}),{rows:f0}=await l.query(t0);return f0}let y=Number(u.pagination.value)||Hn,H=Math.ceil(u.limit/y),V=[],K=0;for(let t0 of H){let f0=y*t0,w0=u.limit-f0{if(u.active==="absolute")return Number(u.absolute.value);let t=Math.ceil(l*u.relative.value/100);return Math.min(t,u.maxValue)},"getDocSamplingSize"),oL=h(async({cluster:l,bucketName:u,scopeName:t,collectionName:e,recordSamplingSettings:a,logger:d})=>{var p;try{let _=es.getCountCollectionDocumentsQuery({bucketName:u,scopeName:t,collectionName:e}),{rows:E}=await l.query(_),y=(p=E==null?void 0:E[0])==null?void 0:p.size;return lL({size:y,recordSamplingSettings:a})||Hn}catch(_){return d.error(_),Hn}},"getCollectionSamplingSize"),dL=h(async({cluster:l,bucketName:u,scopeName:t,collectionName:e,limit:a})=>{let d=es.getInferCollectionDocumentsQuery({bucketName:u,scopeName:t,collectionName:e,limit:a}),{rows:p,meta:_}=await l.query(d),E=zg(_,"errors.[0]");if(E)throw E;let[[y]]=p;return El.convertInferSchemaToDocuments({inference:y,bucketName:u})},"getCollectionDocumentsByInfer"),fL=h(async({cluster:l,data:u,bucketName:t,scopeName:e,collectionName:a,collectionIndexes:d,includeEmptyCollection:p,logger:_,app:E})=>{var y;try{let V={limit:await oL({cluster:l,bucketName:t,scopeName:e,collectionName:a,recordSamplingSettings:u.recordSamplingSettings,logger:_}),pagination:u.pagination,bucketName:t,scopeName:e,collectionName:a},K=es.getSelectCollectionDocumentsQuery({bucketName:t,scopeName:e,collectionName:a}),t0=await E4({cluster:l,options:V,query:K,logger:_}),f0=await xL({cluster:l,bucketName:t,scopeName:e,collectionName:a,documentId:(y=t0[0])==null?void 0:y.docid,logger:_});return El.getDbCollectionData({bucketName:t,scopeName:e,collectionName:a,documents:t0,collectionIndexes:d,includeEmptyCollection:p,standardDocument:f0,fieldInference:u.fieldInference})}catch(H){return _.error(H),pL({error:H,cluster:l,data:u,bucketName:t,scopeName:e,collectionName:a,collectionIndexes:d,includeEmptyCollection:p,logger:_,app:E})}},"getDbCollectionData"),pL=h(async({error:l,cluster:u,data:t,bucketName:e,scopeName:a,collectionName:d,collectionIndexes:p,includeEmptyCollection:_,logger:E,app:y})=>{try{let H=cf({error:l}),V=[];switch(H){case de.primaryIndexDoesNotExist:V=await dL({cluster:u,bucketName:e,scopeName:a,collectionName:d,limit:Hn});break;case de.inferMethodIsNotSupport:case de.n1qlMethodsAreNotSupported:V=await Jg.getCollectionDocuments({connectionInfo:t.connectionInfo,bucketName:e,scopeName:a,collectionName:d,logger:E,app:y});break}return El.getDbCollectionData({bucketName:e,scopeName:a,collectionName:d,documents:V,collectionIndexes:p,includeEmptyCollection:_,fieldInference:t.fieldInference})}catch(H){return E.error(H),El.getDbCollectionData({bucketName:e,scopeName:a,collectionName:d,documents:[],collectionIndexes:p,includeEmptyCollection:_,fieldInference:t.fieldInference})}},"getDbCollectionDataByErrorHandling"),_L=h(async({cluster:l,logger:u})=>{try{let t=es.getSelectIndexesQuery(),{rows:e}=await l.query(t);return e.map(a=>a.indexes)}catch(t){return u.error(t),[]}},"getIndexes"),xL=h(async({cluster:l,bucketName:u,scopeName:t,collectionName:e,documentId:a,logger:d})=>{try{let E=l.bucket(u).scope(t).collection(e),{content:y}=await E.get(a);return y}catch(p){return d.error(p),null}},"getCollectionDocumentByDocumentId");R4.exports={getAllBuckets:x4,createNewBucket:eL,getBucketsForReverse:sL,getDbCollectionsNames:nL,getDbCollectionData:fL,getDocumentsBySelectStatement:hL,getErrorCode:cf,getErrorMessage:aL,getIndexes:_L,getPaginatedQuery:E4}});var g4=$((Zw,C4)=>{var EL=Rl(),{AUTH_TYPE:RL,COUCHBASE_HOST_PREFIX:m4,COUCHBASE_DEFAULT_KV_CONNECTION_PORT:TL,HOSTING:T4}=Bt(),Su=null,A4=h(({connectionInfo:l})=>l.host.startsWith(m4.cloud),"isCloudStorage"),b4=h(({connectionInfo:l})=>{if(A4({connectionInfo:l}))return l.host;let u=l.kv_port||TL;return`${m4.selfHosted}${l.host}:${u}`},"generateUrl"),bL=h(({connectionInfo:l})=>l.authType===RL.securityCertificate?{url:b4({connectionInfo:l}),options:{authenticator:{certificatePath:l.security_certificate,keyPath:l.security_certificate_key}}}:{url:b4({connectionInfo:l}),options:{username:l.couchbase_username,password:l.couchbase_password}},"generateConnectionParams"),mL=h(async({connectionInfo:l,app:u})=>{if(Su)return Su;let t=await u.require("couchbase"),{url:e,options:a}=bL({connectionInfo:l});Su=await t.connect(e,a);let d=await EL.getAllBuckets({cluster:Su}),p=l.couchbase_bucket;if(p&&!d.includes(p))throw new Error(`Bucket ${p} doesn't exist`);return Su},"connect"),AL=h(async()=>{await(Su==null?void 0:Su.close()),Su=null},"disconnect"),CL=h(()=>{let l=(Su==null?void 0:Su._connStr)||"";return{hosting:A4({connectionInfo:{host:l}})?T4.capella:T4.selfHosted}},"getConnectionInfo");C4.exports={connect:mL,disconnect:AL,getConnectionInfo:CL}});var L4=$((tO,gL)=>{gL.exports={name:"CouchbaseV7Plus",version:"0.1.3",versionDate:"2024-03-08",author:"hackolade",engines:{hackolade:"7.0.0",hackoladePlugin:"1.0.1"},contributes:{target:{applicationTarget:"CouchbaseV7Plus",title:"Couchbase w/ collections",versions:["7.x"]},features:{enableForwardEngineering:!0,enableArrayCollections:!1}},description:"Hackolade plugin for Couchbase with scopes and collections","lint-staged":{"*.{js,json}":"prettier --write"},"simple-git-hooks":{"pre-commit":"npx lint-staged","pre-push":"npx eslint ."},scripts:{lint:"eslint . --max-warnings=0",package:"node esbuild.package.js"},dependencies:{async:"3.2.5","exponential-backoff":"3.1.1",lodash:"4.17.21",uuid:"9.0.1",antlr4:"4.9.2"},devDependencies:{"@hackolade/hck-esbuild-plugins-pack":"0.0.1","@types/couchbase":"2.4.9",esbuild:"0.19.12","esbuild-plugin-clean":"1.0.1",eslint:"8.56.0","eslint-config-prettier":"9.1.0","eslint-plugin-prettier":"5.1.3","lint-staged":"14.0.1",prettier:"3.2.4","simple-git-hooks":"2.9.0"}}});var w4=$((eO,N4)=>{var qt=require("os"),LL=L4(),{COUCHBASE_ERROR_CODE:yL}=Bt(),NL=h(()=>LL.version,"getPluginVersion"),wL=h(l=>`Date: ${new Date} Application version: ${l} Plugin version: ${NL()}