@apia/api 0.0.7 → 0.0.9-alpha.0
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/README.md +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +43 -4
- package/package.json +11 -12
- package/dist/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Los archivos **tsconfig.json** y **tsup.config.ts** no son archivos únicos sino
|
|
|
19
19
|
|
|
20
20
|
Luego de ejecutar estos pasos, el package estaría listo para comenzar a usarse.
|
|
21
21
|
|
|
22
|
-
Este package trae como dependencias por defecto theme-ui y react. Si se desea agregar más dependencias se debe ejecutar el comando ```lerna add --scope="@apia/packageName" dependencyName```. Ejemplo, si creamos un paquete con el nombre @apia/myPackage y queremos agregar lodash
|
|
22
|
+
Este package trae como dependencias por defecto theme-ui y react. Si se desea agregar más dependencias se debe ejecutar el comando ```lerna add --scope="@apia/packageName" dependencyName```. Ejemplo, si creamos un paquete con el nombre @apia/myPackage y queremos agregar lodash como dependencia, ejecutamos el comando ```lerna add --scope="@apia/myPackage" lodash```.
|
|
23
23
|
|
|
24
24
|
**Importante 1**: Dado que estamos desarrollando packages, es importante determinar si las dependencias que vamos a agregar son de tipo dependency o de tipo peerDependency.
|
|
25
25
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { TApiaLoad, TModify } from '@apia/util';
|
|
1
|
+
import { TApiaLoad, TModify, TNotificationMessage } from '@apia/util';
|
|
2
2
|
import { AxiosResponse, AxiosRequestConfig } from 'axios';
|
|
3
3
|
import QueryString from 'qs';
|
|
4
|
-
import { notify, TNotificationMessage } from '@apia/notifications';
|
|
5
4
|
import * as React from 'react';
|
|
5
|
+
import { notify } from '@apia/notifications';
|
|
6
6
|
|
|
7
7
|
type TApiaApiMethodHandler = {
|
|
8
8
|
alert: typeof notify;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,43 @@
|
|
|
1
|
-
"use strict";var ln=Object.create;var ge=Object.defineProperty,fn=Object.defineProperties,un=Object.getOwnPropertyDescriptor,cn=Object.getOwnPropertyDescriptors,pn=Object.getOwnPropertyNames,xe=Object.getOwnPropertySymbols,yn=Object.getPrototypeOf,We=Object.prototype.hasOwnProperty,bt=Object.prototype.propertyIsEnumerable;var Tt=(t,e,r)=>e in t?ge(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,S=(t,e)=>{for(var r in e||(e={}))We.call(e,r)&&Tt(t,r,e[r]);if(xe)for(var r of xe(e))bt.call(e,r)&&Tt(t,r,e[r]);return t},D=(t,e)=>fn(t,cn(e));var me=(t,e)=>{var r={};for(var n in t)We.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&xe)for(var n of xe(t))e.indexOf(n)<0&&bt.call(t,n)&&(r[n]=t[n]);return r};var R=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),dn=(t,e)=>{for(var r in e)ge(t,r,{get:e[r],enumerable:!0})},xt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of pn(e))!We.call(t,a)&&a!==r&&ge(t,a,{get:()=>e[a],enumerable:!(n=un(e,a))||n.enumerable});return t};var ve=(t,e,r)=>(r=t!=null?ln(yn(t)):{},xt(e||!t||!t.__esModule?ge(r,"default",{value:t,enumerable:!0}):r,t)),gn=t=>xt(ge({},"__esModule",{value:!0}),t);var N=(t,e,r)=>new Promise((n,a)=>{var o=l=>{try{i(r.next(l))}catch(f){a(f)}},s=l=>{try{i(r.throw(l))}catch(f){a(f)}},i=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,s);i((r=r.apply(t,e)).next())});var Et=R((Oa,Rt)=>{"use strict";Rt.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;e[r]=a;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,r);if(s.value!==a||s.enumerable!==!0)return!1}return!0}});var Ct=R((Pa,Pt)=>{"use strict";var Ot=typeof Symbol!="undefined"&&Symbol,mn=Et();Pt.exports=function(){return typeof Ot!="function"||typeof Symbol!="function"||typeof Ot("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:mn()}});var It=R((Ca,Mt)=>{"use strict";var vn="Function.prototype.bind called on incompatible ",_e=Array.prototype.slice,hn=Object.prototype.toString,An="[object Function]";Mt.exports=function(e){var r=this;if(typeof r!="function"||hn.call(r)!==An)throw new TypeError(vn+r);for(var n=_e.call(arguments,1),a,o=function(){if(this instanceof a){var c=r.apply(this,n.concat(_e.call(arguments)));return Object(c)===c?c:this}else return r.apply(e,n.concat(_e.call(arguments)))},s=Math.max(0,r.length-n.length),i=[],l=0;l<s;l++)i.push("$"+l);if(a=Function("binder","return function ("+i.join(",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var f=function(){};f.prototype=r.prototype,a.prototype=new f,f.prototype=null}return a}});var Re=R((Ma,Dt)=>{"use strict";var Sn=It();Dt.exports=Function.prototype.bind||Sn});var kt=R((Ia,Lt)=>{"use strict";var wn=Re();Lt.exports=wn.call(Function.call,Object.prototype.hasOwnProperty)});var Pe=R((Da,Ut)=>{"use strict";var m,se=SyntaxError,qt=Function,ie=TypeError,Ge=function(t){try{return qt('"use strict"; return ('+t+").constructor;")()}catch(e){}},Y=Object.getOwnPropertyDescriptor;if(Y)try{Y({},"")}catch(t){Y=null}var ze=function(){throw new ie},Tn=Y?function(){try{return arguments.callee,ze}catch(t){try{return Y(arguments,"callee").get}catch(e){return ze}}}():ze,oe=Ct()(),q=Object.getPrototypeOf||function(t){return t.__proto__},ae={},bn=typeof Uint8Array=="undefined"?m:q(Uint8Array),Z={"%AggregateError%":typeof AggregateError=="undefined"?m:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?m:ArrayBuffer,"%ArrayIteratorPrototype%":oe?q([][Symbol.iterator]()):m,"%AsyncFromSyncIteratorPrototype%":m,"%AsyncFunction%":ae,"%AsyncGenerator%":ae,"%AsyncGeneratorFunction%":ae,"%AsyncIteratorPrototype%":ae,"%Atomics%":typeof Atomics=="undefined"?m:Atomics,"%BigInt%":typeof BigInt=="undefined"?m:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?m:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?m:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?m:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array=="undefined"?m:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?m:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?m:FinalizationRegistry,"%Function%":qt,"%GeneratorFunction%":ae,"%Int8Array%":typeof Int8Array=="undefined"?m:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?m:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?m:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":oe?q(q([][Symbol.iterator]())):m,"%JSON%":typeof JSON=="object"?JSON:m,"%Map%":typeof Map=="undefined"?m:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!oe?m:q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?m:Promise,"%Proxy%":typeof Proxy=="undefined"?m:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect=="undefined"?m:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?m:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!oe?m:q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?m:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":oe?q(""[Symbol.iterator]()):m,"%Symbol%":oe?Symbol:m,"%SyntaxError%":se,"%ThrowTypeError%":Tn,"%TypedArray%":bn,"%TypeError%":ie,"%Uint8Array%":typeof Uint8Array=="undefined"?m:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?m:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?m:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?m:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap=="undefined"?m:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?m:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?m:WeakSet};try{null.error}catch(t){Ft=q(q(t)),Z["%Error.prototype%"]=Ft}var Ft,xn=function t(e){var r;if(e==="%AsyncFunction%")r=Ge("async function () {}");else if(e==="%GeneratorFunction%")r=Ge("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Ge("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var a=t("%AsyncGenerator%");a&&(r=q(a.prototype))}return Z[e]=r,r},$t={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},he=Re(),Ee=kt(),Rn=he.call(Function.call,Array.prototype.concat),En=he.call(Function.apply,Array.prototype.splice),Nt=he.call(Function.call,String.prototype.replace),Oe=he.call(Function.call,String.prototype.slice),On=he.call(Function.call,RegExp.prototype.exec),Pn=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Cn=/\\(\\)?/g,Mn=function(e){var r=Oe(e,0,1),n=Oe(e,-1);if(r==="%"&&n!=="%")throw new se("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new se("invalid intrinsic syntax, expected opening `%`");var a=[];return Nt(e,Pn,function(o,s,i,l){a[a.length]=i?Nt(l,Cn,"$1"):s||o}),a},In=function(e,r){var n=e,a;if(Ee($t,n)&&(a=$t[n],n="%"+a[0]+"%"),Ee(Z,n)){var o=Z[n];if(o===ae&&(o=xn(n)),typeof o=="undefined"&&!r)throw new ie("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:o}}throw new se("intrinsic "+e+" does not exist!")};Ut.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new ie("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new ie('"allowMissing" argument must be a boolean');if(On(/^%?[^%]*%?$/,e)===null)throw new se("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Mn(e),a=n.length>0?n[0]:"",o=In("%"+a+"%",r),s=o.name,i=o.value,l=!1,f=o.alias;f&&(a=f[0],En(n,Rn([0,1],f)));for(var c=1,g=!0;c<n.length;c+=1){var p=n[c],y=Oe(p,0,1),d=Oe(p,-1);if((y==='"'||y==="'"||y==="`"||d==='"'||d==="'"||d==="`")&&y!==d)throw new se("property names with quotes must have matching quotes");if((p==="constructor"||!g)&&(l=!0),a+="."+p,s="%"+a+"%",Ee(Z,s))i=Z[s];else if(i!=null){if(!(p in i)){if(!r)throw new ie("base intrinsic for "+e+" exists, but the property is not available.");return}if(Y&&c+1>=n.length){var h=Y(i,p);g=!!h,g&&"get"in h&&!("originalValue"in h.get)?i=h.get:i=i[p]}else g=Ee(i,p),i=i[p];g&&!l&&(Z[s]=i)}}return i}});var zt=R((La,Ce)=>{"use strict";var Ve=Re(),le=Pe(),Wt=le("%Function.prototype.apply%"),_t=le("%Function.prototype.call%"),Gt=le("%Reflect.apply%",!0)||Ve.call(_t,Wt),Bt=le("%Object.getOwnPropertyDescriptor%",!0),ee=le("%Object.defineProperty%",!0),Dn=le("%Math.max%");if(ee)try{ee({},"a",{value:1})}catch(t){ee=null}Ce.exports=function(e){var r=Gt(Ve,_t,arguments);if(Bt&&ee){var n=Bt(r,"length");n.configurable&&ee(r,"length",{value:1+Dn(0,e.length-(arguments.length-1))})}return r};var Ht=function(){return Gt(Ve,Wt,arguments)};ee?ee(Ce.exports,"apply",{value:Ht}):Ce.exports.apply=Ht});var Xt=R((ka,Jt)=>{"use strict";var Vt=Pe(),Qt=zt(),Ln=Qt(Vt("String.prototype.indexOf"));Jt.exports=function(e,r){var n=Vt(e,!!r);return typeof n=="function"&&Ln(e,".prototype.")>-1?Qt(n):n}});var jt=R((Fa,Kt)=>{Kt.exports=require("util").inspect});var vr=R(($a,mr)=>{var rt=typeof Map=="function"&&Map.prototype,Qe=Object.getOwnPropertyDescriptor&&rt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ie=rt&&Qe&&typeof Qe.get=="function"?Qe.get:null,Yt=rt&&Map.prototype.forEach,nt=typeof Set=="function"&&Set.prototype,Je=Object.getOwnPropertyDescriptor&&nt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,De=nt&&Je&&typeof Je.get=="function"?Je.get:null,Zt=nt&&Set.prototype.forEach,kn=typeof WeakMap=="function"&&WeakMap.prototype,Se=kn?WeakMap.prototype.has:null,Fn=typeof WeakSet=="function"&&WeakSet.prototype,we=Fn?WeakSet.prototype.has:null,$n=typeof WeakRef=="function"&&WeakRef.prototype,er=$n?WeakRef.prototype.deref:null,Nn=Boolean.prototype.valueOf,qn=Object.prototype.toString,Un=Function.prototype.toString,Bn=String.prototype.match,ot=String.prototype.slice,J=String.prototype.replace,Hn=String.prototype.toUpperCase,tr=String.prototype.toLowerCase,ur=RegExp.prototype.test,rr=Array.prototype.concat,U=Array.prototype.join,Wn=Array.prototype.slice,nr=Math.floor,je=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Xe=Object.getOwnPropertySymbols,Ye=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,fe=typeof Symbol=="function"&&typeof Symbol.iterator=="object",M=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===fe||"symbol")?Symbol.toStringTag:null,cr=Object.prototype.propertyIsEnumerable,or=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function ar(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||ur.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-nr(-t):nr(t);if(n!==t){var a=String(n),o=ot.call(e,a.length+1);return J.call(a,r,"$&_")+"."+J.call(J.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return J.call(e,r,"$&_")}var Ze=jt(),ir=Ze.custom,sr=yr(ir)?ir:null;mr.exports=function t(e,r,n,a){var o=r||{};if(Q(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Q(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=Q(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Q(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Q(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var i=o.numericSeparator;if(typeof e=="undefined")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return gr(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return i?ar(e,l):l}if(typeof e=="bigint"){var f=String(e)+"n";return i?ar(e,f):f}var c=typeof o.depth=="undefined"?5:o.depth;if(typeof n=="undefined"&&(n=0),n>=c&&c>0&&typeof e=="object")return et(e)?"[Array]":"[Object]";var g=io(o,n);if(typeof a=="undefined")a=[];else if(dr(a,e)>=0)return"[Circular]";function p($,V,_){if(V&&(a=Wn.call(a),a.push(V)),_){var de={depth:o.depth};return Q(o,"quoteStyle")&&(de.quoteStyle=o.quoteStyle),t($,de,n+1,a)}return t($,o,n+1,a)}if(typeof e=="function"&&!lr(e)){var y=jn(e),d=Me(e,p);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(d.length>0?" { "+U.call(d,", ")+" }":"")}if(yr(e)){var h=fe?J.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ye.call(e);return typeof e=="object"&&!fe?Ae(h):h}if(no(e)){for(var T="<"+tr.call(String(e.nodeName)),u=e.attributes||[],v=0;v<u.length;v++)T+=" "+u[v].name+"="+pr(_n(u[v].value),"double",o);return T+=">",e.childNodes&&e.childNodes.length&&(T+="..."),T+="</"+tr.call(String(e.nodeName))+">",T}if(et(e)){if(e.length===0)return"[]";var b=Me(e,p);return g&&!ao(b)?"["+tt(b,g)+"]":"[ "+U.call(b,", ")+" ]"}if(zn(e)){var A=Me(e,p);return!("cause"in Error.prototype)&&"cause"in e&&!cr.call(e,"cause")?"{ ["+String(e)+"] "+U.call(rr.call("[cause]: "+p(e.cause),A),", ")+" }":A.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+U.call(A,", ")+" }"}if(typeof e=="object"&&s){if(sr&&typeof e[sr]=="function"&&Ze)return Ze(e,{depth:c-n});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Yn(e)){var P=[];return Yt&&Yt.call(e,function($,V){P.push(p(V,e,!0)+" => "+p($,e))}),fr("Map",Ie.call(e),P,g)}if(to(e)){var C=[];return Zt&&Zt.call(e,function($){C.push(p($,e))}),fr("Set",De.call(e),C,g)}if(Zn(e))return Ke("WeakMap");if(ro(e))return Ke("WeakSet");if(eo(e))return Ke("WeakRef");if(Qn(e))return Ae(p(Number(e)));if(Xn(e))return Ae(p(je.call(e)));if(Jn(e))return Ae(Nn.call(e));if(Vn(e))return Ae(p(String(e)));if(!Gn(e)&&!lr(e)){var I=Me(e,p),F=or?or(e)===Object.prototype:e instanceof Object||e.constructor===Object,L=e instanceof Object?"":"null prototype",W=!F&&M&&Object(e)===e&&M in e?ot.call(X(e),8,-1):L?"Object":"",j=F||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",ne=j+(W||L?"["+U.call(rr.call([],W||[],L||[]),": ")+"] ":"");return I.length===0?ne+"{}":g?ne+"{"+tt(I,g)+"}":ne+"{ "+U.call(I,", ")+" }"}return String(e)};function pr(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function _n(t){return J.call(String(t),/"/g,""")}function et(t){return X(t)==="[object Array]"&&(!M||!(typeof t=="object"&&M in t))}function Gn(t){return X(t)==="[object Date]"&&(!M||!(typeof t=="object"&&M in t))}function lr(t){return X(t)==="[object RegExp]"&&(!M||!(typeof t=="object"&&M in t))}function zn(t){return X(t)==="[object Error]"&&(!M||!(typeof t=="object"&&M in t))}function Vn(t){return X(t)==="[object String]"&&(!M||!(typeof t=="object"&&M in t))}function Qn(t){return X(t)==="[object Number]"&&(!M||!(typeof t=="object"&&M in t))}function Jn(t){return X(t)==="[object Boolean]"&&(!M||!(typeof t=="object"&&M in t))}function yr(t){if(fe)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Ye)return!1;try{return Ye.call(t),!0}catch(e){}return!1}function Xn(t){if(!t||typeof t!="object"||!je)return!1;try{return je.call(t),!0}catch(e){}return!1}var Kn=Object.prototype.hasOwnProperty||function(t){return t in this};function Q(t,e){return Kn.call(t,e)}function X(t){return qn.call(t)}function jn(t){if(t.name)return t.name;var e=Bn.call(Un.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function dr(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function Yn(t){if(!Ie||!t||typeof t!="object")return!1;try{Ie.call(t);try{De.call(t)}catch(e){return!0}return t instanceof Map}catch(e){}return!1}function Zn(t){if(!Se||!t||typeof t!="object")return!1;try{Se.call(t,Se);try{we.call(t,we)}catch(e){return!0}return t instanceof WeakMap}catch(e){}return!1}function eo(t){if(!er||!t||typeof t!="object")return!1;try{return er.call(t),!0}catch(e){}return!1}function to(t){if(!De||!t||typeof t!="object")return!1;try{De.call(t);try{Ie.call(t)}catch(e){return!0}return t instanceof Set}catch(e){}return!1}function ro(t){if(!we||!t||typeof t!="object")return!1;try{we.call(t,we);try{Se.call(t,Se)}catch(e){return!0}return t instanceof WeakSet}catch(e){}return!1}function no(t){return!t||typeof t!="object"?!1:typeof HTMLElement!="undefined"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function gr(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return gr(ot.call(t,0,e.maxStringLength),e)+n}var a=J.call(J.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,oo);return pr(a,"single",e)}function oo(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Hn.call(e.toString(16))}function Ae(t){return"Object("+t+")"}function Ke(t){return t+" { ? }"}function fr(t,e,r,n){var a=n?tt(r,n):U.call(r,", ");return t+" ("+e+") {"+a+"}"}function ao(t){for(var e=0;e<t.length;e++)if(dr(t[e],`
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
`+e.prev}function Me(t,e){var r=et(t),n=[];if(r){n.length=t.length;for(var a=0;a<t.length;a++)n[a]=Q(t,a)?e(t[a],t):""}var o=typeof Xe=="function"?Xe(t):[],s;if(fe){s={};for(var i=0;i<o.length;i++)s["$"+o[i]]=o[i]}for(var l in t)Q(t,l)&&(r&&String(Number(l))===l&&l<t.length||fe&&s["$"+l]instanceof Symbol||(ur.call(/[^\w$]/,l)?n.push(e(l,t)+": "+e(t[l],t)):n.push(l+": "+e(t[l],t))));if(typeof Xe=="function")for(var f=0;f<o.length;f++)cr.call(t,o[f])&&n.push("["+e(o[f])+"]: "+e(t[o[f]],t));return n}});var Ar=R((Na,hr)=>{"use strict";var at=Pe(),ue=Xt(),so=vr(),lo=at("%TypeError%"),Le=at("%WeakMap%",!0),ke=at("%Map%",!0),fo=ue("WeakMap.prototype.get",!0),uo=ue("WeakMap.prototype.set",!0),co=ue("WeakMap.prototype.has",!0),po=ue("Map.prototype.get",!0),yo=ue("Map.prototype.set",!0),go=ue("Map.prototype.has",!0),it=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},mo=function(t,e){var r=it(t,e);return r&&r.value},vo=function(t,e,r){var n=it(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},ho=function(t,e){return!!it(t,e)};hr.exports=function(){var e,r,n,a={assert:function(o){if(!a.has(o))throw new lo("Side channel does not contain "+so(o))},get:function(o){if(Le&&o&&(typeof o=="object"||typeof o=="function")){if(e)return fo(e,o)}else if(ke){if(r)return po(r,o)}else if(n)return mo(n,o)},has:function(o){if(Le&&o&&(typeof o=="object"||typeof o=="function")){if(e)return co(e,o)}else if(ke){if(r)return go(r,o)}else if(n)return ho(n,o);return!1},set:function(o,s){Le&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new Le),uo(e,o,s)):ke?(r||(r=new ke),yo(r,o,s)):(n||(n={key:{},next:null}),vo(n,o,s))}};return a}});var Fe=R((qa,Sr)=>{"use strict";var Ao=String.prototype.replace,So=/%20/g,st={RFC1738:"RFC1738",RFC3986:"RFC3986"};Sr.exports={default:st.RFC3986,formatters:{RFC1738:function(t){return Ao.call(t,So,"+")},RFC3986:function(t){return String(t)}},RFC1738:st.RFC1738,RFC3986:st.RFC3986}});var ft=R((Ua,Tr)=>{"use strict";var wo=Fe(),lt=Object.prototype.hasOwnProperty,te=Array.isArray,B=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),To=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(te(n)){for(var a=[],o=0;o<n.length;++o)typeof n[o]!="undefined"&&a.push(n[o]);r.obj[r.prop]=a}}},wr=function(e,r){for(var n=r&&r.plainObjects?Object.create(null):{},a=0;a<e.length;++a)typeof e[a]!="undefined"&&(n[a]=e[a]);return n},bo=function t(e,r,n){if(!r)return e;if(typeof r!="object"){if(te(e))e.push(r);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!lt.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var a=e;return te(e)&&!te(r)&&(a=wr(e,n)),te(e)&&te(r)?(r.forEach(function(o,s){if(lt.call(e,s)){var i=e[s];i&&typeof i=="object"&&o&&typeof o=="object"?e[s]=t(i,o,n):e.push(o)}else e[s]=o}),e):Object.keys(r).reduce(function(o,s){var i=r[s];return lt.call(o,s)?o[s]=t(o[s],i,n):o[s]=i,o},a)},xo=function(e,r){return Object.keys(r).reduce(function(n,a){return n[a]=r[a],n},e)},Ro=function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(a){return n}},Eo=function(e,r,n,a,o){if(e.length===0)return e;var s=e;if(typeof e=="symbol"?s=Symbol.prototype.toString.call(e):typeof e!="string"&&(s=String(e)),n==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(c){return"%26%23"+parseInt(c.slice(2),16)+"%3B"});for(var i="",l=0;l<s.length;++l){var f=s.charCodeAt(l);if(f===45||f===46||f===95||f===126||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||o===wo.RFC1738&&(f===40||f===41)){i+=s.charAt(l);continue}if(f<128){i=i+B[f];continue}if(f<2048){i=i+(B[192|f>>6]+B[128|f&63]);continue}if(f<55296||f>=57344){i=i+(B[224|f>>12]+B[128|f>>6&63]+B[128|f&63]);continue}l+=1,f=65536+((f&1023)<<10|s.charCodeAt(l)&1023),i+=B[240|f>>18]+B[128|f>>12&63]+B[128|f>>6&63]+B[128|f&63]}return i},Oo=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],a=0;a<r.length;++a)for(var o=r[a],s=o.obj[o.prop],i=Object.keys(s),l=0;l<i.length;++l){var f=i[l],c=s[f];typeof c=="object"&&c!==null&&n.indexOf(c)===-1&&(r.push({obj:s,prop:f}),n.push(c))}return To(r),e},Po=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Co=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Mo=function(e,r){return[].concat(e,r)},Io=function(e,r){if(te(e)){for(var n=[],a=0;a<e.length;a+=1)n.push(r(e[a]));return n}return r(e)};Tr.exports={arrayToObject:wr,assign:xo,combine:Mo,compact:Oo,decode:Ro,encode:Eo,isBuffer:Co,isRegExp:Po,maybeMap:Io,merge:bo}});var Pr=R((Ba,Or)=>{"use strict";var Rr=Ar(),ct=ft(),Te=Fe(),Do=Object.prototype.hasOwnProperty,br={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},G=Array.isArray,Lo=String.prototype.split,ko=Array.prototype.push,Er=function(t,e){ko.apply(t,G(e)?e:[e])},Fo=Date.prototype.toISOString,xr=Te.default,E={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:ct.encode,encodeValuesOnly:!1,format:xr,formatter:Te.formatters[xr],indices:!1,serializeDate:function(e){return Fo.call(e)},skipNulls:!1,strictNullHandling:!1},$o=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},ut={},No=function t(e,r,n,a,o,s,i,l,f,c,g,p,y,d,h,T){for(var u=e,v=T,b=0,A=!1;(v=v.get(ut))!==void 0&&!A;){var P=v.get(e);if(b+=1,typeof P!="undefined"){if(P===b)throw new RangeError("Cyclic object value");A=!0}typeof v.get(ut)=="undefined"&&(b=0)}if(typeof l=="function"?u=l(r,u):u instanceof Date?u=g(u):n==="comma"&&G(u)&&(u=ct.maybeMap(u,function(He){return He instanceof Date?g(He):He})),u===null){if(o)return i&&!d?i(r,E.encoder,h,"key",p):r;u=""}if($o(u)||ct.isBuffer(u)){if(i){var C=d?r:i(r,E.encoder,h,"key",p);if(n==="comma"&&d){for(var I=Lo.call(String(u),","),F="",L=0;L<I.length;++L)F+=(L===0?"":",")+y(i(I[L],E.encoder,h,"value",p));return[y(C)+(a&&G(u)&&I.length===1?"[]":"")+"="+F]}return[y(C)+"="+y(i(u,E.encoder,h,"value",p))]}return[y(r)+"="+y(String(u))]}var W=[];if(typeof u=="undefined")return W;var j;if(n==="comma"&&G(u))j=[{value:u.length>0?u.join(",")||null:void 0}];else if(G(l))j=l;else{var ne=Object.keys(u);j=f?ne.sort(f):ne}for(var $=a&&G(u)&&u.length===1?r+"[]":r,V=0;V<j.length;++V){var _=j[V],de=typeof _=="object"&&typeof _.value!="undefined"?_.value:u[_];if(!(s&&de===null)){var sn=G(u)?typeof n=="function"?n($,_):$:$+(c?"."+_:"["+_+"]");T.set(e,b);var wt=Rr();wt.set(ut,T),Er(W,t(de,sn,n,a,o,s,i,l,f,c,g,p,y,d,h,wt))}}return W},qo=function(e){if(!e)return E;if(e.encoder!==null&&typeof e.encoder!="undefined"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||E.charset;if(typeof e.charset!="undefined"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Te.default;if(typeof e.format!="undefined"){if(!Do.call(Te.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var a=Te.formatters[n],o=E.filter;return(typeof e.filter=="function"||G(e.filter))&&(o=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:E.addQueryPrefix,allowDots:typeof e.allowDots=="undefined"?E.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:E.charsetSentinel,delimiter:typeof e.delimiter=="undefined"?E.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:E.encode,encoder:typeof e.encoder=="function"?e.encoder:E.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:E.encodeValuesOnly,filter:o,format:n,formatter:a,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:E.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:E.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:E.strictNullHandling}};Or.exports=function(t,e){var r=t,n=qo(e),a,o;typeof n.filter=="function"?(o=n.filter,r=o("",r)):G(n.filter)&&(o=n.filter,a=o);var s=[];if(typeof r!="object"||r===null)return"";var i;e&&e.arrayFormat in br?i=e.arrayFormat:e&&"indices"in e?i=e.indices?"indices":"repeat":i="indices";var l=br[i];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var f=l==="comma"&&e&&e.commaRoundTrip;a||(a=Object.keys(r)),n.sort&&a.sort(n.sort);for(var c=Rr(),g=0;g<a.length;++g){var p=a[g];n.skipNulls&&r[p]===null||Er(s,No(r[p],p,l,f,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,c))}var y=s.join(n.delimiter),d=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?d+="utf8=%26%2310003%3B&":d+="utf8=%E2%9C%93&"),y.length>0?d+y:""}});var Ir=R((Ha,Mr)=>{"use strict";var ce=ft(),pt=Object.prototype.hasOwnProperty,Uo=Array.isArray,x={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:ce.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Bo=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},Cr=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Ho="utf8=%26%2310003%3B",Wo="utf8=%E2%9C%93",_o=function(e,r){var n={},a=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=r.parameterLimit===1/0?void 0:r.parameterLimit,s=a.split(r.delimiter,o),i=-1,l,f=r.charset;if(r.charsetSentinel)for(l=0;l<s.length;++l)s[l].indexOf("utf8=")===0&&(s[l]===Wo?f="utf-8":s[l]===Ho&&(f="iso-8859-1"),i=l,l=s.length);for(l=0;l<s.length;++l)if(l!==i){var c=s[l],g=c.indexOf("]="),p=g===-1?c.indexOf("="):g+1,y,d;p===-1?(y=r.decoder(c,x.decoder,f,"key"),d=r.strictNullHandling?null:""):(y=r.decoder(c.slice(0,p),x.decoder,f,"key"),d=ce.maybeMap(Cr(c.slice(p+1),r),function(h){return r.decoder(h,x.decoder,f,"value")})),d&&r.interpretNumericEntities&&f==="iso-8859-1"&&(d=Bo(d)),c.indexOf("[]=")>-1&&(d=Uo(d)?[d]:d),pt.call(n,y)?n[y]=ce.combine(n[y],d):n[y]=d}return n},Go=function(t,e,r,n){for(var a=n?e:Cr(e,r),o=t.length-1;o>=0;--o){var s,i=t[o];if(i==="[]"&&r.parseArrays)s=[].concat(a);else{s=r.plainObjects?Object.create(null):{};var l=i.charAt(0)==="["&&i.charAt(i.length-1)==="]"?i.slice(1,-1):i,f=parseInt(l,10);!r.parseArrays&&l===""?s={0:a}:!isNaN(f)&&i!==l&&String(f)===l&&f>=0&&r.parseArrays&&f<=r.arrayLimit?(s=[],s[f]=a):l!=="__proto__"&&(s[l]=a)}a=s}return a},zo=function(e,r,n,a){if(e){var o=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,i=/(\[[^[\]]*])/g,l=n.depth>0&&s.exec(o),f=l?o.slice(0,l.index):o,c=[];if(f){if(!n.plainObjects&&pt.call(Object.prototype,f)&&!n.allowPrototypes)return;c.push(f)}for(var g=0;n.depth>0&&(l=i.exec(o))!==null&&g<n.depth;){if(g+=1,!n.plainObjects&&pt.call(Object.prototype,l[1].slice(1,-1))&&!n.allowPrototypes)return;c.push(l[1])}return l&&c.push("["+o.slice(l.index)+"]"),Go(c,r,n,a)}},Vo=function(e){if(!e)return x;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset!="undefined"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof e.charset=="undefined"?x.charset:e.charset;return{allowDots:typeof e.allowDots=="undefined"?x.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:x.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:x.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:x.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:x.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:x.comma,decoder:typeof e.decoder=="function"?e.decoder:x.decoder,delimiter:typeof e.delimiter=="string"||ce.isRegExp(e.delimiter)?e.delimiter:x.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:x.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:x.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:x.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:x.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:x.strictNullHandling}};Mr.exports=function(t,e){var r=Vo(e);if(t===""||t===null||typeof t=="undefined")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?_o(t,r):t,a=r.plainObjects?Object.create(null):{},o=Object.keys(n),s=0;s<o.length;++s){var i=o[s],l=zo(i,n[i],r,typeof t=="string");a=ce.merge(a,l,r)}return r.allowSparse===!0?a:ce.compact(a)}});var Lr=R((Wa,Dr)=>{"use strict";var Qo=Pr(),Jo=Ir(),Xo=Fe();Dr.exports={formats:Xo,parse:Jo,stringify:Qo}});var Ur=R((_a,qr)=>{"use strict";var yt=Object.defineProperty,Ko=Object.getOwnPropertyDescriptor,jo=Object.getOwnPropertyNames,Yo=Object.prototype.hasOwnProperty,Zo=(t,e)=>{for(var r in e)yt(t,r,{get:e[r],enumerable:!0})},ea=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of jo(e))!Yo.call(t,a)&&a!==r&&yt(t,a,{get:()=>e[a],enumerable:!(n=Ko(e,a))||n.enumerable});return t},ta=t=>ea(yt({},"__esModule",{value:!0}),t),Fr=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},ra=(t,e,r)=>(Fr(t,e,"read from private field"),r?r.call(t):e.get(t)),na=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},oa=(t,e,r,n)=>(Fr(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),$r={};Zo($r,{SessionStatus:()=>Nr,session:()=>ia});qr.exports=ta($r);var aa=require("@apia/util"),Nr=(t=>(t[t.Alive=0]="Alive",t[t.Dead=1]="Dead",t))(Nr||{}),$e,kr,ia=new(kr=class extends aa.EventEmitter{constructor(){super(...arguments),na(this,$e,!0)}get isAlive(){return ra(this,$e)}invalidate(){oa(this,$e,!1),this.emit("change",1)}},$e=new WeakMap,kr)});var Ra={};dn(Ra,{ApiaApi:()=>an,makeApiaUrl:()=>Be});module.exports=gn(Ra);var St=ve(require("axios")),Yr=require("lodash-es"),Ue=ve(Lr()),Zr=ve(Ur()),H=require("@apia/util"),K=require("@apia/notifications");var w=ve(require("react")),Vr=require("theme-ui"),O=require("@apia/util"),gt=require("@apia/notifications"),Qr=require("@apia/validations"),pe=require("@apia/components"),Jr=require("@apia/theme");var Br=require("react"),Hr=ve(require("react")),_r=require("theme-ui/jsx-runtime"),sa;var la=(0,Br.createContext)("apiaApi"),fa=({children:t,id:e})=>(sa=e,(0,_r.jsx)(la.Provider,{value:e,children:t})),Wr=Hr.memo(fa);var k=require("theme-ui/jsx-runtime"),mt=new class extends O.EventEmitter{},vt=new class extends O.EventEmitter{},dt="ApiaApiForm",Gr={};function zr(t,e){return N(this,null,function*(){return new Promise(r=>{var n,a,o;try{let s=/^\/?([\w\d_-]+)\/?(?:\(([^)]*)\))?$/,i=t.match(s);if(i){let l=i[1],f=i[2],c=[...(o=(a=(n=e.configuration)==null?void 0:n.methodsPath)==null?void 0:a.split("/").filter(y=>!!y))!=null?o:[],l].join("/"),g=y=>{typeof y.default!="function"&&p();let d=y.default;Gr[l]=h=>{var T;return d(e,D(S({},h),{inlineArguments:(T=f==null?void 0:f.split(",").map(u=>u.startsWith("'")||u.startsWith('"')?u.slice(1,u.length-1):u))!=null?T:[]}))},r(Gr[l])},p=()=>{throw new Error(`${l}.ts not found at ${c}.ts nor ./${l}.ts`)};import(`/api/methods/${c}.ts`).then(g).catch(()=>{var y;((y=e.configuration)==null?void 0:y.methodsPath)!==void 0?import(`/api/methods/${l}.ts`).then(g).catch(p):p()})}}catch(s){console.error(s),e.reset(),e.setError({type:"danger",message:"Error while loading current method."})}})})}function ua(t){return typeof t.canClose=="boolean"&&typeof t.type=="string"&&!!t.form}function ca(t){return typeof t.canClose=="boolean"&&typeof t.type=="string"&&!!t.function}function pa(t){return!!(typeof t.canClose=="boolean"&&typeof t.type=="string"&&typeof t.text=="object"&&t.text&&typeof t.text.label=="string")}var ht=new O.WithEventsValue;function ya(){let[,t,e]=(0,O.useStateRef)(void 0),r=w.useCallback(n=>{t(n)},[t]);return(0,O.useMount)(()=>{ht.on("update",r)}),(0,O.useUnmount)(()=>ht.off("update",r)),e}var da,At=new class extends O.EventEmitter{emit(e,r){super.emit(e,r),da=r}};function Xr(t,e,r){return ht.value=r,ua(t)?(At.emit("form",t),!0):ca(t)?(vt.emit("method",{name:t.function.name,props:{messages:t.function.messages,attributes:t.function,currentUrl:e}}),!0):pa(t)?(mt.emit("message",{predicate:t.text.label,title:t.text.title}),!0):!1}var Ne={disabled:!1,isLoading:!1,isMultipart:!1,progress:0,errors:{}},ga=()=>{var d,h,T;let t=ya(),[e,r]=w.useState(D(S({},Ne),{windowIndex:-1})),[n,a]=w.useState(void 0);w.useEffect(()=>At.on("form",a),[]);let o=w.useCallback((u,v)=>Qr.validationsStore.setFieldValue(dt,u,v),[]);w.useEffect(()=>{var P,C,I;if(!n)return;let u=(0,O.arrayOrArray)((I=(C=(P=n==null?void 0:n.form)==null?void 0:P.elements)==null?void 0:C.element)!=null?I:[]),v=!1,b=Object.values(u),A=0;for(;A<b.length&&!v;)b[A++].type==="file"&&(v=!0);r(F=>D(S(S({},F),Ne),{isMultipart:v}))},[n]);let y=(0,pe.useModal)(),{show:s,onClose:i}=y,l=me(y,["show","onClose"]),f=w.useCallback(()=>{var u,v;i(),At.emit("form",void 0),r(b=>S(S({},b),Ne)),(v=(u=t.current)==null?void 0:u.modalConfiguration)!=null&&v.onClose&&t.current.modalConfiguration.onClose()},[i,t]),c=w.useRef(null);w.useEffect(()=>{var v;let u=(v=c.current)==null?void 0:v.querySelectorAll("a,input,textarea,button");(u==null?void 0:u.length)===1&&pe.focus.on([...u][0])});let g=w.useCallback(u=>{(0,gt.notify)(S({},u))},[]),p=w.useCallback(()=>({alert,close:f,configuration:t.current,formDefinition:n,reset:()=>r(v=>S(S({},v),Ne)),setError:g,setMessage:v=>{var b,A;(A=(b=t.current)==null?void 0:b.modalConfiguration)!=null&&A.onMessage&&t.current.modalConfiguration.onMessage(v)},setState:r,state:e,setValue:o}),[f,t,n,g,e,o]);return w.useEffect(()=>{let u=F=>N(void 0,[F],function*({name:A,props:{messages:P,attributes:C,currentUrl:I}}){let L=yield zr(`${A}`,p());L&&L({messages:P,attributes:C,currentUrl:I})}),v=A=>{var I,F,L,W;let P=p();(0,gt.notify)({message:A.predicate,type:"warning",onClose:(F=(I=P.configuration)==null?void 0:I.modalConfiguration)==null?void 0:F.onMessageClose});let C=(W=(L=P.configuration)==null?void 0:L.modalConfiguration)==null?void 0:W.onMessage;C&&C(A)},b=A=>N(void 0,null,function*(){if(A.toDo==="ajaxHiddeAll"&&f(),A.toDo==="functionTimedCall"){let P=yield zr((0,O.arrayOrArray)(A.param)[1],p());P&&setTimeout(()=>{var C;return P({currentUrl:(C=n==null?void 0:n.form.action)!=null?C:"noUrl"})},Number(A.param[0]))}});return mt.on("message",v),vt.on("method",u),qe.on("action",b),()=>{mt.off("message",v),vt.off("method",u),qe.off("action",b)}},[e.windowIndex,i,f]),w.useEffect(()=>{n&&s()},[n]),(0,k.jsx)(Wr,{id:dt,children:(0,k.jsx)(pe.Modal,D(S({ref:c,onClose:f,id:dt,title:(T=(h=(d=t.current)==null?void 0:d.modalConfiguration)==null?void 0:h.modalTitle)!=null?T:n==null?void 0:n.form.title,size:"md-fixed",shouldCloseOnEsc:!e.disabled,shouldCloseOnOverlayClick:!e.disabled,initialFocusGetter:w.useCallback(u=>u==null?void 0:u.querySelector(O.focusSelector),[])},l),{children:n&&(0,k.jsxs)(Vr.Box,D(S({},(0,Jr.getVariant)("layout.common.modals.apiaApi")),{children:["NO EST\xC1 IMPLEMENTADA LA PROPIEDAD handleLoad. Falta pasar:",(0,k.jsxs)("ul",{children:[(0,k.jsx)("li",{children:"todos los componentes de validaci\xF3n (input, check, etc)"}),(0,k.jsxs)("li",{children:["M\xE9todos y componentes del apiaApiHandler (./fields, ./buttons, etc)"," ",(0,k.jsx)("strong",{children:"Ver que quiz\xE1s no es necesario pasar todos los m\xE9todos en este momento"}),", sino solamente aquellos que sean necesarios al momento de realizar alguna acci\xF3n particular."," ",(0,k.jsx)("strong",{children:"De hecho es un buen momento para hacer limpieza y refactoreo"})]})]}),"En cambio ",(0,k.jsx)("strong",{children:"el validationsStore si est\xE1 pasado"}),". Solamente faltan los componentes."]}))}))})},ti=w.memo(ga);H.debugDispatcher.on("parseXml",e=>N(void 0,[e],function*([t]){let r=yield(0,H.parseXmlAsync)(t);console.info(r)}),"Acepta un par\xE1metro de tipo string y realiza un parseo como si fuera xml, convirti\xE9ndolo a objeto javascript.");var ye={debug:!0,colors:{exception:"red",alert:"yellow",message:"lightgreen"},handleLoad:!1},ma="ApiaApiConfig",en={},Kr=localStorage.getItem(ma);Kr&&(en=JSON.parse(Kr));function re(t){return(0,Yr.merge)({},ye,t,en)}function tn(t,e,r){let n=t,a=n.indexOf("?");a===-1?n+="?":a!==n.length-1&&!n.endsWith("&")&&(n+="&");let o=`${n}${e?Ue.default.stringify(e,r):""}`;return(o.endsWith("&")||o.endsWith("?"))&&(o=o.slice(0,o.length-1)),o}var rn=t=>{var r;let e=(r=t.match(/action=(\w+)/))==null?void 0:r[1];return e!=null?e:"noAction"},qe=new class extends H.EventEmitter{};function z(t,e=(r=>(r=ye.colors)!=null?r:{exception:"red",alert:"yellow",message:"green"})()){return e[t]}var be=t=>{let e;typeof t!="string"?t.message?e=t.message:e=t.toString():e=t,(0,K.notify)({type:"danger",message:t.message}),console.log("%c ","font-size:10vh"),console.log("%cError in ApiaApi","color:red;font-size:2em;font-weight:bold"),console.log(`red/${e}`,{error:t}),console.log("%c ","font-size:10vh")};function va(t){return t.headers["content-type"].match("application/json")}function ha(t){return t.headers["content-type"].match(/(?:application|text)?\/xml/)}function Aa(t){return t.headers["content-type"].match(/(?:application|text)?\/html/)}function Sa(t){var e,r;t&&(re().debug&&console.log("%cHandled actions: ",`color: ${(r=(e=re().colors)==null?void 0:e.message)!=null?r:"green"}`,{actions:t}),(0,H.arrayOrArray)(t.action).forEach(a=>{qe.emit("action",D(S({},a),{param:(0,H.arrayOrArray)(a.param)}))}))}function jr({exceptions:t,onClose:e,sysExceptions:r,sysMessages:n}){try{import(`/api/onClose/${e}.ts`).then(a=>{if(t||r||n){let o=(0,K.getNotificationMessageObj)({exceptions:t,onClose:e,sysExceptions:r,sysMessages:n});o?o.forEach(s=>{(0,K.notify)(D(S({},s),{onClose:a.default}))}):a.default()}else a.default()},a=>{(0,K.notify)({message:`onClose action not found: ${String(a)}`,type:"danger"})})}catch(a){nn({exceptions:t,sysExceptions:r,sysMessages:n}),console.error("Error while handling onClose"),console.error(a)}}function nn(t){if(!t)return;let{exceptions:e,sysMessages:r,sysExceptions:n}=t;if(e||n||r)try{(0,K.dispatchNotifications)({exceptions:e,sysExceptions:n,sysMessages:r})}catch(a){be(new Error(a))}}var wa=(n,a,...o)=>N(void 0,[n,a,...o],function*(t,e,r=ye){var l;let s=re(r),i;if(va(t))typeof t.data=="string"?i=JSON.parse(t.data.trim()):typeof t.data=="object"&&t.data&&(i=t.data);else if(ha(t))i=yield(0,H.parseXmlAsync)(t.data).catch(c=>{be(new Error(c))});else if(Aa(t))return console.error("El contenido devuelto es Html, no se esperaba esa respuesta"),null;if(s.validateResponse){let c=yield s.validateResponse(D(S({},t),{data:(l=i==null?void 0:i.load)!=null?l:i}));if(typeof c=="string")throw new Error(`Validation error: ${c}`);if(!c)throw new Error("Error")}if(i){let f=i,{actions:c,onClose:g,exceptions:p,sysExceptions:y,sysMessages:d,load:h}=f,T=me(f,["actions","onClose","exceptions","sysExceptions","sysMessages","load"]);return T.code==="-1"&&p?(Zr.session.invalidate(),null):(p&&s.debug&&console.log(`${z("exception",s.colors)}/parseSuccessfulResponse`,{exceptions:p}),y&&s.debug&&console.log(`${z("exception",s.colors)}/parseSuccessfulResponse`,{sysExceptions:y}),d&&s.debug&&console.log(`${z("alert",s.colors)}/parseSuccessfulResponse`,{sysMessages:d}),Sa(c),s.handleLoad&&g?jr({exceptions:p,onClose:g,sysExceptions:y,sysMessages:d}):nn({exceptions:p,sysExceptions:y,sysMessages:d}),h?(s.handleLoad&&(console.log(`${z("message",s.colors)}/handleLoad`,{load:h}),Xr(h,e,{methodsPath:r.methodsPath,modalConfiguration:D(S({},s.modalConfiguration),{onClose:()=>{var u,v;g&&jr({exceptions:p,onClose:g,sysExceptions:y,sysMessages:d}),(u=s.modalConfiguration)!=null&&u.onClose&&((v=s.modalConfiguration)==null||v.onClose())}})})||console.log(`${z("exception",s.colors)}/unhandledLoad -> There is no handler defined`,{load:h})),D(S({},h),{sysMessages:d,exceptions:p,sysExceptions:y})):D(S({},T),{sysMessages:d,exceptions:p,sysExceptions:y}))}return null});function on(n,a){return N(this,arguments,function*(t,e,r=ye){var s;let o=re(r);try{if(!t||t.data===void 0)o.debug&&console.log(`${z("alert",o.colors)}/ApiaApi wrong response`);else{let i=yield wa(t,e,o),l=rn(e);return o.debug&&console.log(`${z("message",o.colors)}/ <- ApiaApi.${(s=t.config.method)!=null?s:""} ${l} `,{data:i}),D(S({},t),{data:i,hasError:!!(i!=null&&i.exceptions)||!!(i!=null&&i.sysExceptions),hasMessages:!!(i!=null&&i.sysMessages)})}}catch(i){return be(new Error(i)),null}return null})}function Ta(t,e){return N(this,null,function*(){let r=typeof t!="string"?Be():t,n=typeof t=="string"?e!=null?e:ye:t,a=D(S({},re(n)),{postData:n.postDataTreatement==="stringify"?Ue.default.stringify(n.postData,n.stringifyOptions):n.postData}),o=tn(r,a.queryData,a.stringifyOptions);if(a.debug){let i=r.split("&"),l=rn(r);console.log(`${z("message",a.colors)}/ApiaApi.post ${l}`,{url:o,queryDataInURL:[...i],queryData:a.queryData,formData:a.postData,stringifyOptiopns:a.stringifyOptions})}let s=yield St.default.post(o,a.postData,a.axiosConfig).catch(i=>{be(new Error(i))});return s?on(s,r,a):null})}function ba(t,e){return N(this,null,function*(){let r=typeof t!="string"?Be():t,n=re(typeof t=="string"?e!=null?e:ye:t),a=tn(r,n.queryData,n.stringifyOptions);n.debug&&console.log(`${z("message",n.colors)}/ApiaApi.get`,{url:a});let o=yield St.default.get(a,n.axiosConfig).catch(s=>{be(new Error(s))});return o?yield on(o,r,n):null})}var xa={get:ba,getConfig:re,post:Ta};function Be(t){var f,c;let e={};if(t){let l=t,{ajaxUrl:g,queryString:p,stringifyOptions:y,shouldAvoidTabId:d,preventAsXmlParameter:h,avoidTabId:T}=l,u=me(l,["ajaxUrl","queryString","stringifyOptions","shouldAvoidTabId","preventAsXmlParameter","avoidTabId"]);e=S({},u)}let r=Ue.default.stringify(e,(f=t==null?void 0:t.stringifyOptions)!=null?f:{arrayFormat:"repeat",encodeValuesOnly:!1}),n=(c=t==null?void 0:t.ajaxUrl)!=null?c:window.URL_REQUEST_AJAX;n.indexOf("?")===n.length-1&&(n=n.slice(0,n.length-1)),n.startsWith("/")||(n=`/${n}`);let a=window.TAB_ID_REQUEST.match(/tokenId=(\w+)/),o=(a!=null?a:[])[1],s=(t!=null&&t.tabId?`&tabId=${t.tabId}&tokenId=${o}`:window.TAB_ID_REQUEST).slice(1);t!=null&&t.avoidTabId&&(s="");let{CONTEXT:i}=window;return i!=null&&i.endsWith("/")&&(i+=i.slice(0,i.length-1)),`${i}${n}?${t!=null&&t.preventAsXmlParameter?"":"asXml=true&"}${t!=null&&t.queryString?`${t.queryString}&`:""}${r?`${r}&`:""}${s}`}var an=xa;0&&(module.exports={ApiaApi,makeApiaUrl});
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ce = require('axios');
|
|
4
|
+
var lodash = require('lodash');
|
|
5
|
+
var J = require('qs');
|
|
6
|
+
var session = require('@apia/session');
|
|
7
|
+
var util = require('@apia/util');
|
|
8
|
+
var notifications = require('@apia/notifications');
|
|
9
|
+
var p = require('react');
|
|
10
|
+
var themeUi = require('theme-ui');
|
|
11
|
+
var validations = require('@apia/validations');
|
|
12
|
+
var components = require('@apia/components');
|
|
13
|
+
var theme = require('@apia/theme');
|
|
14
|
+
var jsxRuntime = require('theme-ui/jsx-runtime');
|
|
15
|
+
|
|
16
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
|
|
18
|
+
function _interopNamespace(e) {
|
|
19
|
+
if (e && e.__esModule) return e;
|
|
20
|
+
var n = Object.create(null);
|
|
21
|
+
if (e) {
|
|
22
|
+
Object.keys(e).forEach(function (k) {
|
|
23
|
+
if (k !== 'default') {
|
|
24
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
25
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () { return e[k]; }
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
n.default = e;
|
|
33
|
+
return Object.freeze(n);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var ce__default = /*#__PURE__*/_interopDefault(ce);
|
|
37
|
+
var J__default = /*#__PURE__*/_interopDefault(J);
|
|
38
|
+
var p__namespace = /*#__PURE__*/_interopNamespace(p);
|
|
39
|
+
|
|
40
|
+
var Ae=Object.defineProperty,ye=Object.defineProperties;var Te=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var G=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable;var j=(e,t,n)=>t in e?Ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,d=(e,t)=>{for(var n in t||(t={}))G.call(t,n)&&j(e,n,t[n]);if(P)for(var n of P(t))Y.call(t,n)&&j(e,n,t[n]);return e},T=(e,t)=>ye(e,Te(t));var q=(e,t)=>{var n={};for(var o in e)G.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&P)for(var o of P(e))t.indexOf(o)<0&&Y.call(e,o)&&(n[o]=e[o]);return n};var k=(e,t,n)=>new Promise((o,a)=>{var l=c=>{try{i(n.next(c));}catch(f){a(f);}},s=c=>{try{i(n.throw(c));}catch(f){a(f);}},i=c=>c.done?o(c.value):Promise.resolve(c.value).then(l,s);i((n=n.apply(e,t)).next());});var we=p.createContext("apiaApi"),xe=({children:e,id:t})=>(jsxRuntime.jsx(we.Provider,{value:t,children:e})),ee=p__namespace.memo(xe);var V=new class extends util.EventEmitter{},W=new class extends util.EventEmitter{},O="ApiaApiForm",ne={};function ie(e,t){return k(this,null,function*(){return new Promise(n=>{var o,a,l;try{let s=/^\/?([\w\d_-]+)\/?(?:\(([^)]*)\))?$/,i=e.match(s);if(i){let c=i[1],f=i[2],A=[...(l=(a=(o=t.configuration)==null?void 0:o.methodsPath)==null?void 0:a.split("/").filter(g=>!!g))!=null?l:[],c].join("/"),R=g=>{typeof g.default!="function"&&m();let h=g.default;ne[c]=w=>{var L;return h(t,T(d({},w),{inlineArguments:(L=f==null?void 0:f.split(",").map(r=>r.startsWith("'")||r.startsWith('"')?r.slice(1,r.length-1):r))!=null?L:[]}))},n(ne[c]);},m=()=>{throw new Error(`${c}.ts not found at ${A}.ts nor ./${c}.ts`)};import(`/api/methods/${A}.ts`).then(R).catch(()=>{var g;((g=t.configuration)==null?void 0:g.methodsPath)!==void 0?import(`/api/methods/${c}.ts`).then(R).catch(m):m();});}}catch(s){console.error(s),t.reset(),t.setError({type:"danger",message:"Error while loading current method."});}})})}function He(e){return typeof e.canClose=="boolean"&&typeof e.type=="string"&&!!e.form}function Pe(e){return typeof e.canClose=="boolean"&&typeof e.type=="string"&&!!e.function}function Ue(e){return !!(typeof e.canClose=="boolean"&&typeof e.type=="string"&&typeof e.text=="object"&&e.text&&typeof e.text.label=="string")}var z=new util.WithEventsValue;function Ne(){let[,e,t]=util.useStateRef(void 0),n=p__namespace.useCallback(o=>{e(o);},[e]);return util.useMount(()=>{z.on("update",n);}),util.useUnmount(()=>z.off("update",n)),t}var _=new class extends util.EventEmitter{emit(t,n){super.emit(t,n);}};function ae(e,t,n){return z.value=n,He(e)?(_.emit("form",e),!0):Pe(e)?(W.emit("method",{name:e.function.name,props:{messages:e.function.messages,attributes:e.function,currentUrl:t}}),!0):Ue(e)?(V.emit("message",{predicate:e.text.label,title:e.text.title}),!0):!1}var U={disabled:!1,isLoading:!1,isMultipart:!1,progress:0,errors:{}},Fe=()=>{var h,w,L;let e=Ne(),[t,n]=p__namespace.useState(T(d({},U),{windowIndex:-1})),[o,a]=p__namespace.useState(void 0);p__namespace.useEffect(()=>_.on("form",a),[]);let l=p__namespace.useCallback((r,u)=>validations.validationsStore.setFieldValue(O,r,u),[]);p__namespace.useEffect(()=>{var C,M,b;if(!o)return;let r=util.arrayOrArray((b=(M=(C=o==null?void 0:o.form)==null?void 0:C.elements)==null?void 0:M.element)!=null?b:[]),u=!1,x=Object.values(r),y=0;for(;y<x.length&&!u;)x[y++].type==="file"&&(u=!0);n(H=>T(d(d({},H),U),{isMultipart:u}));},[o]);let g=components.useModal(),{show:s,onClose:i}=g,c=q(g,["show","onClose"]),f=p__namespace.useCallback(()=>{var r,u;i(),_.emit("form",void 0),n(x=>d(d({},x),U)),(u=(r=e.current)==null?void 0:r.modalConfiguration)!=null&&u.onClose&&e.current.modalConfiguration.onClose();},[i,e]),A=p__namespace.useRef(null);p__namespace.useEffect(()=>{var u;let r=(u=A.current)==null?void 0:u.querySelectorAll("a,input,textarea,button");(r==null?void 0:r.length)===1&&components.focus.on([...r][0]);});let R=p__namespace.useCallback(r=>{notifications.notify(d({},r));},[]),m=p__namespace.useCallback(()=>({alert,close:f,configuration:e.current,formDefinition:o,reset:()=>n(u=>d(d({},u),U)),setError:R,setMessage:u=>{var x,y;(y=(x=e.current)==null?void 0:x.modalConfiguration)!=null&&y.onMessage&&e.current.modalConfiguration.onMessage(u);},setState:n,state:t,setValue:l}),[f,e,o,R,t,l]);return p__namespace.useEffect(()=>{let r=H=>k(void 0,[H],function*({name:y,props:{messages:C,attributes:M,currentUrl:b}}){let v=yield ie(`${y}`,m());v&&v({messages:C,attributes:M,currentUrl:b});}),u=y=>{var b,H,v,K;let C=m();notifications.notify({message:y.predicate,type:"warning",onClose:(H=(b=C.configuration)==null?void 0:b.modalConfiguration)==null?void 0:H.onMessageClose});let M=(K=(v=C.configuration)==null?void 0:v.modalConfiguration)==null?void 0:K.onMessage;M&&M(y);},x=y=>k(void 0,null,function*(){if(y.toDo==="ajaxHiddeAll"&&f(),y.toDo==="functionTimedCall"){let C=yield ie(util.arrayOrArray(y.param)[1],m());C&&setTimeout(()=>{var M;return C({currentUrl:(M=o==null?void 0:o.form.action)!=null?M:"noUrl"})},Number(y.param[0]));}});return V.on("message",u),W.on("method",r),N.on("action",x),()=>{V.off("message",u),W.off("method",r),N.off("action",x);}},[t.windowIndex,i,f]),p__namespace.useEffect(()=>{o&&s();},[o]),jsxRuntime.jsx(ee,{id:O,children:jsxRuntime.jsx(components.Modal,T(d({ref:A,onClose:f,id:O,title:(L=(w=(h=e.current)==null?void 0:h.modalConfiguration)==null?void 0:w.modalTitle)!=null?L:o==null?void 0:o.form.title,size:"md-fixed",shouldCloseOnEsc:!t.disabled,shouldCloseOnOverlayClick:!t.disabled,initialFocusGetter:p__namespace.useCallback(r=>r==null?void 0:r.querySelector(util.focusSelector),[])},c),{children:o&&jsxRuntime.jsxs(themeUi.Box,T(d({},theme.getVariant("layout.common.modals.apiaApi")),{children:["NO EST\xC1 IMPLEMENTADA LA PROPIEDAD handleLoad. Falta pasar:",jsxRuntime.jsxs("ul",{children:[jsxRuntime.jsx("li",{children:"todos los componentes de validaci\xF3n (input, check, etc)"}),jsxRuntime.jsxs("li",{children:["M\xE9todos y componentes del apiaApiHandler (./fields, ./buttons, etc)"," ",jsxRuntime.jsx("strong",{children:"Ver que quiz\xE1s no es necesario pasar todos los m\xE9todos en este momento"}),", sino solamente aquellos que sean necesarios al momento de realizar alguna acci\xF3n particular."," ",jsxRuntime.jsx("strong",{children:"De hecho es un buen momento para hacer limpieza y refactoreo"})]})]}),"En cambio ",jsxRuntime.jsx("strong",{children:"el validationsStore si est\xE1 pasado"}),". Solamente faltan los componentes."]}))}))})};p__namespace.memo(Fe);util.debugDispatcher.on("parseXml",t=>k(void 0,[t],function*([e]){let n=yield util.parseXmlAsync(e);console.info(n);}),"Acepta un par\xE1metro de tipo string y realiza un parseo como si fuera xml, convirti\xE9ndolo a objeto javascript.");var E={debug:!0,colors:{exception:"red",alert:"yellow",message:"lightgreen"},handleLoad:!1},Je="ApiaApiConfig",ue={},re=localStorage.getItem(Je);re&&(ue=JSON.parse(re));function D(e){return lodash.merge({},E,e,ue)}function pe(e,t,n){let o=e,a=o.indexOf("?");a===-1?o+="?":a!==o.length-1&&!o.endsWith("&")&&(o+="&");let l=`${o}${t?J__default.default.stringify(t,n):""}`;return (l.endsWith("&")||l.endsWith("?"))&&(l=l.slice(0,l.length-1)),l}var fe=e=>{var n;let t=(n=e.match(/action=(\w+)/))==null?void 0:n[1];return t!=null?t:"noAction"},N=new class extends util.EventEmitter{};function I(e,t=(n=>(n=E.colors)!=null?n:{exception:"red",alert:"yellow",message:"green"})()){return t[e]}var $=e=>{let t;typeof e!="string"?e.message?t=e.message:t=e.toString():t=e,notifications.notify({type:"danger",message:e.message}),console.log("%c ","font-size:10vh"),console.log("%cError in ApiaApi","color:red;font-size:2em;font-weight:bold"),console.log(`red/${t}`,{error:e}),console.log("%c ","font-size:10vh");};function Be(e){return e.headers["content-type"].match("application/json")}function Ke(e){return e.headers["content-type"].match(/(?:application|text)?\/xml/)}function je(e){return e.headers["content-type"].match(/(?:application|text)?\/html/)}function Ge(e){var t,n;e&&(D().debug&&console.log("%cHandled actions: ",`color: ${(n=(t=D().colors)==null?void 0:t.message)!=null?n:"green"}`,{actions:e}),util.arrayOrArray(e.action).forEach(a=>{N.emit("action",T(d({},a),{param:util.arrayOrArray(a.param)}));}));}function le({exceptions:e,onClose:t,sysExceptions:n,sysMessages:o}){try{import(`/api/onClose/${t}.ts`).then(a=>{if(e||n||o){let l=notifications.getNotificationMessageObj({exceptions:e,onClose:t,sysExceptions:n,sysMessages:o});l?l.forEach(s=>{notifications.notify(T(d({},s),{onClose:a.default}));}):a.default();}else a.default();},a=>{notifications.notify({message:`onClose action not found: ${String(a)}`,type:"danger"});});}catch(a){ge({exceptions:e,sysExceptions:n,sysMessages:o}),console.error("Error while handling onClose"),console.error(a);}}function ge(e){if(!e)return;let{exceptions:t,sysMessages:n,sysExceptions:o}=e;if(t||o||n)try{notifications.dispatchNotifications({exceptions:t,sysExceptions:o,sysMessages:n});}catch(a){$(new Error(a));}}var Ye=(o,a,...l)=>k(void 0,[o,a,...l],function*(e,t,n=E){var c;let s=D(n),i;if(Be(e))typeof e.data=="string"?i=JSON.parse(e.data.trim()):typeof e.data=="object"&&e.data&&(i=e.data);else if(Ke(e))i=yield util.parseXmlAsync(e.data).catch(A=>{$(new Error(A));});else if(je(e))return console.error("El contenido devuelto es Html, no se esperaba esa respuesta"),null;if(s.validateResponse){let A=yield s.validateResponse(T(d({},e),{data:(c=i==null?void 0:i.load)!=null?c:i}));if(typeof A=="string")throw new Error(`Validation error: ${A}`);if(!A)throw new Error("Error")}if(i){let f=i,{actions:A,onClose:R,exceptions:m,sysExceptions:g,sysMessages:h,load:w}=f,L=q(f,["actions","onClose","exceptions","sysExceptions","sysMessages","load"]);return L.code==="-1"&&m?(session.session.invalidate(),null):(m&&s.debug&&console.log(`${I("exception",s.colors)}/parseSuccessfulResponse`,{exceptions:m}),g&&s.debug&&console.log(`${I("exception",s.colors)}/parseSuccessfulResponse`,{sysExceptions:g}),h&&s.debug&&console.log(`${I("alert",s.colors)}/parseSuccessfulResponse`,{sysMessages:h}),Ge(A),s.handleLoad&&R?le({exceptions:m,onClose:R,sysExceptions:g,sysMessages:h}):ge({exceptions:m,sysExceptions:g,sysMessages:h}),w?(s.handleLoad&&(console.log(`${I("message",s.colors)}/handleLoad`,{load:w}),ae(w,t,{methodsPath:n.methodsPath,modalConfiguration:T(d({},s.modalConfiguration),{onClose:()=>{var r,u;R&&le({exceptions:m,onClose:R,sysExceptions:g,sysMessages:h}),(r=s.modalConfiguration)!=null&&r.onClose&&((u=s.modalConfiguration)==null||u.onClose());}})})||console.log(`${I("exception",s.colors)}/unhandledLoad -> There is no handler defined`,{load:w})),T(d({},w),{sysMessages:h,exceptions:m,sysExceptions:g})):T(d({},L),{sysMessages:h,exceptions:m,sysExceptions:g}))}return null});function me(o,a){return k(this,arguments,function*(e,t,n=E){var s;let l=D(n);try{if(!e||e.data===void 0)l.debug&&console.log(`${I("alert",l.colors)}/ApiaApi wrong response`);else {let i=yield Ye(e,t,l),c=fe(t);return l.debug&&console.log(`${I("message",l.colors)}/ <- ApiaApi.${(s=e.config.method)!=null?s:""} ${c} `,{data:i}),T(d({},e),{data:i,hasError:!!(i!=null&&i.exceptions)||!!(i!=null&&i.sysExceptions),hasMessages:!!(i!=null&&i.sysMessages)})}}catch(i){return $(new Error(i)),null}return null})}function Ze(e,t){return k(this,null,function*(){let n=typeof e!="string"?B():e,o=typeof e=="string"?t!=null?t:E:e,a=T(d({},D(o)),{postData:o.postDataTreatement==="stringify"?J__default.default.stringify(o.postData,o.stringifyOptions):o.postData}),l=pe(n,a.queryData,a.stringifyOptions);if(a.debug){let i=n.split("&"),c=fe(n);console.log(`${I("message",a.colors)}/ApiaApi.post ${c}`,{url:l,queryDataInURL:[...i],queryData:a.queryData,formData:a.postData,stringifyOptiopns:a.stringifyOptions});}let s=yield ce__default.default.post(l,a.postData,a.axiosConfig).catch(i=>{$(new Error(i));});return s?me(s,n,a):null})}function et(e,t){return k(this,null,function*(){let n=typeof e!="string"?B():e,o=D(typeof e=="string"?t!=null?t:E:e),a=pe(n,o.queryData,o.stringifyOptions);o.debug&&console.log(`${I("message",o.colors)}/ApiaApi.get`,{url:a});let l=yield ce__default.default.get(a,o.axiosConfig).catch(s=>{$(new Error(s));});return l?yield me(l,n,o):null})}var tt={get:et,getConfig:D,post:Ze};function B(e){var f,A;let t={};if(e){let c=e,r=q(c,["ajaxUrl","queryString","stringifyOptions","shouldAvoidTabId","preventAsXmlParameter","avoidTabId"]);t=d({},r);}let n=J__default.default.stringify(t,(f=e==null?void 0:e.stringifyOptions)!=null?f:{arrayFormat:"repeat",encodeValuesOnly:!1}),o=(A=e==null?void 0:e.ajaxUrl)!=null?A:window.URL_REQUEST_AJAX;o.indexOf("?")===o.length-1&&(o=o.slice(0,o.length-1)),o.startsWith("/")||(o=`/${o}`);let a=window.TAB_ID_REQUEST.match(/tokenId=(\w+)/),l=(a!=null?a:[])[1],s=(e!=null&&e.tabId?`&tabId=${e.tabId}&tokenId=${l}`:window.TAB_ID_REQUEST).slice(1);e!=null&&e.avoidTabId&&(s="");let{CONTEXT:i}=window;return i!=null&&i.endsWith("/")&&(i+=i.slice(0,i.length-1)),`${i}${o}?${e!=null&&e.preventAsXmlParameter?"":"asXml=true&"}${e!=null&&e.queryString?`${e.queryString}&`:""}${n?`${n}&`:""}${s}`}var ot=tt;
|
|
41
|
+
|
|
42
|
+
exports.ApiaApi = ot;
|
|
43
|
+
exports.makeApiaUrl = B;
|
package/package.json
CHANGED
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
"author": "alexisleite <alexisleite@live.com>",
|
|
3
3
|
"homepage": "",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"main": "./dist/index.js",
|
|
6
5
|
"name": "@apia/api",
|
|
7
6
|
"sideEffects": false,
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.9-alpha.0",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@apia/components": "^0.0.
|
|
12
|
-
"@apia/notifications": "^0.0.
|
|
13
|
-
"@apia/theme": "^0.0.
|
|
14
|
-
"@apia/util": "^0.0.
|
|
15
|
-
"@apia/validations": "^0.0.
|
|
16
|
-
"@types/lodash-es": "^4.17.7",
|
|
11
|
+
"@apia/components": "^0.0.9-alpha.0",
|
|
12
|
+
"@apia/notifications": "^0.0.9-alpha.0",
|
|
13
|
+
"@apia/theme": "^0.0.9-alpha.0",
|
|
14
|
+
"@apia/util": "^0.0.9-alpha.0",
|
|
15
|
+
"@apia/validations": "^0.0.9-alpha.0",
|
|
17
16
|
"axios": "^1.3.4",
|
|
18
|
-
"lodash
|
|
17
|
+
"lodash": "^4.17.21"
|
|
19
18
|
},
|
|
20
19
|
"devDependencies": {
|
|
20
|
+
"@types/lodash": "^4.14.192",
|
|
21
21
|
"tsup": "^6.6.3",
|
|
22
22
|
"type-fest": "^3.6.1",
|
|
23
23
|
"typescript": "^4.9.5"
|
|
@@ -38,8 +38,7 @@
|
|
|
38
38
|
"directory": "packages/api"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
|
-
"build": "tsup"
|
|
42
|
-
"buildDev": "tsup"
|
|
41
|
+
"build": "tsup"
|
|
43
42
|
},
|
|
44
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "44a7f4d12bba024c862a7a811b79547c6a8030b1"
|
|
45
44
|
}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.tsx"],"sourcesContent":["const Initiator = () => {\r\n return <>Reemplazar este código por cualquier otro</>;\r\n};\r\n\r\nexport default Initiator;\r\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GACS,IAAAI,EAAA,6BADHC,EAAY,OACT,mBAAE,wDAAyC,EAG7CH,EAAQG","names":["src_exports","__export","src_default","__toCommonJS","import_jsx_runtime","Initiator"]}
|