@dappworks/urpc
Advanced tools
Comparing version 0.0.29 to 0.0.30
@@ -39,3 +39,4 @@ // Generated by dts-bundle-generator v9.5.1 | ||
} | ||
export interface URPC_Variable<G extends () => Promise<any> = () => Promise<any>, T extends Awaited<ReturnType<G>> = Awaited<ReturnType<G>>> { | ||
export type UnwrapPromise<T> = T extends Promise<infer U> ? U : T; | ||
export interface URPC_Variable<G extends () => any = () => any, T extends UnwrapPromise<ReturnType<G>> = UnwrapPromise<ReturnType<G>>> { | ||
uid: string; | ||
@@ -45,12 +46,12 @@ type?: "var"; | ||
path?: string; | ||
get: T; | ||
schema?: (val: ReturnType<T>) => { | ||
[F in keyof Item<ReturnType<T>> | string]?: { | ||
get: G; | ||
schema?: (val: T) => { | ||
[F in keyof Item<T> | string]?: { | ||
type?: string; | ||
uiConfig?: FormConfigItem; | ||
call?: (val: Item<ReturnType<T>>) => any; | ||
call?: (val: Item<T>) => any; | ||
}; | ||
}; | ||
_schema?: ReturnType<Required<URPC_Variable<T>>["schema"]>; | ||
actions?: ActionType<Item<ReturnType<T>>>; | ||
actions?: ActionType<Item<T>>; | ||
patch?: { | ||
@@ -61,3 +62,3 @@ allowCreate?: Boolean; | ||
autoPatch?: Boolean; | ||
onCreate?: (value: Item<ReturnType<T>>) => any; | ||
onCreate?: (value: Item<T>) => any; | ||
onUpdate?: (key: any, value: any) => any; | ||
@@ -67,3 +68,3 @@ onDelete?: (key: any) => any; | ||
}; | ||
set?: (val: ReturnType<T>) => any; | ||
set?: (val: T) => any; | ||
} | ||
@@ -78,3 +79,3 @@ export type URPC_Entity = URPC_Function<any, any> | URPC_Variable<any>; | ||
uidSchemas: URPC_Schema; | ||
static Var<G extends () => Promise<any>, T extends Awaited<ReturnType<G>>>(args: Partial<URPC_Variable<G, T>>): URPC_Variable<G, T>; | ||
static Var<G extends () => any>(args: Partial<URPC_Variable<G>>): URPC_Variable<G>; | ||
static Func<T extends Object = {}, R = any>(args: Partial<URPC_Function<T, R>>): URPC_Function<T, R>; | ||
@@ -141,3 +142,3 @@ constructor(args?: Partial<URPC<T>>); | ||
var: { | ||
set<R_1 extends keyof T, V extends T[R_1] extends URPC_Variable<infer Z_2 extends () => Promise<any>, Awaited<ReturnType<infer Z_2 extends () => Promise<any>>>> ? Z_2 : never>(params: { | ||
set<R_1 extends keyof T, V extends T[R_1] extends URPC_Variable<infer Z_2 extends () => any, ReturnType<infer Z_2 extends () => any> extends infer T_1 ? T_1 extends ReturnType<infer Z_2 extends () => any> ? T_1 extends Promise<infer U> ? U : T_1 : never : never> ? Z_2 : never>(params: { | ||
name: R_1; | ||
@@ -144,0 +145,0 @@ value: ReturnType<V>; |
@@ -9,2 +9,2 @@ var fQ=Object.create;var{defineProperty:m$,getPrototypeOf:mQ,getOwnPropertyNames:gQ}=Object;var jQ=Object.prototype.hasOwnProperty;var g$=($,Z,Q)=>{Q=$!=null?fQ(mQ($)):{};const X=Z||!$||!$.__esModule?m$(Q,"default",{value:$,enumerable:!0}):Q;for(let Y of gQ($))if(!jQ.call(X,Y))m$(X,Y,{get:()=>$[Y],enumerable:!0});return X};var j$=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var d$=($,Z)=>{for(var Q in Z)m$($,Q,{get:Z[Q],enumerable:!0,configurable:!0,set:(X)=>Z[Q]=()=>X})};var VZ=j$((v5,PZ)=>{var tQ=function($,Z){return $==null?void 0:$[Z]},aQ=function($){var Z=!1;if($!=null&&typeof $.toString!="function")try{Z=!!($+"")}catch(Q){}return Z},x=function($){var Z=-1,Q=$?$.length:0;this.clear();while(++Z<Q){var X=$[Z];this.set(X[0],X[1])}},Y1=function(){this.__data__=r?r(null):{}},U1=function($){return this.has($)&&delete this.__data__[$]},B1=function($){var Z=this.__data__;if(r){var Q=Z[$];return Q===MZ?void 0:Q}return Y$.call(Z,$)?Z[$]:void 0},W1=function($){var Z=this.__data__;return r?Z[$]!==void 0:Y$.call(Z,$)},J1=function($,Z){var Q=this.__data__;return Q[$]=r&&Z===void 0?MZ:Z,this},v=function($){var Z=-1,Q=$?$.length:0;this.clear();while(++Z<Q){var X=$[Z];this.set(X[0],X[1])}},G1=function(){this.__data__=[]},K1=function($){var Z=this.__data__,Q=U$(Z,$);if(Q<0)return!1;var X=Z.length-1;if(Q==X)Z.pop();else Q1.call(Z,Q,1);return!0},R1=function($){var Z=this.__data__,Q=U$(Z,$);return Q<0?void 0:Z[Q][1]},q1=function($){return U$(this.__data__,$)>-1},w1=function($,Z){var Q=this.__data__,X=U$(Q,$);if(X<0)Q.push([$,Z]);else Q[X][1]=Z;return this},f=function($){var Z=-1,Q=$?$.length:0;this.clear();while(++Z<Q){var X=$[Z];this.set(X[0],X[1])}},N1=function(){this.__data__={hash:new x,map:new(X1||v),string:new x}},z1=function($){return B$(this,$).delete($)},L1=function($){return B$(this,$).get($)},H1=function($){return B$(this,$).has($)},F1=function($,Z){return B$(this,$).set($,Z),this},M1=function($,Z,Q){var X=$[Z];if(!(Y$.call($,Z)&&AZ(X,Q))||Q===void 0&&!(Z in $))$[Z]=Q},U$=function($,Z){var Q=$.length;while(Q--)if(AZ($[Q][0],Z))return Q;return-1},D1=function($){if(!X$($)||P1($))return!1;var Z=x1($)||aQ($)?Z1:lQ;return Z.test(C1($))},E1=function($,Z,Q,X){if(!X$($))return $;Z=A1(Z,$)?[Z]:_1(Z);var Y=-1,U=Z.length,B=U-1,W=$;while(W!=null&&++Y<U){var J=T1(Z[Y]),K=Q;if(Y!=B){var G=W[J];if(K=X?X(G,J,W):void 0,K===void 0)K=X$(G)?G:I1(Z[Y+1])?[]:{}}M1(W,J,K),W=W[J]}return $},S1=function($){if(typeof $=="string")return $;if(y$($))return FZ?FZ.call($):"";var Z=$+"";return Z=="0"&&1/$==-DZ?"-0":Z},_1=function($){return OZ($)?$:V1($)},B$=function($,Z){var Q=$.__data__;return O1(Z)?Q[typeof Z=="string"?"string":"hash"]:Q.map},IZ=function($,Z){var Q=tQ($,Z);return D1(Q)?Q:void 0},I1=function($,Z){return Z=Z==null?kQ:Z,!!Z&&(typeof $=="number"||sQ.test($))&&($>-1&&$%1==0&&$<Z)},A1=function($,Z){if(OZ($))return!1;var Q=typeof $;if(Q=="number"||Q=="symbol"||Q=="boolean"||$==null||y$($))return!0;return bQ.test($)||!pQ.test($)||Z!=null&&$ in Object(Z)},O1=function($){var Z=typeof $;return Z=="string"||Z=="number"||Z=="symbol"||Z=="boolean"?$!=="__proto__":$===null},P1=function($){return!!zZ&&zZ in $},T1=function($){if(typeof $=="string"||y$($))return $;var Z=$+"";return Z=="0"&&1/$==-DZ?"-0":Z},C1=function($){if($!=null){try{return SZ.call($)}catch(Z){}try{return $+""}catch(Z){}}return""},h$=function($,Z){if(typeof $!="function"||Z&&typeof Z!="function")throw new TypeError(dQ);var Q=function(){var X=arguments,Y=Z?Z.apply(this,X):X[0],U=Q.cache;if(U.has(Y))return U.get(Y);var B=$.apply(this,X);return Q.cache=U.set(Y,B),B};return Q.cache=new(h$.Cache||f),Q},AZ=function($,Z){return $===Z||$!==$&&Z!==Z},x1=function($){var Z=X$($)?_Z.call($):"";return Z==vQ||Z==hQ},X$=function($){var Z=typeof $;return!!$&&(Z=="object"||Z=="function")},f1=function($){return!!$&&typeof $=="object"},y$=function($){return typeof $=="symbol"||f1($)&&_Z.call($)==yQ},m1=function($){return $==null?"":S1($)},g1=function($,Z,Q){return $==null?$:E1($,Z,Q)},dQ="Expected a function",MZ="__lodash_hash_undefined__",DZ=Infinity,kQ=9007199254740991,vQ="[object Function]",hQ="[object GeneratorFunction]",yQ="[object Symbol]",pQ=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bQ=/^\w*$/,cQ=/^\./,nQ=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,iQ=/[\\^$.*+?()[\]{}|]/g,uQ=/\\(\\)?/g,lQ=/^\[object .+?Constructor\]$/,sQ=/^(?:0|[1-9]\d*)$/,rQ=typeof global=="object"&&global&&global.Object===Object&&global,oQ=typeof self=="object"&&self&&self.Object===Object&&self,v$=rQ||oQ||Function("return this")(),eQ=Array.prototype,$1=Function.prototype,EZ=Object.prototype,k$=v$["__core-js_shared__"],zZ=function(){var $=/[^.]+$/.exec(k$&&k$.keys&&k$.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),SZ=$1.toString,Y$=EZ.hasOwnProperty,_Z=EZ.toString,Z1=RegExp("^"+SZ.call(Y$).replace(iQ,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),LZ=v$.Symbol,Q1=eQ.splice,X1=IZ(v$,"Map"),r=IZ(Object,"create"),HZ=LZ?LZ.prototype:void 0,FZ=HZ?HZ.toString:void 0;x.prototype.clear=Y1;x.prototype.delete=U1;x.prototype.get=B1;x.prototype.has=W1;x.prototype.set=J1;v.prototype.clear=G1;v.prototype.delete=K1;v.prototype.get=R1;v.prototype.has=q1;v.prototype.set=w1;f.prototype.clear=N1;f.prototype.delete=z1;f.prototype.get=L1;f.prototype.has=H1;f.prototype.set=F1;var V1=h$(function($){$=m1($);var Z=[];if(cQ.test($))Z.push("");return $.replace(nQ,function(Q,X,Y,U){Z.push(Y?U.replace(uQ,"$1"):X||Q)}),Z});h$.Cache=f;var OZ=Array.isArray;PZ.exports=g1});var GQ=j$((K$,y)=>{var B6=function($,Z,Q,X){var Y=-1,U=$?$.length:0;while(++Y<U){var B=$[Y];Z(X,B,Q(B),$)}return X},W6=function($,Z){var Q=-1,X=$?$.length:0;while(++Q<X)if(Z($[Q],Q,$))return!0;return!1},J6=function($){return function(Z){return Z==null?void 0:Z[$]}},G6=function($,Z){var Q=-1,X=Array($);while(++Q<$)X[Q]=Z(Q);return X},K6=function($){return function(Z){return $(Z)}},R6=function($,Z){return $==null?void 0:$[Z]},l$=function($){var Z=!1;if($!=null&&typeof $.toString!="function")try{Z=!!($+"")}catch(Q){}return Z},q6=function($){var Z=-1,Q=Array($.size);return $.forEach(function(X,Y){Q[++Z]=[Y,X]}),Q},w6=function($,Z){return function(Q){return $(Z(Q))}},N6=function($){var Z=-1,Q=Array($.size);return $.forEach(function(X){Q[++Z]=X}),Q},m=function($){var Z=-1,Q=$?$.length:0;this.clear();while(++Z<Q){var X=$[Z];this.set(X[0],X[1])}},O6=function(){this.__data__=t?t(null):{}},P6=function($){return this.has($)&&delete this.__data__[$]},V6=function($){var Z=this.__data__;if(t){var Q=Z[$];return Q===a$?void 0:Q}return S.call(Z,$)?Z[$]:void 0},T6=function($){var Z=this.__data__;return t?Z[$]!==void 0:S.call(Z,$)},C6=function($,Z){var Q=this.__data__;return Q[$]=t&&Z===void 0?a$:Z,this},_=function($){var Z=-1,Q=$?$.length:0;this.clear();while(++Z<Q){var X=$[Z];this.set(X[0],X[1])}},x6=function(){this.__data__=[]},f6=function($){var Z=this.__data__,Q=D$(Z,$);if(Q<0)return!1;var X=Z.length-1;if(Q==X)Z.pop();else M6.call(Z,Q,1);return!0},m6=function($){var Z=this.__data__,Q=D$(Z,$);return Q<0?void 0:Z[Q][1]},g6=function($){return D$(this.__data__,$)>-1},j6=function($,Z){var Q=this.__data__,X=D$(Q,$);if(X<0)Q.push([$,Z]);else Q[X][1]=Z;return this},I=function($){var Z=-1,Q=$?$.length:0;this.clear();while(++Z<Q){var X=$[Z];this.set(X[0],X[1])}},d6=function(){this.__data__={hash:new m,map:new(o||_),string:new m}},k6=function($){return E$(this,$).delete($)},v6=function($){return E$(this,$).get($)},h6=function($){return E$(this,$).has($)},y6=function($,Z){return E$(this,$).set($,Z),this},L$=function($){var Z=-1,Q=$?$.length:0;this.__data__=new I;while(++Z<Q)this.add($[Z])},p6=function($){return this.__data__.set($,a$),this},b6=function($){return this.__data__.has($)},E=function($){this.__data__=new _($)},c6=function(){this.__data__=new _},n6=function($){return this.__data__.delete($)},i6=function($){return this.__data__.get($)},u6=function($){return this.__data__.has($)},l6=function($,Z){var Q=this.__data__;if(Q instanceof _){var X=Q.__data__;if(!o||X.length<v1-1)return X.push([$,Z]),this;Q=this.__data__=new I(X)}return Q.set($,Z),this},s6=function($,Z){var Q=P($)||WQ($)?G6($.length,String):[],X=Q.length,Y=!!X;for(var U in $)if((Z||S.call($,U))&&!(Y&&(U=="length"||XQ(U,X))))Q.push(U);return Q},D$=function($,Z){var Q=$.length;while(Q--)if(BQ($[Q][0],Z))return Q;return-1},r6=function($,Z,Q,X){return o6($,function(Y,U,B){Z(X,Y,Q(Y),B)}),X},a6=function($,Z){return $&&t6($,Z,H$)},$Q=function($,Z){Z=S$(Z,$)?[Z]:ZQ(Z);var Q=0,X=Z.length;while($!=null&&Q<X)$=$[_$(Z[Q++])];return Q&&Q==X?$:void 0},e6=function($){return b.call($)},$8=function($,Z){return $!=null&&Z in Object($)},e$=function($,Z,Q,X,Y){if($===Z)return!0;if($==null||Z==null||!I$($)&&!A$(Z))return $!==$&&Z!==Z;return Z8($,Z,e$,Q,X,Y)},Z8=function($,Z,Q,X,Y,U){var B=P($),W=P(Z),J=i$,K=i$;if(!B)J=O($),J=J==R$?h:J;if(!W)K=O(Z),K=K==R$?h:K;var G=J==h&&!l$($),w=K==h&&!l$(Z),q=J==K;if(q&&!G)return U||(U=new E),B||I8($)?QQ($,Z,Q,X,Y,U):N8($,Z,J,Q,X,Y,U);if(!(Y&p)){var R=G&&S.call($,"__wrapped__"),F=w&&S.call(Z,"__wrapped__");if(R||F){var A=R?$.value():$,D=F?Z.value():Z;return U||(U=new E),Q(A,D,X,Y,U)}}if(!q)return!1;return U||(U=new E),z8($,Z,Q,X,Y,U)},Q8=function($,Z,Q,X){var Y=Q.length,U=Y,B=!X;if($==null)return!U;$=Object($);while(Y--){var W=Q[Y];if(B&&W[2]?W[1]!==$[W[0]]:!(W[0]in $))return!1}while(++Y<U){W=Q[Y];var J=W[0],K=$[J],G=W[1];if(B&&W[2]){if(K===void 0&&!(J in $))return!1}else{var w=new E;if(X)var q=X(K,G,J,$,Z,w);if(!(q===void 0?e$(G,K,X,F$|p,w):q))return!1}}return!0},X8=function($){if(!I$($)||M8($))return!1;var Z=JQ($)||l$($)?H6:Q6;return Z.test(g($))},Y8=function($){return A$($)&&QZ($.length)&&!!N[b.call($)]},U8=function($){if(typeof $=="function")return $;if($==null)return V8;if(typeof $=="object")return P($)?J8($[0],$[1]):W8($);return T8($)},B8=function($){if(!D8($))return D6($);var Z=[];for(var Q in Object($))if(S.call($,Q)&&Q!="constructor")Z.push(Q);return Z},W8=function($){var Z=L8($);if(Z.length==1&&Z[0][2])return UQ(Z[0][0],Z[0][1]);return function(Q){return Q===$||Q8(Q,$,Z)}},J8=function($,Z){if(S$($)&&YQ(Z))return UQ(_$($),Z);return function(Q){var X=O8(Q,$);return X===void 0&&X===Z?P8(Q,$):e$(Z,X,void 0,F$|p)}},G8=function($){return function(Z){return $Q(Z,$)}},K8=function($){if(typeof $=="string")return $;if(XZ($))return hZ?hZ.call($):"";var Z=$+"";return Z=="0"&&1/$==-yZ?"-0":Z},ZQ=function($){return P($)?$:E8($)},R8=function($,Z){return function(Q,X){var Y=P(Q)?B6:r6,U=Z?Z():{};return Y(Q,$,U8(X,2),U)}},q8=function($,Z){return function(Q,X){if(Q==null)return Q;if(!ZZ(Q))return $(Q,X);var Y=Q.length,U=Z?Y:-1,B=Object(Q);while(Z?U--:++U<Y)if(X(B[U],U,B)===!1)break;return Q}},w8=function($){return function(Z,Q,X){var Y=-1,U=Object(Z),B=X(Z),W=B.length;while(W--){var J=B[$?W:++Y];if(Q(U[J],J,U)===!1)break}return Z}},QQ=function($,Z,Q,X,Y,U){var B=Y&p,W=$.length,J=Z.length;if(W!=J&&!(B&&J>W))return!1;var K=U.get($);if(K&&U.get(Z))return K==Z;var G=-1,w=!0,q=Y&F$?new L$:void 0;U.set($,Z),U.set(Z,$);while(++G<W){var R=$[G],F=Z[G];if(X)var A=B?X(F,R,G,Z,$,U):X(R,F,G,$,Z,U);if(A!==void 0){if(A)continue;w=!1;break}if(q){if(!W6(Z,function(D,C){if(!q.has(C)&&(R===D||Q(R,D,X,Y,U)))return q.add(C)})){w=!1;break}}else if(!(R===F||Q(R,F,X,Y,U))){w=!1;break}}return U.delete($),U.delete(Z),w},N8=function($,Z,Q,X,Y,U,B){switch(Q){case N$:if($.byteLength!=Z.byteLength||$.byteOffset!=Z.byteOffset)return!1;$=$.buffer,Z=Z.buffer;case oZ:if($.byteLength!=Z.byteLength||!X(new vZ($),new vZ(Z)))return!1;return!0;case bZ:case cZ:case uZ:return BQ(+$,+Z);case nZ:return $.name==Z.name&&$.message==Z.message;case lZ:case sZ:return $==Z+"";case q$:var W=q6;case w$:var J=U&p;if(W||(W=N6),$.size!=Z.size&&!J)return!1;var K=B.get($);if(K)return K==Z;U|=F$,B.set($,Z);var G=QQ(W($),W(Z),X,Y,U,B);return B.delete($),G;case rZ:if(n$)return n$.call($)==n$.call(Z)}return!1},z8=function($,Z,Q,X,Y,U){var B=Y&p,W=H$($),J=W.length,K=H$(Z),G=K.length;if(J!=G&&!B)return!1;var w=J;while(w--){var q=W[w];if(!(B?q in Z:S.call(Z,q)))return!1}var R=U.get($);if(R&&U.get(Z))return R==Z;var F=!0;U.set($,Z),U.set(Z,$);var A=B;while(++w<J){q=W[w];var D=$[q],C=Z[q];if(X)var NZ=B?X(C,D,q,Z,$,U):X(D,C,q,$,Z,U);if(!(NZ===void 0?D===C||Q(D,C,X,Y,U):NZ)){F=!1;break}A||(A=q=="constructor")}if(F&&!A){var Z$=$.constructor,Q$=Z.constructor;if(Z$!=Q$&&(("constructor"in $)&&("constructor"in Z))&&!(typeof Z$=="function"&&Z$ instanceof Z$&&typeof Q$=="function"&&Q$ instanceof Q$))F=!1}return U.delete($),U.delete(Z),F},E$=function($,Z){var Q=$.__data__;return F8(Z)?Q[typeof Z=="string"?"string":"hash"]:Q.map},L8=function($){var Z=H$($),Q=Z.length;while(Q--){var X=Z[Q],Y=$[X];Z[Q]=[X,Y,YQ(Y)]}return Z},c=function($,Z){var Q=R6($,Z);return X8(Q)?Q:void 0},H8=function($,Z,Q){Z=S$(Z,$)?[Z]:ZQ(Z);var X,Y=-1,B=Z.length;while(++Y<B){var U=_$(Z[Y]);if(!(X=$!=null&&Q($,U)))break;$=$[U]}if(X)return X;var B=$?$.length:0;return!!B&&QZ(B)&&XQ(U,B)&&(P($)||WQ($))},XQ=function($,Z){return Z=Z==null?pZ:Z,!!Z&&(typeof $=="number"||X6.test($))&&($>-1&&$%1==0&&$<Z)},S$=function($,Z){if(P($))return!1;var Q=typeof $;if(Q=="number"||Q=="symbol"||Q=="boolean"||$==null||XZ($))return!0;return t1.test($)||!o1.test($)||Z!=null&&$ in Object(Z)},F8=function($){var Z=typeof $;return Z=="string"||Z=="number"||Z=="symbol"||Z=="boolean"?$!=="__proto__":$===null},M8=function($){return!!dZ&&dZ in $},D8=function($){var Z=$&&$.constructor,Q=typeof Z=="function"&&Z.prototype||M$;return $===Q},YQ=function($){return $===$&&!I$($)},UQ=function($,Z){return function(Q){if(Q==null)return!1;return Q[$]===Z&&(Z!==void 0||($ in Object(Q)))}},_$=function($){if(typeof $=="string"||XZ($))return $;var Z=$+"";return Z=="0"&&1/$==-yZ?"-0":Z},g=function($){if($!=null){try{return eZ.call($)}catch(Z){}try{return $+""}catch(Z){}}return""},$Z=function($,Z){if(typeof $!="function"||Z&&typeof Z!="function")throw new TypeError(h1);var Q=function(){var X=arguments,Y=Z?Z.apply(this,X):X[0],U=Q.cache;if(U.has(Y))return U.get(Y);var B=$.apply(this,X);return Q.cache=U.set(Y,B),B};return Q.cache=new($Z.Cache||I),Q},BQ=function($,Z){return $===Z||$!==$&&Z!==Z},WQ=function($){return _8($)&&S.call($,"callee")&&(!F6.call($,"callee")||b.call($)==R$)},ZZ=function($){return $!=null&&QZ($.length)&&!JQ($)},_8=function($){return A$($)&&ZZ($)},JQ=function($){var Z=I$($)?b.call($):"";return Z==iZ||Z==y1},QZ=function($){return typeof $=="number"&&$>-1&&$%1==0&&$<=pZ},I$=function($){var Z=typeof $;return!!$&&(Z=="object"||Z=="function")},A$=function($){return!!$&&typeof $=="object"},XZ=function($){return typeof $=="symbol"||A$($)&&b.call($)==rZ},A8=function($){return $==null?"":K8($)},O8=function($,Z,Q){var X=$==null?void 0:$Q($,Z);return X===void 0?Q:X},P8=function($,Z){return $!=null&&H8($,Z,$8)},H$=function($){return ZZ($)?s6($):B8($)},V8=function($){return $},T8=function($){return S$($)?J6(_$($)):G8($)},v1=200,h1="Expected a function",a$="__lodash_hash_undefined__",F$=1,p=2,yZ=Infinity,pZ=9007199254740991,R$="[object Arguments]",i$="[object Array]",bZ="[object Boolean]",cZ="[object Date]",nZ="[object Error]",iZ="[object Function]",y1="[object GeneratorFunction]",q$="[object Map]",uZ="[object Number]",h="[object Object]",xZ="[object Promise]",lZ="[object RegExp]",w$="[object Set]",sZ="[object String]",rZ="[object Symbol]",u$="[object WeakMap]",oZ="[object ArrayBuffer]",N$="[object DataView]",p1="[object Float32Array]",b1="[object Float64Array]",c1="[object Int8Array]",n1="[object Int16Array]",i1="[object Int32Array]",u1="[object Uint8Array]",l1="[object Uint8ClampedArray]",s1="[object Uint16Array]",r1="[object Uint32Array]",o1=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,t1=/^\w*$/,a1=/^\./,e1=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$6=/[\\^$.*+?()[\]{}|]/g,Z6=/\\(\\)?/g,Q6=/^\[object .+?Constructor\]$/,X6=/^(?:0|[1-9]\d*)$/,N={};N[p1]=N[b1]=N[c1]=N[n1]=N[i1]=N[u1]=N[l1]=N[s1]=N[r1]=!0;N[R$]=N[i$]=N[oZ]=N[bZ]=N[N$]=N[cZ]=N[nZ]=N[iZ]=N[q$]=N[uZ]=N[h]=N[lZ]=N[w$]=N[sZ]=N[u$]=!1;var tZ=typeof global=="object"&&global&&global.Object===Object&&global,Y6=typeof self=="object"&&self&&self.Object===Object&&self,V=tZ||Y6||Function("return this")(),aZ=typeof K$=="object"&&K$&&!K$.nodeType&&K$,fZ=aZ&&typeof y=="object"&&y&&!y.nodeType&&y,U6=fZ&&fZ.exports===aZ,mZ=U6&&tZ.process,gZ=function(){try{return mZ&&mZ.binding("util")}catch($){}}(),jZ=gZ&&gZ.isTypedArray,z6=Array.prototype,L6=Function.prototype,M$=Object.prototype,c$=V["__core-js_shared__"],dZ=function(){var $=/[^.]+$/.exec(c$&&c$.keys&&c$.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),eZ=L6.toString,S=M$.hasOwnProperty,b=M$.toString,H6=RegExp("^"+eZ.call(S).replace($6,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),kZ=V.Symbol,vZ=V.Uint8Array,F6=M$.propertyIsEnumerable,M6=z6.splice,D6=w6(Object.keys,Object),s$=c(V,"DataView"),o=c(V,"Map"),r$=c(V,"Promise"),o$=c(V,"Set"),t$=c(V,"WeakMap"),t=c(Object,"create"),E6=g(s$),S6=g(o),_6=g(r$),I6=g(o$),A6=g(t$),z$=kZ?kZ.prototype:void 0,n$=z$?z$.valueOf:void 0,hZ=z$?z$.toString:void 0;m.prototype.clear=O6;m.prototype.delete=P6;m.prototype.get=V6;m.prototype.has=T6;m.prototype.set=C6;_.prototype.clear=x6;_.prototype.delete=f6;_.prototype.get=m6;_.prototype.has=g6;_.prototype.set=j6;I.prototype.clear=d6;I.prototype.delete=k6;I.prototype.get=v6;I.prototype.has=h6;I.prototype.set=y6;L$.prototype.add=L$.prototype.push=p6;L$.prototype.has=b6;E.prototype.clear=c6;E.prototype.delete=n6;E.prototype.get=i6;E.prototype.has=u6;E.prototype.set=l6;var o6=q8(a6),t6=w8(),O=e6;if(s$&&O(new s$(new ArrayBuffer(1)))!=N$||o&&O(new o)!=q$||r$&&O(r$.resolve())!=xZ||o$&&O(new o$)!=w$||t$&&O(new t$)!=u$)O=function($){var Z=b.call($),Q=Z==h?$.constructor:void 0,X=Q?g(Q):void 0;if(X)switch(X){case E6:return N$;case S6:return q$;case _6:return xZ;case I6:return w$;case A6:return u$}return Z};var E8=$Z(function($){$=A8($);var Z=[];if(a1.test($))Z.push("");return $.replace(e1,function(Q,X,Y,U){Z.push(Y?U.replace(Z6,"$1"):X||Q)}),Z}),S8=R8(function($,Z,Q){$[Q]=Z});$Z.Cache=I;var P=Array.isArray,I8=jZ?K6(jZ):Y8;y.exports=S8});var CQ=j$((J7,TQ)=>{var $5=function($,Z){return $==null?void 0:$[Z]},Z5=function($){var Z=!1;if($!=null&&typeof $.toString!="function")try{Z=!!($+"")}catch(Q){}return Z},d=function($){var Z=-1,Q=$?$.length:0;this.clear();while(++Z<Q){var X=$[Z];this.set(X[0],X[1])}},W5=function(){this.__data__=$$?$$(null):{}},J5=function($){return this.has($)&&delete this.__data__[$]},G5=function($){var Z=this.__data__;if($$){var Q=Z[$];return Q===EQ?void 0:Q}return RZ.call(Z,$)?Z[$]:void 0},K5=function($){var Z=this.__data__;return $$?Z[$]!==void 0:RZ.call(Z,$)},R5=function($,Z){var Q=this.__data__;return Q[$]=$$&&Z===void 0?EQ:Z,this},s=function($){var Z=-1,Q=$?$.length:0;this.clear();while(++Z<Q){var X=$[Z];this.set(X[0],X[1])}},q5=function(){this.__data__=[]},w5=function($){var Z=this.__data__,Q=x$(Z,$);if(Q<0)return!1;var X=Z.length-1;if(Q==X)Z.pop();else U5.call(Z,Q,1);return!0},N5=function($){var Z=this.__data__,Q=x$(Z,$);return Q<0?void 0:Z[Q][1]},z5=function($){return x$(this.__data__,$)>-1},L5=function($,Z){var Q=this.__data__,X=x$(Q,$);if(X<0)Q.push([$,Z]);else Q[X][1]=Z;return this},k=function($){var Z=-1,Q=$?$.length:0;this.clear();while(++Z<Q){var X=$[Z];this.set(X[0],X[1])}},H5=function(){this.__data__={hash:new d,map:new(B5||s),string:new d}},F5=function($){return f$(this,$).delete($)},M5=function($){return f$(this,$).get($)},D5=function($){return f$(this,$).has($)},E5=function($,Z){return f$(this,$).set($,Z),this},x$=function($,Z){var Q=$.length;while(Q--)if(f5($[Q][0],Z))return Q;return-1},S5=function($,Z){Z=O5(Z,$)?[Z]:A5(Z);var Q=0,X=Z.length;while($!=null&&Q<X)$=$[C5(Z[Q++])];return Q&&Q==X?$:void 0},_5=function($){if(!VQ($)||V5($))return!1;var Z=m5($)||Z5($)?Y5:t8;return Z.test(x5($))},I5=function($){if(typeof $=="string")return $;if(wZ($))return DQ?DQ.call($):"";var Z=$+"";return Z=="0"&&1/$==-SQ?"-0":Z},A5=function($){return PQ($)?$:T5($)},f$=function($,Z){var Q=$.__data__;return P5(Z)?Q[typeof Z=="string"?"string":"hash"]:Q.map},OQ=function($,Z){var Q=$5($,Z);return _5(Q)?Q:void 0},O5=function($,Z){if(PQ($))return!1;var Q=typeof $;if(Q=="number"||Q=="symbol"||Q=="boolean"||$==null||wZ($))return!0;return u8.test($)||!i8.test($)||Z!=null&&$ in Object(Z)},P5=function($){var Z=typeof $;return Z=="string"||Z=="number"||Z=="symbol"||Z=="boolean"?$!=="__proto__":$===null},V5=function($){return!!HQ&&HQ in $},C5=function($){if(typeof $=="string"||wZ($))return $;var Z=$+"";return Z=="0"&&1/$==-SQ?"-0":Z},x5=function($){if($!=null){try{return IQ.call($)}catch(Z){}try{return $+""}catch(Z){}}return""},qZ=function($,Z){if(typeof $!="function"||Z&&typeof Z!="function")throw new TypeError(p8);var Q=function(){var X=arguments,Y=Z?Z.apply(this,X):X[0],U=Q.cache;if(U.has(Y))return U.get(Y);var B=$.apply(this,X);return Q.cache=U.set(Y,B),B};return Q.cache=new(qZ.Cache||k),Q},f5=function($,Z){return $===Z||$!==$&&Z!==Z},m5=function($){var Z=VQ($)?AQ.call($):"";return Z==b8||Z==c8},VQ=function($){var Z=typeof $;return!!$&&(Z=="object"||Z=="function")},g5=function($){return!!$&&typeof $=="object"},wZ=function($){return typeof $=="symbol"||g5($)&&AQ.call($)==n8},j5=function($){return $==null?"":I5($)},d5=function($,Z,Q){var X=$==null?void 0:S5($,Z);return X===void 0?Q:X},p8="Expected a function",EQ="__lodash_hash_undefined__",SQ=Infinity,b8="[object Function]",c8="[object GeneratorFunction]",n8="[object Symbol]",i8=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u8=/^\w*$/,l8=/^\./,s8=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r8=/[\\^$.*+?()[\]{}|]/g,o8=/\\(\\)?/g,t8=/^\[object .+?Constructor\]$/,a8=typeof global=="object"&&global&&global.Object===Object&&global,e8=typeof self=="object"&&self&&self.Object===Object&&self,KZ=a8||e8||Function("return this")(),Q5=Array.prototype,X5=Function.prototype,_Q=Object.prototype,GZ=KZ["__core-js_shared__"],HQ=function(){var $=/[^.]+$/.exec(GZ&&GZ.keys&&GZ.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),IQ=X5.toString,RZ=_Q.hasOwnProperty,AQ=_Q.toString,Y5=RegExp("^"+IQ.call(RZ).replace(r8,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),FQ=KZ.Symbol,U5=Q5.splice,B5=OQ(KZ,"Map"),$$=OQ(Object,"create"),MQ=FQ?FQ.prototype:void 0,DQ=MQ?MQ.toString:void 0;d.prototype.clear=W5;d.prototype.delete=J5;d.prototype.get=G5;d.prototype.has=K5;d.prototype.set=R5;s.prototype.clear=q5;s.prototype.delete=w5;s.prototype.get=N5;s.prototype.has=z5;s.prototype.set=L5;k.prototype.clear=H5;k.prototype.delete=F5;k.prototype.get=M5;k.prototype.has=D5;k.prototype.set=E5;var T5=qZ(function($){$=j5($);var Z=[];if(l8.test($))Z.push("");return $.replace(s8,function(Q,X,Y,U){Z.push(Y?U.replace(o8,"$1"):X||Q)}),Z});qZ.Cache=k;var PQ=Array.isArray;TQ.exports=d5});var TZ=g$(VZ(),1),W$={isNamespace:($)=>$&&!$.type,flattenSchema($,Z){return Object.entries($).reduce((Q,[X,Y])=>{const U=Z?`${Z}.${X}`:X;if(W$.isNamespace(Y))Q={...Q,...W$.flattenSchema(Y,U)};else Object.assign(Y,{name:U}),Q[U]=Y;return Q},{})},wrapSchema($){return Object.values($).reduce((Z,Q)=>{return TZ.default(Z,Q.path,Q),Z},{})}};var J$,j1=new Uint8Array(16);function p$(){if(!J$){if(J$=typeof crypto!=="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!J$)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}return J$(j1)}function CZ($,Z=0){return H[$[Z+0]]+H[$[Z+1]]+H[$[Z+2]]+H[$[Z+3]]+"-"+H[$[Z+4]]+H[$[Z+5]]+"-"+H[$[Z+6]]+H[$[Z+7]]+"-"+H[$[Z+8]]+H[$[Z+9]]+"-"+H[$[Z+10]]+H[$[Z+11]]+H[$[Z+12]]+H[$[Z+13]]+H[$[Z+14]]+H[$[Z+15]]}var H=[];for(let $=0;$<256;++$)H.push(($+256).toString(16).slice(1));var d1=typeof crypto!=="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),b$={randomUUID:d1};var k1=function($,Z,Q){if(b$.randomUUID&&!Z&&!$)return b$.randomUUID();$=$||{};const X=$.random||($.rng||p$)();if(X[6]=X[6]&15|64,X[8]=X[8]&63|128,Z){Q=Q||0;for(let Y=0;Y<16;++Y)Z[Q+Y]=X[Y];return Z}return CZ(X)},G$=k1;var LQ=g$(GQ(),1);var zQ={};d$(zQ,{validator:()=>{{return e}},validate:()=>{{return YZ}},unobserve:()=>{{return qQ}},unescapePathComponent:()=>{{return n}},observe:()=>{{return wQ}},getValueByPointer:()=>{{return a}},generate:()=>{{return C$}},escapePathComponent:()=>{{return M}},default:()=>{{return h8}},deepClone:()=>{{return L}},compare:()=>{{return NQ}},applyReducer:()=>{{return RQ}},applyPatch:()=>{{return j}},applyOperation:()=>{{return T}},_areEquals:()=>{{return l}},JsonPatchError:()=>{{return i}}});var UZ={};d$(UZ,{validator:()=>{{return e}},validate:()=>{{return YZ}},getValueByPointer:()=>{{return a}},deepClone:()=>{{return f8}},applyReducer:()=>{{return RQ}},applyPatch:()=>{{return j}},applyOperation:()=>{{return T}},_areEquals:()=>{{return l}},JsonPatchError:()=>{{return z}}});function P$($,Z){return x8.call($,Z)}function V$($){if(Array.isArray($)){var Z=new Array($.length);for(var Q=0;Q<Z.length;Q++)Z[Q]=""+Q;return Z}if(Object.keys)return Object.keys($);var X=[];for(var Y in $)if(P$($,Y))X.push(Y);return X}function L($){switch(typeof $){case"object":return JSON.parse(JSON.stringify($));case"undefined":return null;default:return $}}function T$($){var Z=0,Q=$.length,X;while(Z<Q){if(X=$.charCodeAt(Z),X>=48&&X<=57){Z++;continue}return!1}return!0}function M($){if($.indexOf("/")===-1&&$.indexOf("~")===-1)return $;return $.replace(/~/g,"~0").replace(/\//g,"~1")}function n($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}function O$($){if($===void 0)return!0;if($){if(Array.isArray($)){for(var Z=0,Q=$.length;Z<Q;Z++)if(O$($[Z]))return!0}else if(typeof $==="object"){var X=V$($),Y=X.length;for(var U=0;U<Y;U++)if(O$($[X[U]]))return!0}}return!1}var KQ=function($,Z){var Q=[$];for(var X in Z){var Y=typeof Z[X]==="object"?JSON.stringify(Z[X],null,2):Z[X];if(typeof Y!=="undefined")Q.push(X+": "+Y)}return Q.join("\n")};/*! | ||
* MIT license | ||
*/var BZ=new WeakMap,g8=function(){function $(Z){this.observers=new Map,this.obj=Z}return $}(),j8=function(){function $(Z,Q){this.callback=Z,this.observer=Q}return $}();var h8=Object.assign({},UZ,JZ,{JsonPatchError:i,deepClone:L,escapePathComponent:M,unescapePathComponent:n});class y8{schemas;falttenSchema;uidSchemas;static Var($){return $.patch=Object.assign({},{allowCreate:!0,allowDelete:!0,allowUpdate:!0,autoPatch:!0,onPatch:async(Z)=>{Z.forEach(async(X)=>{if(X.op=="add"&&X.path=="/-")$.patch?.onCreate&&await $.patch.onCreate(X.value);if(X.op=="replace")$.patch?.onUpdate&&await $.patch.onUpdate(X.path.replace("/",""),X.value);if(X.op=="remove")$.patch?.onDelete&&await $.patch.onDelete(X.path.replace("/",""))});const Q=await $.get();if($.patch?.autoPatch)return j(Q,Z).newDocument;return Q}},$.patch||{}),{...$,type:"var",uid:G$()}}static Func($){return{...$,type:"func",uid:G$()}}constructor($={}){Object.assign(this,$),this.falttenSchema=W$.flattenSchema(this.schemas),this.uidSchemas=LQ.default(Object.values(this.falttenSchema),"uid")}async loadFull(){return Promise.all(Object.entries(this.falttenSchema).map(async([$,Z])=>{if(Z.type=="func"){const{uid:Q,type:X,input:Y,name:U,uiConfig:B}=Z;return{uid:Q,type:X,name:U,input:Y,uiConfig:B?B():null}}if(Z.type=="var"){const{uid:Q,type:X,get:Y,set:U,name:B,patch:W}=Z,J=await Y(),K=Z.schema?Z.schema(J):null;let G=[],w={};if(K)Z._schema=K,Object.entries(K).forEach(([q,R])=>{if(!R)return;if(R.type=="action")G.push(q);if(R.uiConfig)w[q]=R.uiConfig});return{uid:Q,type:X,name:B,value:J,actions:G,uiConfig:w,set:!!U,patch:W}}return{type:"unknown",name:$}}))}async loadVars(){return Promise.all(Object.entries(this.falttenSchema).filter(([$,Z])=>Z.type=="var").map(async([$,Z])=>{const{get:Q,name:X}=Z,Y=await Q();return{name:X,value:Y}}))}}var xQ=g$(CQ(),1),G7=($)=>{return{schema:{async loadFull(){return fetch(`${$.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"schema.loadFull"})}).then((Z)=>Z.json())},async loadVars(){return fetch(`${$.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"schema.loadVars"})}).then((Z)=>Z.json())}},func:{async call(Z){return fetch(`${$.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"func.call",params:Z})}).then((Q)=>Q.json())}},var:{async set(Z){return fetch(`${$.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"var.set",params:Z})}).then((Q)=>Q.json())},async patch(Z){return fetch(`${$.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"var.patch",params:Z})}).then((Q)=>Q.json())},async action(Z){return fetch(`${$.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"var.action",params:Z})}).then((Q)=>Q.json())}}}},K7=({urpc:$})=>{const Z={urpc:$,handle({name:Q,params:X}){const Y=xQ.default(Z,Q);if(!Y)throw new Error("invalid name");return Y(X)},schema:{async loadFull(){return $.loadFull()},async loadVars(){return $.loadVars()}},func:{async call(Q){const X=$.uidSchemas[Q.method]||$.falttenSchema[Q.method];if(!X)throw new Error("invalid func name");return X.func({input:Q.input})}},var:{async set(Q){const X=$.uidSchemas[Q.name]||$.falttenSchema[Q.name];if(!X)throw new Error("invalid var name");if(!X.set)throw new Error("variable can't be set");return X.set(Q.value)},async patch(Q){const X=$.uidSchemas[Q.name]||$.falttenSchema[Q.name];if(!X)throw new Error("invalid var name");if(!X.patch)throw new Error("variable can't be set");return await X.patch?.onPatch(Q.ops)},async action(Q){const X=$.uidSchemas[Q.name]||$.falttenSchema[Q.name];if(!X)throw new Error("invalid var name");const Y=X._schema[Q.action];if(!Y)throw new Error("invalid action name");if(Y.type!=="action")throw new Error("invalid action");return Y.call(value)}}};return Z};export{W$ as utils,zQ as jsonPatch,G7 as createSimpleHttpClient,K7 as createServerClient,y8 as URPC}; | ||
*/var BZ=new WeakMap,g8=function(){function $(Z){this.observers=new Map,this.obj=Z}return $}(),j8=function(){function $(Z,Q){this.callback=Z,this.observer=Q}return $}();var h8=Object.assign({},UZ,JZ,{JsonPatchError:i,deepClone:L,escapePathComponent:M,unescapePathComponent:n});class y8{schemas;falttenSchema;uidSchemas;static Var($){return $.patch=Object.assign({},{allowCreate:!0,allowDelete:!0,allowUpdate:!0,autoPatch:!0,onPatch:async(Z)=>{Z.forEach(async(X)=>{if(X.op=="add"&&X.path=="/-")$.patch?.onCreate&&await $.patch.onCreate(X.value);if(X.op=="replace")$.patch?.onUpdate&&await $.patch.onUpdate(X.path.replace("/",""),X.value);if(X.op=="remove")$.patch?.onDelete&&await $.patch.onDelete(X.path.replace("/",""))});const Q=await $.get();if($.patch?.autoPatch)return j(Q,Z).newDocument;return Q}},$.patch||{}),{...$,type:"var",uid:G$()}}static Func($){return{...$,type:"func",uid:G$()}}constructor($={}){Object.assign(this,$),this.falttenSchema=W$.flattenSchema(this.schemas),this.uidSchemas=LQ.default(Object.values(this.falttenSchema),"uid")}async loadFull(){return Promise.all(Object.entries(this.falttenSchema).map(async([$,Z])=>{if(Z.type=="func"){const{uid:Q,type:X,input:Y,name:U,uiConfig:B}=Z;return{uid:Q,type:X,name:U,input:Y,uiConfig:B?B():null}}if(Z.type=="var"){const{uid:Q,type:X,get:Y,set:U,name:B,patch:W}=Z,J=await Y(),K=Z.schema?Z.schema(J):null;let G=[],w={};if(K)Z._schema=K,Object.entries(K).forEach(([q,R])=>{if(!R)return;if(R.type=="action")G.push(q);if(R.uiConfig)w[q]=R.uiConfig});return{uid:Q,type:X,name:B,value:J,actions:G,uiConfig:w,set:!!U,patch:W}}return{type:"unknown",name:$}}))}async loadVars(){return Promise.all(Object.entries(this.falttenSchema).filter(([$,Z])=>Z.type=="var").map(async([$,Z])=>{const{get:Q,name:X}=Z,Y=await Q();return{name:X,value:Y}}))}}var xQ=g$(CQ(),1),G7=($)=>{return{schema:{async loadFull(){return fetch(`${$.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"schema.loadFull"})}).then((Z)=>Z.json())},async loadVars(){return fetch(`${$.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"schema.loadVars"})}).then((Z)=>Z.json())}},func:{async call(Z){return fetch(`${$.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"func.call",params:Z})}).then((Q)=>Q.json())}},var:{async set(Z){return fetch(`${$.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"var.set",params:Z})}).then((Q)=>Q.json())},async patch(Z){return fetch(`${$.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"var.patch",params:Z})}).then((Q)=>Q.json())},async action(Z){return fetch(`${$.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"var.action",params:Z})}).then((Q)=>Q.json())}}}},K7=({urpc:$})=>{const Z={urpc:$,handle({name:Q,params:X}){const Y=xQ.default(Z,Q);if(!Y)throw new Error("invalid name");return Y(X)},schema:{async loadFull(){return $.loadFull()},async loadVars(){return $.loadVars()}},func:{async call(Q){const X=$.uidSchemas[Q.method]||$.falttenSchema[Q.method];if(!X)throw new Error("invalid func name");return X.func({input:Q.input})}},var:{async set(Q){const X=$.uidSchemas[Q.name]||$.falttenSchema[Q.name];if(!X)throw new Error("invalid var name");if(!X.set)throw new Error("variable can't be set");return X.set(Q.value)},async patch(Q){const X=$.uidSchemas[Q.name]||$.falttenSchema[Q.name];if(!X)throw new Error("invalid var name");if(!X.patch)throw new Error("variable can't be set");return await X.patch?.onPatch(Q.ops)},async action(Q){const X=$.uidSchemas[Q.name]||$.falttenSchema[Q.name];if(!X)throw new Error("invalid var name");const Y=X._schema[Q.action];if(!Y)throw new Error("invalid action name");if(Y.type!=="action")throw new Error("invalid action");return Y.call(Q.value)}}};return Z};export{W$ as utils,zQ as jsonPatch,G7 as createSimpleHttpClient,K7 as createServerClient,y8 as URPC}; |
{ | ||
"name": "@dappworks/urpc", | ||
"version": "0.0.29", | ||
"version": "0.0.30", | ||
"module": "index.ts", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47480
385