@fctc/interface-logic 4.6.2 → 4.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-24JB4Q7Z.cjs +1 -0
- package/dist/chunk-CI6PEZ77.mjs +1 -0
- package/dist/chunk-K6UUMPOE.mjs +1 -0
- package/dist/chunk-LYD7QJQX.mjs +2 -0
- package/dist/chunk-MULIHGQM.mjs +1 -0
- package/dist/chunk-N6RX73K2.cjs +1 -0
- package/dist/chunk-QV6QYYJF.cjs +5 -0
- package/dist/chunk-QWAB6OBZ.cjs +1 -0
- package/dist/chunk-V2FKQ7ES.mjs +1 -0
- package/dist/chunk-VSVSPTCC.cjs +1 -0
- package/dist/chunk-X73KGPFZ.cjs +2 -0
- package/dist/chunk-Y65DQP66.mjs +5 -0
- package/dist/configs.cjs +1 -0
- package/dist/configs.mjs +1 -2544
- package/dist/constants.cjs +1 -0
- package/dist/constants.mjs +1 -293
- package/dist/environment.cjs +1 -0
- package/dist/environment.d.mts +1 -1
- package/dist/environment.d.ts +1 -1
- package/dist/environment.mjs +1 -2669
- package/dist/hooks.cjs +1 -0
- package/dist/hooks.d.mts +1 -7
- package/dist/hooks.d.ts +1 -7
- package/dist/hooks.mjs +1 -8792
- package/dist/{local-storage-BPvoMGYJ.d.mts → local-storage-AbiOQTLK.d.mts} +1 -1
- package/dist/{local-storage-BPvoMGYJ.d.ts → local-storage-AbiOQTLK.d.ts} +1 -1
- package/dist/models.cjs +1 -0
- package/dist/models.mjs +1 -120
- package/dist/provider.cjs +1 -0
- package/dist/provider.d.mts +5 -10
- package/dist/provider.d.ts +5 -10
- package/dist/provider.mjs +1 -9487
- package/dist/services.cjs +1 -0
- package/dist/services.mjs +1 -6912
- package/dist/types.cjs +1 -0
- package/dist/utils.cjs +1 -0
- package/dist/utils.d.mts +33 -61
- package/dist/utils.d.ts +33 -61
- package/dist/utils.mjs +1 -3030
- package/package.json +2 -5
- package/dist/configs.js +0 -2581
- package/dist/constants.js +0 -335
- package/dist/environment.js +0 -2708
- package/dist/hooks.js +0 -8949
- package/dist/models.js +0 -147
- package/dist/provider.js +0 -9533
- package/dist/services.js +0 -6959
- package/dist/store.d.mts +0 -382
- package/dist/store.d.ts +0 -382
- package/dist/store.js +0 -823
- package/dist/store.mjs +0 -717
- package/dist/types.js +0 -18
- package/dist/utils.js +0 -3099
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var Ae=()=>({setToken:async a=>{localStorage.setItem("accessToken",a);},setRefreshToken:async a=>{localStorage.setItem("refreshToken",a);},getAccessToken:async()=>localStorage.getItem("accessToken"),getRefreshToken:async()=>localStorage.getItem("refreshToken"),clearToken:async()=>{localStorage.removeItem("accessToken"),localStorage.removeItem("refreshToken");}});var Te={getMenuFocus:()=>{let c=sessionStorage.getItem("menuFocus");return c?JSON.parse(c):{id:void 0,service:""}},setMenuFocus:c=>{sessionStorage.setItem("menuFocus",JSON.stringify({...c}));},setActionData:c=>{sessionStorage.setItem("actionData",JSON.stringify(c));},getActionData:()=>{let c=sessionStorage.getItem("actionData");return c?JSON.parse(c):{}},getViewData:()=>{let c=sessionStorage.getItem("viewData");return c?JSON.parse(c):{}},setViewData:c=>{sessionStorage.setItem("viewData",JSON.stringify(c));},getBrowserSession:()=>{let c=sessionStorage.getItem("browserSession");return c?JSON.parse(c):null},getXNode:()=>sessionStorage.getItem("xNode"),setXNode:c=>{sessionStorage.setItem("xNode",c);}};var C=class extends Error{},be={"\\":"\\",'"':'"',"'":"'",a:"\x07",b:"\b",f:"\f",n:`
|
|
2
|
+
`,r:"\r",t:" ",v:"\v"};function Ye(t,e){let n=[],r;for(let u=0;u<t.length;++u){if(t[u]!=="\\"){n.push(t[u]);continue}let a=t[u+1];if(a in be){n.push(be[a]),++u;continue}switch(a){case `
|
|
3
|
+
`:++u;continue;case "N":if(!e)break;throw new C("SyntaxError: \\N{} escape not implemented");case "u":if(!e)break;let s=t.slice(u+2,u+6);if(!/[0-9a-f]{4}/i.test(s))throw new C(["SyntaxError: (unicode error) 'unicodeescape' codec"," can't decode bytes in position ",u,"-",u+4,": truncated \\uXXXX escape"].join(""));r=parseInt(s,16),n.push(String.fromCharCode(r)),u+=5;continue;case "U":if(!e)break;throw new C("SyntaxError: \\U escape not implemented");case "x":let o=t.slice(u+2,u+4);if(!/[0-9a-f]{2}/i.test(o))throw e?new C(["SyntaxError: (unicode error) 'unicodeescape'"," codec can't decode bytes in position ",u,"-",u+2,": truncated \\xXX escape"].join("")):new C("ValueError: invalid \\x escape");r=parseInt(o,16),n.push(String.fromCharCode(r)),u+=3;continue;default:if(!/[0-8]/.test(a))break;let i=/[0-8]{1,3}/g;i.lastIndex=u+1;let c=i.exec(t);if(!c)break;let l=c[0];r=parseInt(l,8),n.push(String.fromCharCode(r)),u+=l.length;continue}n.push("\\");}return n.join("")}var ze=new Set(["None","False","True"]),J=["in","not","not in","is","is not","<","<=",">",">=","<>","!=","=="],ee=["or","and","|","^","&","<<",">>","+","-","*","/","//","%","~","**","."],Je=["-"],Ve=new Set(["(",")","[","]","{","}",":",",","if","else","lambda","=",...J,...ee,...Je]);function R(...t){return "("+t.join("|")+")"}var Se="[a-zA-Z_]\\w*",we="[ \\f\\t]*",Ke="\\d+(L|l)?",He=Ke,_="[eE][+-]?\\d+",Ze=R(`\\d+\\.\\d*(${_})?`,`\\.\\d+(${_})?`),qe=R(Ze,`\\d+${_}`),Fe=R(qe,He),Ge=R("\\*\\*=?",">>=?","<<=?","<>","!=","//=?","[+\\-*/%&|^=<>]=?","~"),Xe="[\\[\\]\\(\\)\\{\\}]",We="[:;.,`@]",Qe=R(Ge,Xe,We),xe=R("([uU])?'([^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*)'",'([uU])?"([^\\n"\\\\]*(?:\\\\.[^\\n"\\\\]*)*)"'),_e=we+R(Fe,Qe,xe,Se),et=new RegExp("^"+Fe+"$"),De=new RegExp("^"+xe+"$"),tt=new RegExp("^"+Se+"$"),nt=new RegExp("^"+we);function te(t){let e=[],n=t.length,r=0,u=0,a=new RegExp(_e,"g");for(;a.lastIndex<n;){let s=a.exec(t);if(!s){if(/^\s+$/.test(t.slice(u)))break;throw new C("Failed to tokenize <<"+t+">> at index "+(u||0)+"; parsed so far: "+e)}if(s.index>u&&t.slice(u,s.index).trim())throw new C("Invalid expression");r=s.index,u=a.lastIndex;let o=t.slice(r,u).replace(nt,"");if(et.test(o))e.push({type:0,value:parseFloat(o)});else if(De.test(o)){let i=De.exec(o);if(!i)throw new C("Invalid string match");e.push({type:1,value:Ye(i[3]!==void 0?i[3]:i[5],!!(i[2]||i[4]))});}else if(Ve.has(o))o==="in"&&e.length>0&&e[e.length-1].value==="not"?(o="not in",e.pop()):o==="not"&&e.length>0&&e[e.length-1].value==="is"&&(o="is not",e.pop()),e.push({type:2,value:o});else if(ze.has(o))e.push({type:4,value:o});else if(tt.test(o))e.push({type:3,value:o});else throw new C("Invalid expression")}return e}var d=class extends Error{},ve=new Set(J),rt=new Set([...ee,...J]);function V(t){switch(t){case "=":return 10;case "if":return 20;case "in":case "not in":case "is":case "is not":case "<":case "<=":case ">":case ">=":case "<>":case "==":case "!=":return 60;case "or":return 30;case "and":return 40;case "not":return 50;case "|":return 70;case "^":return 80;case "&":return 90;case "<<":case ">>":return 100;case "+":case "-":return 110;case "*":case "/":case "//":case "%":return 120;case "**":return 140;case ".":case "(":case "[":return 150;default:return 0}}function ne(t){return t.type===2?V(t.value):0}function g(t,e){return t.type===2&&t.value===e}function ut(t,e){switch(t.type){case 0:return {type:0,value:t.value};case 1:return {type:1,value:t.value};case 4:return t.value==="None"?{type:3}:{type:2,value:t.value==="True"};case 3:return {type:5,value:t.value};case 2:switch(t.value){case "-":case "+":case "~":return {type:6,op:t.value,right:b(e,130)};case "not":return {type:6,op:t.value,right:b(e,50)};case "(":let n=[],r=false;for(;e[0]&&!g(e[0],")");)if(n.push(b(e,0)),e[0]){if(e[0]&&g(e[0],","))r=true,e.shift();else if(!g(e[0],")"))throw new d("parsing error")}else throw new d("parsing error");if(!e[0]||!g(e[0],")"))throw new d("parsing error");return e.shift(),r=r||n.length===0,r?{type:10,value:n}:n[0];case "[":let u=[];for(;e[0]&&!g(e[0],"]");)if(u.push(b(e,0)),e[0]){if(g(e[0],","))e.shift();else if(!g(e[0],"]"))throw new d("parsing error")}if(!e[0]||!g(e[0],"]"))throw new d("parsing error");return e.shift(),{type:4,value:u};case "{":let a={};for(;e[0]&&!g(e[0],"}");){let s=b(e,0);if(s.type!==1&&s.type!==0||!e[0]||!g(e[0],":"))throw new d("parsing error");e.shift();let o=b(e,0);a[s.value]=o,g(e[0],",")&&e.shift();}if(!e.shift())throw new d("parsing error");return {type:11,value:a};default:throw new d("Token cannot be parsed")}default:throw new d("Token cannot be parsed")}}function ot(t,e,n){switch(e.type){case 2:if(rt.has(e.value)){let r=b(n,ne(e));if(e.value==="and"||e.value==="or")return {type:14,op:e.value,left:t,right:r};if(e.value==="."){if(r.type===5)return {type:15,obj:t,key:r.value};throw new d("invalid obj lookup")}let u={type:7,op:e.value,left:t,right:r};for(;ve.has(e.value)&&n[0]&&n[0].type===2&&ve.has(n[0].value);){let a=n.shift();u={type:14,op:"and",left:u,right:{type:7,op:a.value,left:r,right:b(n,ne(a))}},r=u.right;}return u}switch(e.value){case "(":let r=[],u={};for(;n[0]&&!g(n[0],")");){let i=b(n,0);i.type===9?u[i.name.value]=i.value:r.push(i),n[0]&&g(n[0],",")&&n.shift();}if(!n[0]||!g(n[0],")"))throw new d("parsing error");return n.shift(),{type:8,fn:t,args:r,kwargs:u};case "=":if(t.type===5)return {type:9,name:t,value:b(n,10)};break;case "[":let a=b(n);if(!n[0]||!g(n[0],"]"))throw new d("parsing error");return n.shift(),{type:12,target:t,key:a};case "if":let s=b(n);if(!n[0]||!g(n[0],"else"))throw new d("parsing error");n.shift();let o=b(n);return {type:13,condition:s,ifTrue:t,ifFalse:o};}}throw new d("Token cannot be parsed")}function b(t,e=0){let n=t.shift();if(!n)throw new d("Unexpected end of input");let r=ut(n,t);for(;t[0]&&ne(t[0])>e;)r=ot(r,t.shift(),t);return r}function re(t){if(t.length)return b(t,0);throw new d("Missing token")}function N(t,e){let n=t[t.length-1],r=typeof n=="object"?t.slice(0,-1):t,u=typeof n=="object"?n:{};for(let[a,s]of r.entries())u[e[a]]=s;return u}var se=class extends Error{},U=class extends Error{},P=class extends Error{};function S(t){return String(t).padStart(2,"0")}function ce(t){return String(t).padStart(4,"0")}function w(t,e,n){let r=t%e;return (r>0&&e<0||r<0&&e>0)&&(r+=e),n(Math.floor(t/e),r)}function ae(t,e="AssertionError"){if(!t)throw new se(e)}var K=[null,31,28,31,30,31,30,31,31,30,31,30,31],le=[null];for(let t=0,e=1;e<K.length;++e)le.push(t),t+=K[e];function ie(t,e){return e===2&&H(t)?29:K[e]}function H(t){return t%4===0&&(t%100!==0||t%400===0)}function Z(t){let e=t-1;return e*365+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400)}function st(t,e){let n=e>2&&H(t);return le[e]+(n?1:0)}function Ce(t,e,n){let r=ie(t,e);if(!(1<=n&&n<=r))throw new U(`day must be in 1..${r}`);return Z(t)+st(t,e)+n}var at=Z(401),it=Z(101),ct=Z(5);function lt(t){--t;let e=0,n=0,r=0,u=0,a=0;w(t,at,(l,A)=>{e=l,w(A,it,(x,v)=>{n=x,w(v,ct,(L,f)=>{r=L,w(f,365,(m,T)=>{u=m,a=T;});});});}),t=a;let s=e*400+1+n*100+r*4+u;if(u===4||n===100)return ae(a===0),{year:s-1,month:12,day:31};let o=u===3&&(r!==24||n===3);ae(o===H(s));let i=t+50>>5,c=le[i]+(i>2&&o?1:0);return c>t&&(--i,c-=K[i]+(i===2&&o?1:0)),t-=c,{year:s,month:i,day:t+1}}function fe(t,e,n,r,u,a,s){r=r||0,u=u||0,a=a||0,s=s||0,(s<0||s>999999)&&w(s,1e6,(i,c)=>{s=c,a+=i;}),(a<0||a>59)&&w(a,60,(i,c)=>{a=c,u+=i;}),(u<0||u>59)&&w(u,60,(i,c)=>{u=c,r+=i;}),(r<0||r>23)&&w(r,24,(i,c)=>{r=c,n+=i;}),(e<1||e>12)&&w(e-1,12,(i,c)=>{e=c+1,t+=i;});let o=ie(t,e);if(n<1||n>o)if(n===0)--e,e>0?n=ie(t,e):(--t,e=12,n=31);else if(n===o+1)++e,n=1,e>12&&(e=1,++t);else {let i=lt(Ce(t,e,1)+(n-1));t=i.year,e=i.month,n=i.day;}return {year:t,month:e,day:n,hour:r,minute:u,second:a,microsecond:s}}var E=class t{constructor(e,n,r){this.year=e;this.month=n;this.day=r;}static today(){return this.convertDate(new Date)}static convertDate(e){let n=e.getFullYear(),r=e.getMonth()+1,u=e.getDate();return new t(n,r,u)}static create(...e){let{year:n,month:r,day:u}=N(e,["year","month","day"]);return new t(n,r,u)}add(e){let n=fe(this.year,this.month,this.day+e.days,0,0,0);return new t(n.year,n.month,n.day)}isEqual(e){return e instanceof t?this.year===e.year&&this.month===e.month&&this.day===e.day:false}strftime(e){return e.replace(/%([A-Za-z])/g,(n,r)=>{switch(r){case "Y":return ce(this.year);case "m":return S(this.month);case "d":return S(this.day);default:throw new U(`No known conversion for ${n}`)}})}substract(e){if(e instanceof h)return this.add(e.negate());if(e instanceof t)return h.create(this.toordinal()-e.toordinal());throw new P}toJSON(){return this.strftime("%Y-%m-%d")}toordinal(){return Ce(this.year,this.month,this.day)}},p=class t{constructor(e,n,r,u,a,s,o){this.year=e;this.month=n;this.day=r;this.hour=u;this.minute=a;this.second=s;this.microsecond=o;}static now(){return this.convertDate(new Date)}static convertDate(e){let n=e.getFullYear(),r=e.getMonth()+1,u=e.getDate(),a=e.getHours(),s=e.getMinutes(),o=e.getSeconds();return new t(n,r,u,a,s,o,0)}static create(...e){let n=N(e,["year","month","day","hour","minute","second","microsecond"]),r=n.year,u=n.month,a=n.day,s=n.hour||0,o=n.minute||0,i=n.second||0,c=n.microsecond/1e3||0;return new t(r,u,a,s,o,i,c)}static combine(...e){let{date:n,time:r}=N(e,["date","time"]);return t.create(n.year,n.month,n.day,r.hour,r.minute,r.second)}add(e){let n=fe(this.year,this.month,this.day+e.days,this.hour,this.minute,this.second+e.seconds,this.microsecond+e.microseconds);return new t(n.year,n.month,n.day,n.hour,n.minute,n.second,n.microsecond)}isEqual(e){return e instanceof t?this.year===e.year&&this.month===e.month&&this.day===e.day&&this.hour===e.hour&&this.minute===e.minute&&this.second===e.second&&this.microsecond===e.microsecond:false}strftime(e){return e.replace(/%([A-Za-z])/g,(n,r)=>{switch(r){case "Y":return ce(this.year);case "m":return S(this.month);case "d":return S(this.day);case "H":return S(this.hour);case "M":return S(this.minute);case "S":return S(this.second);default:throw new U(`No known conversion for ${n}`)}})}substract(e){return this.add(e.negate())}toJSON(){return this.strftime("%Y-%m-%d %H:%M:%S")}to_utc(){let e=new Date(this.year,this.month-1,this.day,this.hour,this.minute,this.second),n=h.create({minutes:e.getTimezoneOffset()});return this.add(n)}},j=class t extends E{constructor(n,r,u){let a=new Date,s=a.getFullYear(),o=a.getMonth()+1,i=a.getDate();super(s,o,i);this.hour=n;this.minute=r;this.second=u;this.hour=n,this.minute=r,this.second=u;}static create(...n){let r=N(n,["hour","minute","second"]),u=r.hour||0,a=r.minute||0,s=r.second||0;return new t(u,a,s)}strftime(n){return n.replace(/%([A-Za-z])/g,(r,u)=>{switch(u){case "Y":return ce(this.year);case "m":return S(this.month);case "d":return S(this.day);case "H":return S(this.hour);case "M":return S(this.minute);case "S":return S(this.second);default:throw new U(`No known conversion for ${r}`)}})}toJSON(){return this.strftime("%H:%M:%S")}},ue=[31,59,90,120,151,181,212,243,273,304,334,366],ft=["hour","minute","second"],yt=["year","month","day",...ft],pt="years months weeks days hours minutes seconds microseconds leapdays".split(" "),mt="year month day hour minute second microsecond weekday nlyearday yearday".split(" "),dt=["dt1","dt2"],O=class t{static create(...e){let n=N(e,dt);if("dt1"in n)throw new Error("relativedelta(dt1, dt2) is not supported for now");for(let u of yt)if(u in n){let a=n[u];ae(a>=0,`${u} ${a} is out of range`);}for(let u of pt)n[u]=n[u]||0;for(let u of mt)n[u]=u in n?n[u]:null;n.days+=7*n.weeks;let r=0;if(n.nlyearday?r=n.nlyearday:n.yearday&&(r=n.yearday,r>59&&(n.leapDays=-1)),r){for(let u=0;u<ue.length;u++)if(r<=ue[u]){n.month=u+1,u===0?n.day=r:n.day=r-ue[u-1];break}}return new t(n)}static add(e,n){if(!(e instanceof E||e instanceof p))throw new P;let r=fe((n.year||e.year)+n.years,(n.month||e.month)+n.months,n.day||e.day,n.hour||(e instanceof p?e.hour:0),n.minute||(e instanceof p?e.minute:0),n.second||(e instanceof p?e.second:0),n.microseconds||(e instanceof p?e.microsecond:0)),u=new p(r.year,r.month,r.day,r.hour,r.minute,r.second,r.microsecond),a=0;n.leapDays&&u.month>2&&H(u.year)&&(a=n.leapDays);let s=u.add(h.create({days:n.days+a,hours:n.hours,minutes:n.minutes,seconds:n.seconds,microseconds:n.microseconds})),i=!!!(s.hour||s.minute||s.second||s.microsecond)&&e instanceof E?new E(s.year,s.month,s.day):s;if(n.weekday!==null){let c=n.weekday+1,A=(7-new Date(i.year,i.month-1,i.day).getDay()+c)%7;return i.add(new h(A,0,0))}return i}static substract(e,n){return t.add(e,n.negate())}constructor(e={},n=1){this.years=n*e.years,this.months=n*e.months,this.days=n*e.days,this.hours=n*e.hours,this.minutes=n*e.minutes,this.seconds=n*e.seconds,this.microseconds=n*e.microseconds,this.leapDays=e.leapDays,this.year=e.year,this.month=e.month,this.day=e.day,this.hour=e.hour,this.minute=e.minute,this.second=e.second,this.microsecond=e.microsecond,this.weekday=e.weekday;}years;months;days;hours;minutes;seconds;microseconds;leapDays;year;month;day;hour;minute;second;microsecond;weekday;negate(){return new t(this,-1)}isEqual(){throw new P}},Et="weeks days hours minutes seconds milliseconds microseconds".split(" ");function oe(t){let e=t%1;return [e<0?e+1:e,Math.floor(t)]}var h=class t{constructor(e,n,r){this.days=e;this.seconds=n;this.microseconds=r;}static create(...e){let n=N(e,["days","seconds","microseconds"]);for(let f of Et)n[f]=n[f]||0;let r=0,u=0,a=0,s=n.days+n.weeks*7,o=n.seconds+60*n.minutes+3600*n.hours,i=n.microseconds+1e3*n.milliseconds,[c,l]=oe(s);r=l;let A=0;if(c){let[f,m]=oe(c*24*3600);u=m,A=f;}let[x,v]=oe(o);o=v;let L=x+A;return w(o,24*3600,(f,m)=>{r+=f,u+=m;}),i+=L*1e6,w(i,1e6,(f,m)=>{w(f,24*3600,(T,Me)=>{r+=T,u+=Me,a+=Math.round(m);});}),new t(r,u,a)}add(e){return t.create({days:this.days+e.days,seconds:this.seconds+e.seconds,microseconds:this.microseconds+e.microseconds})}divide(e){let n=(this.days*24*3600+this.seconds)*1e6+this.microseconds;return t.create({microseconds:Math.floor(n/e)})}isEqual(e){return e instanceof t?this.days===e.days&&this.seconds===e.seconds&&this.microseconds===e.microseconds:false}isTrue(){return this.days!==0||this.seconds!==0||this.microseconds!==0}multiply(e){return t.create({days:e*this.days,seconds:e*this.seconds,microseconds:e*this.microseconds})}negate(){return t.create({days:-this.days,seconds:-this.seconds,microseconds:-this.microseconds})}substract(e){return t.create({days:this.days-e.days,seconds:this.seconds-e.seconds,microseconds:this.microseconds-e.microseconds})}total_seconds(){return this.days*86400+this.seconds+this.microseconds/1e6}};var k=class extends Error{constructor(e){super(e),this.name="EvaluationError";}};function ye(t,e){if(t===null)throw new k("value not iterable");if(typeof t=="object"&&!Array.isArray(t)&&!(t instanceof Set)&&(t=Object.keys(t)),typeof t?.[Symbol.iterator]!="function")throw new k("value not iterable");return e(t)}var D={bool(t){switch(typeof t){case "number":return t!==0;case "string":return t!=="";case "boolean":return t;case "object":return t==null?false:"isTrue"in t&&typeof t.isTrue=="function"?t.isTrue():t instanceof Array?!!t.length:t instanceof Set?!!t.size:Object.keys(t).length!==0;default:return true}},set(t){if(arguments.length>2)throw new k(`set expected at most 1 argument, got (${arguments.length-1})`);return ye(t,e=>new Set(e))},time:{strftime(t){return p.now().strftime(t)}},context_today(){return E.today()},get current_date(){return this.today},get today(){return E.today().strftime("%Y-%m-%d")},get now(){return p.now().strftime("%Y-%m-%d %H:%M:%S")},datetime:{time:j,timedelta:h,datetime:p,date:E},relativedelta:O,true:true,false:false};function q(t){switch(typeof t){case "string":return {type:1,value:t};case "number":return {type:0,value:t};case "boolean":return {type:2,value:t};case "object":if(Array.isArray(t))return {type:4,value:t.map(q)};if(t===null)return {type:3};if(t instanceof Date)return {type:1,value:String(p.convertDate(t))};if(t instanceof E||t instanceof p)return {type:1,value:t};{let e={};for(let n in t)e[n]=q(t[n]);return {type:11,value:e}}default:throw new Error("Invalid type")}}function y(t,e=0){switch(t.type){case 3:return "None";case 1:return JSON.stringify(t.value);case 0:return String(t.value);case 2:return t.value?"True":"False";case 4:return `[${t.value.map(y).join(", ")}]`;case 6:return t.op==="not"?`not ${y(t.right,50)}`:`${t.op}${y(t.right,130)}`;case 7:let n=V(t.op),r=`${y(t.left,n)} ${t.op} ${y(t.right,n)}`;return n<e?`(${r})`:r;case 11:let u=[];for(let v in t.value)u.push(`"${v}": ${y(t.value[v])}`);return `{${u.join(", ")}}`;case 10:return `(${t.value.map(y).join(", ")})`;case 5:return t.value;case 12:return `${y(t.target)}[${y(t.key)}]`;case 13:let{ifTrue:a,condition:s,ifFalse:o}=t;return `${y(a)} if ${y(s)} else ${y(o)}`;case 14:let i=V(t.op),c=`${y(t.left,i)} ${t.op} ${y(t.right,i)}`;return i<e?`(${c})`:c;case 15:return `${y(t.obj,150)}.${t.key}`;case 8:let l=t.args.map(y),A=[];for(let v in t.kwargs)A.push(`${v} = ${y(t.kwargs[v])}`);let x=l.concat(A).join(", ");return `${y(t.fn)}(${x})`;default:throw new Error("invalid expression: "+JSON.stringify(t))}}var pe=Object.create(null);function me(t){return new Proxy(t,{getPrototypeOf(){return pe}})}var W=D.bool;function ht(t,e){let n=B(t.right,e);switch(t.op){case "-":return n instanceof Object&&"negate"in n?n.negate():-n;case "+":return n;case "not":return !W(n);default:throw new k(`Unknown unary operator: ${t.op}`)}}function Oe(t){switch(typeof t){case "object":return t===null?1:Array.isArray(t)?5:3;case "number":return 2;case "string":return 4;default:throw new k(`Unknown type: ${typeof t}`)}}function G(t,e){if(typeof t=="number"&&typeof e=="number")return t<e;typeof t=="boolean"&&(t=t?1:0),typeof e=="boolean"&&(e=e?1:0);let n=Oe(t),r=Oe(e);return n===r?t<e:n<r}function X(t,e){return typeof t!=typeof e?typeof t=="boolean"&&typeof e=="number"?e===(t?1:0):typeof t=="number"&&typeof e=="boolean"?t===(e?1:0):false:t instanceof Object&&"isEqual"in t?t.isEqual(e):t===e}function ke(t,e){return Array.isArray(e)||typeof e=="string"&&typeof t=="string"?e.includes(t):typeof e=="object"?t in e:false}function gt(t,e){let n=B(t.left,e),r=B(t.right,e);switch(t.op){case "+":{let u=n instanceof O,a=r instanceof O;if(u||a){let i=u?r:n,c=u?n:r;return O.add(i,c)}let s=n instanceof h,o=r instanceof h;if(s&&o)return n.add(r);if(s){if(r instanceof E||r instanceof p)return r.add(n);throw new P}if(o){if(n instanceof E||n instanceof p)return n.add(r);throw new P}return n instanceof Array&&r instanceof Array?[...n,...r]:n+r}case "-":{if(r instanceof O)return O.substract(n,r);if(r instanceof h){if(n instanceof h)return n.substract(r);if(n instanceof E||n instanceof p)return n.substract(r);throw new P}return n instanceof E?n.substract(r):n-r}case "*":{let u=n instanceof h,a=r instanceof h;if(u||a){let s=u?r:n;return (u?n:r).multiply(s)}return n*r}case "/":return n/r;case "%":return n%r;case "//":return n instanceof h?n.divide(r):Math.floor(n/r);case "**":return n**r;case "==":return X(n,r);case "<>":case "!=":return !X(n,r);case "<":return G(n,r);case ">":return G(r,n);case ">=":return X(n,r)||G(r,n);case "<=":return X(n,r)||G(n,r);case "in":return ke(n,r);case "not in":return !ke(n,r);default:throw new k(`Unknown binary operator: ${t.op}`)}}var Ee={get(...t){let{key:e,defValue:n}=N(t,["key","defValue"]),r=this;return e in r?r[e]:n!==void 0?n:null}},Pe={lower(){return this.toLowerCase()},upper(){return this.toUpperCase()}};function de(t,e,n,...r){if(r.length===1)return new Set(n);if(r.length>2)throw new k(`${t}: py_js supports at most 1 argument, got (${r.length-1})`);return ye(r[0],e)}var Re={intersection(...t){return de("intersection",e=>{let n=new Set;for(let r of e)this.has(r)&&n.add(r);return n},this,...t)},difference(...t){return de("difference",e=>{e=new Set(e);let n=new Set;for(let r of this)e.has(r)||n.add(r);return n},this,...t)},union(...t){return de("union",e=>new Set([...this,...e]),this,...t)}};function Be(t){return Object.getOwnPropertyNames(t.prototype).map(e=>t.prototype[e])}var Ie=new Set([D.time.strftime,D.set,D.bool,D.context_today,D.datetime.datetime.now,D.datetime.datetime.combine,D.datetime.date.today,...Be(D.relativedelta),...Object.values(D.datetime).flatMap(t=>Be(t)),...Object.values(Re),...Object.values(Ee),...Object.values(Pe)]),Ne=Symbol("unbound function");function B(t,e={}){let n=new Set,r,u=Object.create(e);u?.context||Object.defineProperty(u,"context",{get(){return r||(r=me(e)),r}});function a(o){switch(o?.type){case 0:case 1:return o.value;case 5:return o.value in u?typeof u[o.value]=="object"&&u[o.value]?.id&&o?.value!=="parent"?u[o.value]?.id:u[o.value]??false:o.value in D?D[o.value]:false;case 3:return null;case 2:return o.value;case 6:return ht(o,u);case 7:return gt(o,u);case 14:let i=s(o.left);return o.op==="and"?W(i)?s(o.right):i:W(i)?i:s(o.right);case 4:case 10:return o.value.map(s);case 11:let c={};for(let T in o.value)c[T]=s(o.value[T]);return n.add(c),c;case 8:let l=s(o.fn),A=o.args.map(s),x={};for(let T in o.kwargs)x[T]=s(o?.kwargs[T]);return l===E||l===p||l===j||l===O||l===h?l.create(...A,x):l(...A,x);case 12:let v=s(o.target),L=s(o.key);return v[L];case 13:return W(s(o.condition))?s(o.ifTrue):s(o.ifFalse);case 15:let f=s(o.obj),m;if(n.has(f)||Object.isPrototypeOf.call(pe,f)?m=Ee[o.key]:typeof f=="string"?m=Pe[o.key]:f instanceof Set?m=Re[o.key]:o.key==="get"&&typeof f=="object"?(m=Ee[o.key],f=me(f)):typeof f=="number"?m=f:Array.isArray(f[o.key])?m=f[o.key]?.map(T=>T?.id??T):m=f[o.key]?.id??f[o.key]??false,typeof m=="function"){let T=m.bind(f);return T[Ne]=m,T}return m;default:throw new k(`AST of type ${o.type} cannot be evaluated`)}}function s(o){let i=a(o);if(typeof i=="function"&&!Ie.has(i)&&!Ie.has(i[Ne]))throw new Error("Invalid Function Call");return i}return s(t)}function $(t){let e=te(t);return re(e)}function M(t,e={}){let n;try{n=$(t);}catch(r){throw new EvalError(`Can not parse python expression: (${t})
|
|
4
|
+
Error: ${r.message}`)}try{return B(n,e)}catch(r){throw new EvalError(`Can not evaluate python expression: (${t})
|
|
5
|
+
Error: ${r.message}`)}}function Ue(t,e={}){return !t||t==="False"||t==="0"?false:t==="True"||t==="1"?true:M(`bool(${t})`,e)}function At(t,e){let n=Object.assign({},e),r={};for(let u of t)u!==""&&(u=typeof u=="string"?M(u,n):u||{},Object.assign(r,u),Object.assign(n,r));return r}function he(t,e={}){let n=$(t),r={};for(let u in n.value){let a=n.value[u];try{r[u]=B(a,e);}catch{}}return r}function je(t,e,n=(r,u)=>r===u){if(!t||!e||typeof t!="object"||typeof e!="object")return t===e;let r=Object.keys(t);return r.length===Object.keys(e).length&&r.every(u=>n(t[u],e[u]))}var Le=je;function Y(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var I=class extends Error{},F=class t{ast={type:-1,value:null};static TRUE;static FALSE;static combine(e,n){if(e.length===0)return new t([]);let r=e[0]instanceof t?e[0]:new t(e[0]);if(e.length===1)return r;let u=t.combine(e.slice(1),n),a=new t([]),s=r.ast.value,o=u.ast.value,i=n==="AND"?"&":"|",c={type:4,value:s.concat(o)};return a.ast=$e(c,i),a}static and(e){return t.combine(e,"AND")}static or(e){return t.combine(e,"OR")}static not(e){let n=new t(e);return n.ast.value.unshift({type:1,value:"!"}),n}static removeDomainLeaves(e,n){function r(s,o,i,c){let l=s[o];if(l.type===10)return n.includes(l.value[0].value)?i==="&"?c.ast.value.push(...t.TRUE.ast.value):i==="|"&&c.ast.value.push(...t.FALSE.ast.value):c.ast.value.push(l),1;if(l.type===1){if(l.value==="|"&&s[o+1].type===10&&s[o+2].type===10&&n.includes(s[o+1].value[0].value)&&n.includes(s[o+2].value[0].value))return c.ast.value.push(...t.TRUE.ast.value),3;if(c.ast.value.push(l),l.value==="!")return 1+r(s,o+1,"&",c);let A=r(s,o+1,l.value,c),x=r(s,o+1+A,l.value,c);return 1+A+x}return 0}let u=new t(e);if(u.ast.value.length===0)return u;let a=new t([]);return r(u.ast.value,0,"&",a),a}constructor(e=[]){if(e instanceof t)return new t(e.toString());{let n;try{n=typeof e=="string"?$(e):Ft(e);}catch(r){throw new I(`Invalid domain representation: ${e}`,{cause:r})}this.ast=$e(n);}}contains(e){let n=B(this.ast,e);return vt(e,n)}toString(){return y(this.ast)}toList(e){return B(this.ast,e)}toJson(){try{let e=this.toList({});return new t(e).toString()===this.toString()?e:this.toString()}catch{return this.toString()}}};function Tt(t,e){return t&&typeof t!="boolean"&&(t=new F(t).contains(e)),!!t}var bt=[1,"=",1],Dt=[0,"=",1],St=new F([bt]),wt=new F([Dt]);F.TRUE=St;F.FALSE=wt;function Ft(t){return {type:4,value:t.map(n=>{switch(n){case "!":case "&":case "|":return {type:1,value:n};default:return {type:10,value:n.map(q)}}})}}function $e(t,e="&"){if(t.type!==4)if(t.type===10){let u=t.value;if(u.findIndex(a=>a.type===10)===-1||!u.every(a=>a.type===10||a.type===1))throw new I("Invalid domain AST")}else throw new I("Invalid domain AST");if(t.value.length===0)return t;let n=1;for(let u of t.value)switch(u.type){case 1:if(u.value==="&"||u.value==="|")n++;else if(u.value!=="!")throw new I("Invalid domain AST");break;case 4:case 10:if(u.value.length===3){n--;break}throw new I("Invalid domain AST");default:throw new I("Invalid domain AST")}let r=t.value.slice();for(;n<0;)n++,r.unshift({type:1,value:e});if(n>0)throw new I(`invalid domain ${y(t)} (missing ${n} segment(s))`);return {type:4,value:r}}function Q(t,e){if(typeof e=="boolean")return e;let[n,r,u]=e;if(typeof n=="string"){let i=n.split(".");if(i.length>=2)return Q(t[i[0]],[i.slice(1).join("."),r,u])}let a,s;["like","not like","ilike","not ilike"].includes(r)&&(a=new RegExp(`(.*)${Y(u).replaceAll("%","(.*)")}(.*)`,"g"),s=new RegExp(`(.*)${Y(u).replaceAll("%","(.*)")}(.*)`,"gi"));let o=typeof n=="number"?n:t[n];switch(r){case "=?":if([false,null].includes(u))return true;case "=":case "==":return Array.isArray(o)&&Array.isArray(u)?Le(o,u):o===u;case "!=":case "<>":return !Q(t,[n,"==",u]);case "<":return o<u;case "<=":return o<=u;case ">":return o>u;case ">=":return o>=u;case "in":{let i=Array.isArray(u)?u:[u];return (Array.isArray(o)?o:[o]).some(l=>i.includes(l))}case "not in":{let i=Array.isArray(u)?u:[u];return !(Array.isArray(o)?o:[o]).some(l=>i.includes(l))}case "like":return o===false?false:!!o.match(a);case "not like":return o===false?false:!o.match(a);case "=like":return o===false?false:new RegExp(Y(u).replace(/%/g,".*")).test(o);case "ilike":return o===false?false:!!o.match(s);case "not ilike":return o===false?false:!o.match(s);case "=ilike":return o===false?false:new RegExp(Y(u).replace(/%/g,".*"),"i").test(o)}throw new I("could not match domain")}function xt(t){let e=Q.bind(null,t);return {"!":n=>!e(n),"&":(n,r)=>e(n)&&e(r),"|":(n,r)=>e(n)||e(r)}}function vt(t,e){if(e.length===0)return true;let n=xt(t),r=Array.from(e).reverse(),u=[];for(let a of r){let s=typeof a=="string"&&n[a];if(s){let o=u.splice(-s.length);u.push(s(...o));}else u.push(a);}return Q(t,u.pop())}var z=(t,e)=>{try{if(e===void 0||e==="0"||e==="False"||e===!1)return !1;if(e==="1"||e==="True"||e===!0)return !0;try{if(t&&e)return new F(e).contains(t)}catch{return t&&e?Ue(e,t):!1}return !1}catch{return false}},ge=(t,e)=>{if(Array.isArray(e)){if(e?.length>0)return e&&e.some(n=>z(t,n))}else return z(t,e);return false};var Ct={checkDomain:z,matchDomains:ge,Domain:F},Ot=(t,e={})=>{try{return he(t,JSON.parse(JSON.stringify(e)))}catch{return null}},kt=(t,e)=>{let n=JSON.parse(JSON.stringify(e));try{return n&&Object.keys(n)?.forEach(u=>{Array.isArray(n[u])&&n[u]?.every(s=>typeof s=="object"&&s!==null&&s?.id!==void 0)&&(n[u]=n[u]?.map(s=>s?.id));}),M(t,n)}catch{try{return new F(t).toList(n)}catch{return []}}},Bt=t=>t?t.split(",").map(e=>{let[n,r]=e.trim().split(/\s+/),u=r?.toUpperCase()==="DESC"?"DESC":"ASC";return `${n} ${u}`}).join(", "):null,It=t=>Object.keys(t).map(e=>encodeURIComponent(e)+"="+encodeURIComponent(t[e].toString())).join("&");function Nt(t){let e={};for(let[n,r]of Object.entries(t))r!=null&&(e[n]=r);return e}var Pt=(t,e)=>{if(!t.data)return t.data;if(typeof t.data=="string")try{let n=JSON.parse(t.data);return n.with_context&&typeof n.with_context=="object"&&(n.with_context.token=e),JSON.stringify(n)}catch(n){return console.warn("Failed to parse originalRequest.data",n),t.data}return typeof t.data=="object"&&t.data.with_context&&(t.data.with_context.token=e),t.data};export{Ae as a,Te as b,At as c,he as d,I as e,F as f,Tt as g,z as h,ge as i,Ct as j,Ot as k,kt as l,Bt as m,It as n,Nt as o,Pt as p};
|
package/dist/configs.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkX73KGPFZ_cjs=require('./chunk-X73KGPFZ.cjs');require('./chunk-QV6QYYJF.cjs'),require('./chunk-N6RX73K2.cjs');Object.defineProperty(exports,"axiosClient",{enumerable:true,get:function(){return chunkX73KGPFZ_cjs.a}});
|