Refactor code structure for improved readability and maintainability
Release / Release (push) Has been cancelled

This commit is contained in:
ian committed 2025-05-27 21:47:20 +03:00
1 parent 8b29e56016
commit 3f5f2fd11e
2 files changed
+5 -1

No files matched your search

-1
View File
@@ -1,7 +1,6 @@
.DS_Store .DS_Store
node_modules node_modules
.pnpm-store .pnpm-store
dist
# directus files # directus files
*.db *.db
+5
View File
@@ -0,0 +1,5 @@
import e from"url";import t from"util";import r from"tty";import n from"os";import i from"buffer";import s from"crypto";import o from"zlib";import a from"http";import c from"https";import l from"events";import u from"assert";import d from"querystring";import f from"fs";import p from"path";import h from"constants";import m from"stream";import y from"dns";import g from"net";import _ from"tls";import v from"string_decoder";var b="object"==typeof global&&global&&global.Object===Object&&global,w="object"==typeof self&&self&&self.Object===Object&&self,S=b||w||Function("return this")(),E=S.Symbol,k=Object.prototype,A=k.hasOwnProperty,O=k.toString,C=E?E.toStringTag:void 0;var T=Object.prototype.toString;var R="[object Null]",I="[object Undefined]",x=E?E.toStringTag:void 0;function j(e){return null==e?void 0===e?I:R:x&&x in Object(e)?function(e){var t=A.call(e,C),r=e[C];try{e[C]=void 0;var n=!0}catch(e){}var i=O.call(e);return n&&(t?e[C]=r:delete e[C]),i}(e):function(e){return T.call(e)}(e)}function P(e){return null!=e&&"object"==typeof e}var N="[object Symbol]";function $(e){return"symbol"==typeof e||P(e)&&j(e)==N}var M=Array.isArray,D=1/0,L=E?E.prototype:void 0,B=L?L.toString:void 0;function K(e){if("string"==typeof e)return e;if(M(e))return function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}(e,K)+"";if($(e))return B?B.call(e):"";var t=e+"";return"0"==t&&1/e==-D?"-0":t}var F=/\s/;var U=/^\s+/;function W(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&F.test(e.charAt(t)););return t}(e)+1).replace(U,""):e}function J(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var H=NaN,G=/^[-+]0x[0-9a-f]+$/i,z=/^0b[01]+$/i,V=/^0o[0-7]+$/i,q=parseInt;function X(e){if("number"==typeof e)return e;if($(e))return H;if(J(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=J(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=W(e);var r=z.test(e);return r||V.test(e)?q(e.slice(2),r?2:8):G.test(e)?H:+e}var Y="[object AsyncFunction]",Z="[object Function]",Q="[object GeneratorFunction]",ee="[object Proxy]";function te(e){if(!J(e))return!1;var t=j(e);return t==Z||t==Q||t==Y||t==ee}var re,ne=S["__core-js_shared__"],ie=(re=/[^.]+$/.exec(ne&&ne.keys&&ne.keys.IE_PROTO||""))?"Symbol(src)_1."+re:"";var se=Function.prototype.toString;function oe(e){if(null!=e){try{return se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var ae=/^\[object .+?Constructor\]$/,ce=Function.prototype,le=Object.prototype,ue=ce.toString,de=le.hasOwnProperty,fe=RegExp("^"+ue.call(de).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function pe(e){return!(!J(e)||(t=e,ie&&ie in t))&&(te(e)?fe:ae).test(oe(e));var t}function he(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return pe(r)?r:void 0}var me=he(S,"WeakMap"),ye=Object.create,ge=function(){function e(){}return function(t){if(!J(t))return{};if(ye)return ye(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();var _e=function(){try{var e=he(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var ve=9007199254740991,be=/^(?:0|[1-9]\d*)$/;function we(e,t){var r=typeof e;return!!(t=null==t?ve:t)&&("number"==r||"symbol"!=r&&be.test(e))&&e>-1&&e%1==0&&e<t}function Se(e,t,r){"__proto__"==t&&_e?_e(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function Ee(e,t){return e===t||e!=e&&t!=t}var ke=Object.prototype.hasOwnProperty;function Ae(e,t,r){var n=e[t];ke.call(e,t)&&Ee(n,r)&&(void 0!==r||t in e)||Se(e,t,r)}function Oe(e,t,r,n){var i=!r;r||(r={});for(var s=-1,o=t.length;++s<o;){var a=t[s],c=n?n(r[a],e[a],a,r,e):void 0;void 0===c&&(c=e[a]),i?Se(r,a,c):Ae(r,a,c)}return r}var Ce=9007199254740991;function Te(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Ce}function Re(e){return null!=e&&Te(e.length)&&!te(e)}var Ie=Object.prototype;function xe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ie)}function je(e){return P(e)&&"[object Arguments]"==j(e)}var Pe=Object.prototype,Ne=Pe.hasOwnProperty,$e=Pe.propertyIsEnumerable,Me=je(function(){return arguments}())?je:function(e){return P(e)&&Ne.call(e,"callee")&&!$e.call(e,"callee")};var De="object"==typeof exports&&exports&&!exports.nodeType&&exports,Le=De&&"object"==typeof module&&module&&!module.nodeType&&module,Be=Le&&Le.exports===De?S.Buffer:void 0,Ke=(Be?Be.isBuffer:void 0)||function(){return!1},Fe={};function Ue(e){return function(t){return e(t)}}Fe["[object Float32Array]"]=Fe["[object Float64Array]"]=Fe["[object Int8Array]"]=Fe["[object Int16Array]"]=Fe["[object Int32Array]"]=Fe["[object Uint8Array]"]=Fe["[object Uint8ClampedArray]"]=Fe["[object Uint16Array]"]=Fe["[object Uint32Array]"]=!0,Fe["[object Arguments]"]=Fe["[object Array]"]=Fe["[object ArrayBuffer]"]=Fe["[object Boolean]"]=Fe["[object DataView]"]=Fe["[object Date]"]=Fe["[object Error]"]=Fe["[object Function]"]=Fe["[object Map]"]=Fe["[object Number]"]=Fe["[object Object]"]=Fe["[object RegExp]"]=Fe["[object Set]"]=Line truncated
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
function BA(e){return null==e}var KA=function(e,t){var r,n="";for(r=0;r<t;r+=1)n+=e;return n},FA=function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},UA=function(e,t){var r,n,i,s;if(t)for(r=0,n=(s=Object.keys(t)).length;r<n;r+=1)e[i=s[r]]=t[i];return e},WA={isNothing:BA,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:BA(e)?[]:[e]},repeat:KA,isNegativeZero:FA,extend:UA};function JA(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+="\n\n"+e.mark.snippet),n+" "+r):n}function HA(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=JA(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}HA.prototype=Object.create(Error.prototype),HA.prototype.constructor=HA,HA.prototype.toString=function(e){return this.name+": "+JA(this,e)};var GA=HA;function zA(e,t,r,n,i){var s="",o="",a=Math.floor(i/2)-1;return n-t>a&&(t=n-a+(s=" ... ").length),r-n>a&&(r=n+a-(o=" ...").length),{str:s+e.slice(t,r).replace(/\t/g,"→")+o,pos:n-t+s.length}}function VA(e,t){return WA.repeat(" ",t-e.length)+e}var qA=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var r,n=/\r?\n|\r|\0/g,i=[0],s=[],o=-1;r=n.exec(e.buffer);)s.push(r.index),i.push(r.index+r[0].length),e.position<=r.index&&o<0&&(o=i.length-2);o<0&&(o=i.length-1);var a,c,l="",u=Math.min(e.line+t.linesAfter,s.length).toString().length,d=t.maxLength-(t.indent+u+3);for(a=1;a<=t.linesBefore&&!(o-a<0);a++)c=zA(e.buffer,i[o-a],s[o-a],e.position-(i[o]-i[o-a]),d),l=WA.repeat(" ",t.indent)+VA((e.line-a+1).toString(),u)+" | "+c.str+"\n"+l;for(c=zA(e.buffer,i[o],s[o],e.position,d),l+=WA.repeat(" ",t.indent)+VA((e.line+1).toString(),u)+" | "+c.str+"\n",l+=WA.repeat("-",t.indent+u+3+c.pos)+"^\n",a=1;a<=t.linesAfter&&!(o+a>=s.length);a++)c=zA(e.buffer,i[o+a],s[o+a],e.position-(i[o]-i[o+a]),d),l+=WA.repeat(" ",t.indent)+VA((e.line+a+1).toString(),u)+" | "+c.str+"\n";return l.replace(/\n$/,"")},XA=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],YA=["scalar","sequence","mapping"];var ZA=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===XA.indexOf(t))throw new GA('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach((function(r){e[r].forEach((function(e){t[String(e)]=r}))})),t}(t.styleAliases||null),-1===YA.indexOf(this.kind))throw new GA('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function QA(e,t){var r=[];return e[t].forEach((function(e){var t=r.length;r.forEach((function(r,n){r.tag===e.tag&&r.kind===e.kind&&r.multi===e.multi&&(t=n)})),r[t]=e})),r}function eO(e){return this.extend(e)}eO.prototype.extend=function(e){var t=[],r=[];if(e instanceof ZA)r.push(e);else if(Array.isArray(e))r=r.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new GA("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(r=r.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof ZA))throw new GA("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new GA("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new GA("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),r.forEach((function(e){if(!(e instanceof ZA))throw new GA("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var n=Object.create(eO.prototype);return n.implicit=(this.implicit||[]).concat(t),n.explicit=(this.explicit||[]).concat(r),n.compiledImplicit=QA(n,"implicit"),n.compiledExplicit=QA(n,"explicit"),n.compiledTypeMap=function(){var e,t,r={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function n(e){e.multi?(r.multi[e.kind].push(e),r.multi.fallback.push(e)):r[e.kind][e.tag]=r.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(n);return r}(n.compiledImplicit,n.compiledExplicit),n};var tO=eO,rO=Line truncated
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
!function(e,t){var r=i,n=r.Buffer;function s(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=o),o.prototype=Object.create(n.prototype),s(n,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(ZT,ZT.exports);var QT=ZT.exports,eR=QT.Buffer,tR=m;function rR(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=eR.alloc(0),this;if("function"==typeof e.pipe)return this.buffer=eR.alloc(0),e.pipe(this),this;if(e.length||"object"==typeof e)return this.buffer=e,this.writable=!1,process.nextTick(function(){this.emit("end",e),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof e+")")}t.inherits(rR,tR),rR.prototype.write=function(e){this.buffer=eR.concat([this.buffer,eR.from(e)]),this.emit("data",e)},rR.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};var nR=rR,iR=i.Buffer,sR=i.SlowBuffer,oR=aR;function aR(e,t){if(!iR.isBuffer(e)||!iR.isBuffer(t))return!1;if(e.length!==t.length)return!1;for(var r=0,n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}aR.install=function(){iR.prototype.equal=sR.prototype.equal=function(e){return aR(this,e)}};var cR=iR.prototype.equal,lR=sR.prototype.equal;function uR(e){return(e/8|0)+(e%8==0?0:1)}aR.restore=function(){iR.prototype.equal=cR,sR.prototype.equal=lR};var dR={ES256:uR(256),ES384:uR(384),ES512:uR(521)};var fR=function(e){var t=dR[e];if(t)return t;throw new Error('Unknown algorithm "'+e+'"')},pR=QT.Buffer,hR=fR,mR=128;function yR(e){if(pR.isBuffer(e))return e;if("string"==typeof e)return pR.from(e,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function gR(e,t,r){for(var n=0;t+n<r&&0===e[t+n];)++n;return e[t+n]>=mR&&--n,n}var _R={derToJose:function(e,t){e=yR(e);var r=hR(t),n=r+1,i=e.length,s=0;if(48!==e[s++])throw new Error('Could not find expected "seq"');var o=e[s++];if(o===(1|mR)&&(o=e[s++]),i-s<o)throw new Error('"seq" specified length of "'+o+'", only "'+(i-s)+'" remaining');if(2!==e[s++])throw new Error('Could not find expected "int" for "r"');var a=e[s++];if(i-s-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(i-s-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var c=s;if(s+=a,2!==e[s++])throw new Error('Could not find expected "int" for "s"');var l=e[s++];if(i-s!==l)throw new Error('"s" specified length of "'+l+'", expected "'+(i-s)+'"');if(n<l)throw new Error('"s" specified length of "'+l+'", max of "'+n+'" is acceptable');var u=s;if((s+=l)!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var d=r-a,f=r-l,p=pR.allocUnsafe(d+a+f+l);for(s=0;s<d;++s)p[s]=0;e.copy(p,s,c+Math.max(-d,0),c+a);for(var h=s=r;s<h+f;++s)p[s]=0;return e.copy(p,s,u+Math.max(-f,0),u+l),p=(p=p.toString("base64")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},joseToDer:function(e,t){e=yR(e);var r=hR(t),n=e.length;if(n!==2*r)throw new TypeError('"'+t+'" signatures must be "'+2*r+'" bytes, saw "'+n+'"');var i=gR(e,0,r),s=gR(e,r,e.length),o=r-i,a=r-s,c=2+o+1+1+a,l=c<mR,u=pR.allocUnsafe((l?2:3)+c),d=0;return u[d++]=48,l?u[d++]=c:(u[d++]=1|mR,u[d++]=255&c),u[d++]=2,u[d++]=o,i<0?(u[d++]=0,d+=e.copy(u,d,0,r)):d+=e.copy(u,d,i,r),u[d++]=2,u[d++]=a,s<0?(u[d++]=0,e.copy(u,d,r)):e.copy(u,d,r+s),u}},vR=oR,bR=QT.Buffer,wR=s,SR=_R,ER=t,kR="secret must be a string or buffer",AR="key must be a string or a buffer",OR="key must be a string, a buffer or an object",CR="function"==typeof wR.createPublicKey;function TR(e){if(!bR.isBuffer(e)&&"string"!=typeof e){if(!CR)throw jR(AR);if("object"!=typeof e)throw jR(AR);if("string"!=typeof e.type)throw jR(AR);if("string"!=typeof e.asymmetricKeyType)throw jR(AR);if("function"!=typeof e.export)throw jR(AR)}}function RR(e){if(!bR.isBuffer(e)&&"string"!=typeof e&&"object"!=typeof e)throw jR(OR)}function IR(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function xR(e){var t=4-(e=e.toString()).length%4;if(4!==t)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function jR(e){var t=[].slice.call(arguments,1),r=ER.format.bind(ER,e).apply(null,t);return new TypeError(r)}function PR(e){var t;return t=e,bR.isBuffer(t)||"string"==typeof t||(e=JSON.stringify(e)),e}function NR(e){return function(t,r){!function(e){if(!bR.isBuffer(e)){if("string"==typeof e)return e;if(!CR)throw jR(kR);if("object"!=tyLine truncated