updates 14.2.3 → 14.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/updates.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|

|
|
5
5
|
|
|
6
|
-
`updates` is a CLI tool which checks for npm and
|
|
6
|
+
`updates` is a CLI tool which checks for npm and poetry dependency updates of the current project and optionally updates `package.json`/`pyproject.toml`. It is highly configurable and is typically able to complete in less than a second.
|
|
7
7
|
|
|
8
8
|
# Usage
|
|
9
9
|
|
package/bin/updates.js
CHANGED
|
@@ -25,9 +25,10 @@ Content-Type: ${a.type||"application/octet-stream"}\r
|
|
|
25
25
|
`}}return t.message=r+`
|
|
26
26
|
`,t}});var gh=C((xS,mh)=>{"use strict";mh.exports=Fb;var Hb=fh(),Bb=ph();function Fb(t){global.Buffer&&global.Buffer.isBuffer(t)&&(t=t.toString("utf8"));let e=new Hb;try{return e.parse(t),e.finish()}catch(r){throw Bb(r,t)}}});function Ws({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}var Ys=Re(fa(),1);var da=Ys.default.HttpProxyAgent,pa=Ys.default.HttpsProxyAgent;var vr=class extends Map{constructor(e={}){if(super(),!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof e.maxAge=="number"&&e.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=e.maxSize,this.maxAge=e.maxAge||Number.POSITIVE_INFINITY,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(e){if(typeof this.onEviction=="function")for(let[r,n]of e)this.onEviction(r,n.value)}_deleteIfExpired(e,r){return typeof r.expiry=="number"&&r.expiry<=Date.now()?(typeof this.onEviction=="function"&&this.onEviction(e,r.value),this.delete(e)):!1}_getOrDeleteIfExpired(e,r){if(this._deleteIfExpired(e,r)===!1)return r.value}_getItemValue(e,r){return r.expiry?this._getOrDeleteIfExpired(e,r):r.value}_peek(e,r){let n=r.get(e);return this._getItemValue(e,n)}_set(e,r){this.cache.set(e,r),this._size++,this._size>=this.maxSize&&(this._size=0,this._emitEvictions(this.oldCache),this.oldCache=this.cache,this.cache=new Map)}_moveToRecent(e,r){this.oldCache.delete(e),this._set(e,r)}*_entriesAscending(){for(let e of this.oldCache){let[r,n]=e;this.cache.has(r)||this._deleteIfExpired(r,n)===!1&&(yield e)}for(let e of this.cache){let[r,n]=e;this._deleteIfExpired(r,n)===!1&&(yield e)}}get(e){if(this.cache.has(e)){let r=this.cache.get(e);return this._getItemValue(e,r)}if(this.oldCache.has(e)){let r=this.oldCache.get(e);if(this._deleteIfExpired(e,r)===!1)return this._moveToRecent(e,r),r.value}}set(e,r,{maxAge:n=this.maxAge}={}){let i=typeof n=="number"&&n!==Number.POSITIVE_INFINITY?Date.now()+n:void 0;this.cache.has(e)?this.cache.set(e,{value:r,expiry:i}):this._set(e,{value:r,expiry:i})}has(e){return this.cache.has(e)?!this._deleteIfExpired(e,this.cache.get(e)):this.oldCache.has(e)?!this._deleteIfExpired(e,this.oldCache.get(e)):!1}peek(e){if(this.cache.has(e))return this._peek(e,this.cache);if(this.oldCache.has(e))return this._peek(e,this.oldCache)}delete(e){let r=this.cache.delete(e);return r&&this._size--,this.oldCache.delete(e)||r}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}resize(e){if(!(e&&e>0))throw new TypeError("`maxSize` must be a number greater than 0");let r=[...this._entriesAscending()],n=r.length-e;n<0?(this.cache=new Map(r),this.oldCache=new Map,this._size=r.length):(n>0&&this._emitEvictions(r.slice(0,n)),this.oldCache=new Map(r.slice(n)),this.cache=new Map,this._size=0),this.maxSize=e}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.cache){let[r,n]=e;this._deleteIfExpired(r,n)===!1&&(yield[r,n.value])}for(let e of this.oldCache){let[r,n]=e;this.cache.has(r)||this._deleteIfExpired(r,n)===!1&&(yield[r,n.value])}}*entriesDescending(){let e=[...this.cache];for(let r=e.length-1;r>=0;--r){let n=e[r],[i,a]=n;this._deleteIfExpired(i,a)===!1&&(yield[i,a.value])}e=[...this.oldCache];for(let r=e.length-1;r>=0;--r){let n=e[r],[i,a]=n;this.cache.has(i)||this._deleteIfExpired(i,a)===!1&&(yield[i,a.value])}}*entriesAscending(){for(let[e,r]of this._entriesAscending())yield[e,r.value]}get size(){if(!this._size)return this.oldCache.size;let e=0;for(let r of this.oldCache.keys())this.cache.has(r)||e++;return Math.min(this._size+e,this.maxSize)}entries(){return this.entriesAscending()}forEach(e,r=this){for(let[n,i]of this.entriesAscending())e.call(r,i,n,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}};var ya=Re(ga(),1);import{Agent as Td}from"node:http";import{Agent as Ad}from"node:https";var Cd={agentCacheSize:512},ba={maxSockets:64,keepAlive:!1},Qs=class t extends Error{constructor(e){super(e),this.name="TimeoutError",Error.captureStackTrace(this,t)}};function Ks(t,e={}){if(!("undici"in e))throw new Error("The 'undici' option is required");let r={...Cd,...e},n=new vr({maxSize:r.agentCacheSize});async function i(u,h={}){let{origin:f,protocol:c}=new URL(u),g=h!=null&&h.noProxy?null:(0,ya.getProxyForUrl)(u),b=JSON.stringify({proxyUrl:g,origin:f,...h});if(n.has(b))return n.get(b);let m;if("noProxy"in h&&delete h.noProxy,e.undici){let{ProxyAgent:p,Agent:_}=await import("undici"),R={...h};"keepAlive"in R&&!("pipelining"in R)&&(R.pipelining=R.keepAlive?1:0),"keepAlive"in R&&delete R.keepAlive,"maxSockets"in R&&(R.connections=R.maxSockets,delete R.maxSockets),g?m=new p({...R,uri:g}):m=new _(R)}else{let p=c==="https:";g?m=new(p?pa:da)({...h,proxy:g}):m=new(p?Ad:Td)(h)}return n.set(b,m),m}let a=(u,{timeout:h=0,agentOpts:f={},...c}={})=>new Promise(async(g,b)=>{var _;if(!e.undici&&!("agent"in c)){let R=await i(u,{...ba,...f});R&&(c.agent=R)}else if(e.undici&&!("dispatcher"in c)){let R=await i(u,{...ba,...f});R&&(c.dispatcher=R)}let m,p;h&&(!("signal"in c)&&globalThis.AbortController&&(p=new AbortController,c.signal=p.signal),m=setTimeout(()=>{var E;(E=p==null?void 0:p.abort)==null||E.call(p);let R=new Qs(`${c.method||"GET"} ${u} timed out after ${h}ms`);b(R)},h),(_=m==null?void 0:m.unref)==null||_.call(m)),t(u,c).then(R=>{m&&clearTimeout(m),g(R)}).catch(R=>{if(m&&clearTimeout(m),R.name==="AbortError")return g(null);b(R)})});return a.clearCache=()=>{for(let u of n.values())"destroy"in u&&u.destroy();n.clear()},a}var Ih=Re(Xs(),1);import ep from"node:http";import tp from"node:https";import Vt from"node:zlib";import tl,{PassThrough as rl,pipeline as Gt}from"node:stream";import{Buffer as qn}from"node:buffer";function xd(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=t.substring(5,e).split(";"),n="",i=!1,a=r[0]||"text/plain",u=a;for(let g=1;g<r.length;g++)r[g]==="base64"?i=!0:r[g]&&(u+=`;${r[g]}`,r[g].indexOf("charset=")===0&&(n=r[g].substring(8)));!r[0]&&!n.length&&(u+=";charset=US-ASCII",n="US-ASCII");let h=i?"base64":"ascii",f=unescape(t.substring(e+1)),c=Buffer.from(f,h);return c.type=a,c.typeFull=u,c.charset=n,c}var Ra=xd;xr();In();import ot,{PassThrough as za}from"node:stream";import{types as Ma,deprecate as oi,promisify as jd}from"node:util";import{Buffer as Ee}from"node:buffer";var Ge=class extends Error{constructor(e,r){super(e),Error.captureStackTrace(this,this.constructor),this.type=r}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};var de=class extends Ge{constructor(e,r,n){super(e,r),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}};var Ln=Symbol.toStringTag,ri=t=>typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&typeof t.sort=="function"&&t[Ln]==="URLSearchParams",Ir=t=>t&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.constructor=="function"&&/^(Blob|File)$/.test(t[Ln]),La=t=>typeof t=="object"&&(t[Ln]==="AbortSignal"||t[Ln]==="EventTarget"),$a=(t,e)=>{let r=new URL(e).hostname,n=new URL(t).hostname;return r===n||r.endsWith(`.${n}`)},Pa=(t,e)=>{let r=new URL(e).protocol,n=new URL(t).protocol;return r===n};var Vd=jd(ot.pipeline),pe=Symbol("Body internals"),Ue=class{constructor(e,{size:r=0}={}){let n=null;e===null?e=null:ri(e)?e=Ee.from(e.toString()):Ir(e)||Ee.isBuffer(e)||(Ma.isAnyArrayBuffer(e)?e=Ee.from(e):ArrayBuffer.isView(e)?e=Ee.from(e.buffer,e.byteOffset,e.byteLength):e instanceof ot||(e instanceof yt?(e=Ia(e),n=e.type.split("=")[1]):e=Ee.from(String(e))));let i=e;Ee.isBuffer(e)?i=ot.Readable.from(e):Ir(e)&&(i=ot.Readable.from(e.stream())),this[pe]={body:e,stream:i,boundary:n,disturbed:!1,error:null},this.size=r,e instanceof ot&&e.on("error",a=>{let u=a instanceof Ge?a:new de(`Invalid response body while trying to fetch ${this.url}: ${a.message}`,"system",a);this[pe].error=u})}get body(){return this[pe].stream}get bodyUsed(){return this[pe].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:n}=await ii(this);return e.slice(r,r+n)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let n=new yt,i=new URLSearchParams(await this.text());for(let[a,u]of i)n.append(a,u);return n}let{toFormData:r}=await Promise.resolve().then(()=>(Ua(),qa));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[pe].body&&this[pe].body.type||"",r=await this.arrayBuffer();return new Ve([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await ii(this);return new TextDecoder().decode(e)}buffer(){return ii(this)}};Ue.prototype.buffer=oi(Ue.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Ue.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:oi(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});async function ii(t){if(t[pe].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[pe].disturbed=!0,t[pe].error)throw t[pe].error;let{body:e}=t;if(e===null)return Ee.alloc(0);if(!(e instanceof ot))return Ee.alloc(0);let r=[],n=0;try{for await(let i of e){if(t.size>0&&n+i.length>t.size){let a=new de(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(a),a}n+=i.length,r.push(i)}}catch(i){throw i instanceof Ge?i:new de(`Invalid response body while trying to fetch ${t.url}: ${i.message}`,"system",i)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return r.every(i=>typeof i=="string")?Ee.from(r.join("")):Ee.concat(r,n)}catch(i){throw new de(`Could not create Buffer from response body for ${t.url}: ${i.message}`,"system",i)}else throw new de(`Premature close of server response while trying to fetch ${t.url}`)}var kt=(t,e)=>{let r,n,{body:i}=t[pe];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof ot&&typeof i.getBoundary!="function"&&(r=new za({highWaterMark:e}),n=new za({highWaterMark:e}),i.pipe(r),i.pipe(n),t[pe].stream=r,i=n),i},Gd=oi(t=>t.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),Nn=(t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":ri(t)?"application/x-www-form-urlencoded;charset=UTF-8":Ir(t)?t.type||null:Ee.isBuffer(t)||Ma.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof yt?`multipart/form-data; boundary=${e[pe].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${Gd(t)}`:t instanceof ot?null:"text/plain;charset=UTF-8",Wa=t=>{let{body:e}=t[pe];return e===null?0:Ir(e)?e.size:Ee.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},ka=async(t,{body:e})=>{e===null?t.end():await Vd(e,t)};import{types as ja}from"node:util";import Hn from"node:http";var Dn=typeof Hn.validateHeaderName=="function"?Hn.validateHeaderName:t=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){let e=new TypeError(`Header name must be a valid HTTP token [${t}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}},ai=typeof Hn.validateHeaderValue=="function"?Hn.validateHeaderValue:(t,e)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(e)){let r=new TypeError(`Invalid character in header content ["${t}"]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_CHAR"}),r}},_e=class t extends URLSearchParams{constructor(e){let r=[];if(e instanceof t){let n=e.raw();for(let[i,a]of Object.entries(n))r.push(...a.map(u=>[i,u]))}else if(e!=null)if(typeof e=="object"&&!ja.isBoxedPrimitive(e)){let n=e[Symbol.iterator];if(n==null)r.push(...Object.entries(e));else{if(typeof n!="function")throw new TypeError("Header pairs must be iterable");r=[...e].map(i=>{if(typeof i!="object"||ja.isBoxedPrimitive(i))throw new TypeError("Each header pair must be an iterable object");return[...i]}).map(i=>{if(i.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...i]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return r=r.length>0?r.map(([n,i])=>(Dn(n),ai(n,String(i)),[String(n).toLowerCase(),String(i)])):void 0,super(r),new Proxy(this,{get(n,i,a){switch(i){case"append":case"set":return(u,h)=>(Dn(u),ai(u,String(h)),URLSearchParams.prototype[i].call(n,String(u).toLowerCase(),String(h)));case"delete":case"has":case"getAll":return u=>(Dn(u),URLSearchParams.prototype[i].call(n,String(u).toLowerCase()));case"keys":return()=>(n.sort(),new Set(URLSearchParams.prototype.keys.call(n)).keys());default:return Reflect.get(n,i,a)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let n=r.join(", ");return/^content-encoding$/i.test(e)&&(n=n.toLowerCase()),n}forEach(e,r=void 0){for(let n of this.keys())Reflect.apply(e,r,[this.get(n),n,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let n=this.getAll(r);return r==="host"?e[r]=n[0]:e[r]=n.length>1?n:n[0],e},{})}};Object.defineProperties(_e.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));function Va(t=[]){return new _e(t.reduce((e,r,n,i)=>(n%2===0&&e.push(i.slice(n,n+2)),e),[]).filter(([e,r])=>{try{return Dn(e),ai(e,String(r)),!0}catch{return!1}}))}var Yd=new Set([301,302,303,307,308]),Bn=t=>Yd.has(t);var De=Symbol("Response internals"),Te=class t extends Ue{constructor(e=null,r={}){super(e,r);let n=r.status!=null?r.status:200,i=new _e(r.headers);if(e!==null&&!i.has("Content-Type")){let a=Nn(e,this);a&&i.append("Content-Type",a)}this[De]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:i,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[De].type}get url(){return this[De].url||""}get status(){return this[De].status}get ok(){return this[De].status>=200&&this[De].status<300}get redirected(){return this[De].counter>0}get statusText(){return this[De].statusText}get headers(){return this[De].headers}get highWaterMark(){return this[De].highWaterMark}clone(){return new t(kt(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,r=302){if(!Bn(r))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new t(null,{headers:{location:new URL(e).toString()},status:r})}static error(){let e=new t(null,{status:0,statusText:""});return e[De].type="error",e}static json(e=void 0,r={}){let n=JSON.stringify(e);if(n===void 0)throw new TypeError("data is not JSON serializable");let i=new _e(r&&r.headers);return i.has("content-type")||i.set("content-type","application/json"),new t(n,{...r,headers:i})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Te.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});import{format as Xd}from"node:url";import{deprecate as Zd}from"node:util";var Ga=t=>{if(t.search)return t.search;let e=t.href.length-1,r=t.hash||(t.href[e]==="#"?"#":"");return t.href[e-r.length]==="?"?"?":""};import{isIP as Qd}from"node:net";function Ya(t,e=!1){return t==null||(t=new URL(t),/^(about|blob|data):$/.test(t.protocol))?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}var Qa=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),Ka="strict-origin-when-cross-origin";function Xa(t){if(!Qa.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function Kd(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=Qd(e);return r===4&&/^127\./.test(e)||r===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(e)?!0:t.host==="localhost"||t.host.endsWith(".localhost")?!1:t.protocol==="file:"}function jt(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:Kd(t)}function Za(t,{referrerURLCallback:e,referrerOriginCallback:r}={}){if(t.referrer==="no-referrer"||t.referrerPolicy==="")return null;let n=t.referrerPolicy;if(t.referrer==="about:client")return"no-referrer";let i=t.referrer,a=Ya(i),u=Ya(i,!0);a.toString().length>4096&&(a=u),e&&(a=e(a)),r&&(u=r(u));let h=new URL(t.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return u;case"unsafe-url":return a;case"strict-origin":return jt(a)&&!jt(h)?"no-referrer":u.toString();case"strict-origin-when-cross-origin":return a.origin===h.origin?a:jt(a)&&!jt(h)?"no-referrer":u;case"same-origin":return a.origin===h.origin?a:"no-referrer";case"origin-when-cross-origin":return a.origin===h.origin?a:u;case"no-referrer-when-downgrade":return jt(a)&&!jt(h)?"no-referrer":a;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function Ja(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let n of e)n&&Qa.has(n)&&(r=n);return r}var se=Symbol("Request internals"),$r=t=>typeof t=="object"&&typeof t[se]=="object",Jd=Zd(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),wt=class t extends Ue{constructor(e,r={}){let n;if($r(e)?n=new URL(e.url):(n=new URL(e),e={}),n.username!==""||n.password!=="")throw new TypeError(`${n} is an url with embedded credentials.`);let i=r.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(i)&&(i=i.toUpperCase()),!$r(r)&&"data"in r&&Jd(),(r.body!=null||$r(e)&&e.body!==null)&&(i==="GET"||i==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let a=r.body?r.body:$r(e)&&e.body!==null?kt(e):null;super(a,{size:r.size||e.size||0});let u=new _e(r.headers||e.headers||{});if(a!==null&&!u.has("Content-Type")){let c=Nn(a,this);c&&u.set("Content-Type",c)}let h=$r(e)?e.signal:null;if("signal"in r&&(h=r.signal),h!=null&&!La(h))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let f=r.referrer==null?e.referrer:r.referrer;if(f==="")f="no-referrer";else if(f){let c=new URL(f);f=/^about:(\/\/)?client$/.test(c)?"client":c}else f=void 0;this[se]={method:i,redirect:r.redirect||e.redirect||"follow",headers:u,parsedURL:n,signal:h,referrer:f},this.follow=r.follow===void 0?e.follow===void 0?20:e.follow:r.follow,this.compress=r.compress===void 0?e.compress===void 0?!0:e.compress:r.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent,this.highWaterMark=r.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=r.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=r.referrerPolicy||e.referrerPolicy||""}get method(){return this[se].method}get url(){return Xd(this[se].parsedURL)}get headers(){return this[se].headers}get redirect(){return this[se].redirect}get signal(){return this[se].signal}get referrer(){if(this[se].referrer==="no-referrer")return"";if(this[se].referrer==="client")return"about:client";if(this[se].referrer)return this[se].referrer.toString()}get referrerPolicy(){return this[se].referrerPolicy}set referrerPolicy(e){this[se].referrerPolicy=Xa(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(wt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});var el=t=>{let{parsedURL:e}=t[se],r=new _e(t[se].headers);r.has("Accept")||r.set("Accept","*/*");let n=null;if(t.body===null&&/^(post|put)$/i.test(t.method)&&(n="0"),t.body!==null){let h=Wa(t);typeof h=="number"&&!Number.isNaN(h)&&(n=String(h))}n&&r.set("Content-Length",n),t.referrerPolicy===""&&(t.referrerPolicy=Ka),t.referrer&&t.referrer!=="no-referrer"?t[se].referrer=Za(t):t[se].referrer="no-referrer",t[se].referrer instanceof URL&&r.set("Referer",t.referrer),r.has("User-Agent")||r.set("User-Agent","node-fetch"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip, deflate, br");let{agent:i}=t;typeof i=="function"&&(i=i(e)),!r.has("Connection")&&!i&&r.set("Connection","close");let a=Ga(e),u={path:e.pathname+a,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:i};return{parsedURL:e,options:u}};var Fn=class extends Ge{constructor(e,r="aborted"){super(e,r)}};In();ni();var rp=new Set(["data:","http:","https:"]);async function Un(t,e){return new Promise((r,n)=>{let i=new wt(t,e),{parsedURL:a,options:u}=el(i);if(!rp.has(a.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${a.protocol.replace(/:$/,"")}" is not supported.`);if(a.protocol==="data:"){let _=Ra(i.url),R=new Te(_,{headers:{"Content-Type":_.typeFull}});r(R);return}let h=(a.protocol==="https:"?tp:ep).request,{signal:f}=i,c=null,g=()=>{let _=new Fn("The operation was aborted.");n(_),i.body&&i.body instanceof tl.Readable&&i.body.destroy(_),!(!c||!c.body)&&c.body.emit("error",_)};if(f&&f.aborted){g();return}let b=()=>{g(),p()},m=h(a.toString(),u);f&&f.addEventListener("abort",b);let p=()=>{m.abort(),f&&f.removeEventListener("abort",b)};m.on("error",_=>{n(new de(`request to ${i.url} failed, reason: ${_.message}`,"system",_)),p()}),np(m,_=>{c&&c.body&&c.body.destroy(_)}),process.version<"v14"&&m.on("socket",_=>{let R;_.prependListener("end",()=>{R=_._eventsCount}),_.prependListener("close",E=>{if(c&&R<_._eventsCount&&!E){let A=new Error("Premature close");A.code="ERR_STREAM_PREMATURE_CLOSE",c.body.emit("error",A)}})}),m.on("response",_=>{m.setTimeout(0);let R=Va(_.rawHeaders);if(Bn(_.statusCode)){let T=R.get("Location"),L=null;try{L=T===null?null:new URL(T,i.url)}catch{if(i.redirect!=="manual"){n(new de(`uri requested responds with an invalid redirect URL: ${T}`,"invalid-redirect")),p();return}}switch(i.redirect){case"error":n(new de(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),p();return;case"manual":break;case"follow":{if(L===null)break;if(i.counter>=i.follow){n(new de(`maximum redirect reached at: ${i.url}`,"max-redirect")),p();return}let D={headers:new _e(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:kt(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!$a(i.url,L)||!Pa(i.url,L))for(let V of["authorization","www-authenticate","cookie","cookie2"])D.headers.delete(V);if(_.statusCode!==303&&i.body&&e.body instanceof tl.Readable){n(new de("Cannot follow redirect with body being a readable stream","unsupported-redirect")),p();return}(_.statusCode===303||(_.statusCode===301||_.statusCode===302)&&i.method==="POST")&&(D.method="GET",D.body=void 0,D.headers.delete("content-length"));let H=Ja(R);H&&(D.referrerPolicy=H),r(Un(new wt(L,D))),p();return}default:return n(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}f&&_.once("end",()=>{f.removeEventListener("abort",b)});let E=Gt(_,new rl,T=>{T&&n(T)});process.version<"v12.10"&&_.on("aborted",b);let A={url:i.url,status:_.statusCode,statusText:_.statusMessage,headers:R,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},N=R.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||N===null||_.statusCode===204||_.statusCode===304){c=new Te(E,A),r(c);return}let $={flush:Vt.Z_SYNC_FLUSH,finishFlush:Vt.Z_SYNC_FLUSH};if(N==="gzip"||N==="x-gzip"){E=Gt(E,Vt.createGunzip($),T=>{T&&n(T)}),c=new Te(E,A),r(c);return}if(N==="deflate"||N==="x-deflate"){let T=Gt(_,new rl,L=>{L&&n(L)});T.once("data",L=>{(L[0]&15)===8?E=Gt(E,Vt.createInflate(),D=>{D&&n(D)}):E=Gt(E,Vt.createInflateRaw(),D=>{D&&n(D)}),c=new Te(E,A),r(c)}),T.once("end",()=>{c||(c=new Te(E,A),r(c))});return}if(N==="br"){E=Gt(E,Vt.createBrotliDecompress(),T=>{T&&n(T)}),c=new Te(E,A),r(c);return}c=new Te(E,A),r(c)}),ka(m,i).catch(n)})}function np(t,e){let r=qn.from(`0\r
|
|
27
27
|
\r
|
|
28
|
-
`),n=!1,i=!1,a;t.on("response",u=>{let{headers:h}=u;n=h["transfer-encoding"]==="chunked"&&!h["content-length"]}),t.on("socket",u=>{let h=()=>{if(n&&!i){let c=new Error("Premature close");c.code="ERR_STREAM_PREMATURE_CLOSE",e(c)}},f=c=>{i=qn.compare(c.slice(-5),r)===0,!i&&a&&(i=qn.compare(a.slice(-3),r.slice(0,3))===0&&qn.compare(c.slice(-2),r.slice(3))===0),a=c};u.prependListener("close",h),u.on("data",f),t.on("close",()=>{u.removeListener("close",h),u.removeListener("data",f)})})}var Lh=Re(Il(),1),$h=Re(Mn(),1),Ph=Re($l(),1),ne=Re(Oc(),1),Nh=Re(Nc(),1),Dh=Re(Yc(),1);import{cwd as Wb,stdout as kb,argv as jb,env as fs,exit as Yr,versions as Vb}from"node:process";import{join as ds,dirname as Hh,basename as Gb}from"node:path";import{lstatSync as Yb,readFileSync as Sh,truncateSync as Qb,writeFileSync as Kb,accessSync as Xb}from"node:fs";import{platform as Zb}from"node:os";import{rootCertificates as Rh}from"node:tls";var vb=[[1e3,6e4,"sec"],[6e4,36e5,"min"],[36e5,864e5,"hour"],[864e5,6048e5,"day"],[6048e5,2628e6,"week"],[2628e6,31536e6,"month"],[31536e6,1/0,"year"]],xb={"1 day ago":"yesterday","1 week ago":"last week","1 month ago":"last month","1 year ago":"last year","in 1 day":"tomorrow","in 1 week":"next week","in 1 month":"next month","in 1 year":"next year"};function os(t,{noAffix:e=!1,times:r=vb,nowThreshold:n=1e4,nowString:i="now",aliases:a=!1,aliasesMap:u=xb}={}){let h=Date.now();if(t=typeof t=="number"?t:Date.parse(t),Number.isNaN(t))return"unknown";let f=!1,c=h-t;if(c<0&&(f=!0,c=Math.abs(c)),c<n)return i;let g,b;for(let p=0,_=r.length;p<_;p++){let R=r[p];if(!(c>=R[1])){g=Math.floor(c/R[0]),b=R[2]+(g>1?"s":"");break}}let m=`${f&&!e?"in ":""}${g} ${b}${!f&&!e?" ago":""}`;return a?u[m]??m:m}import Fi from"node:process";import Ob from"node:os";import Qc from"node:tty";function ve(t,e=globalThis.Deno?globalThis.Deno.args:Fi.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}var{env:X}=Fi,as;ve("no-color")||ve("no-colors")||ve("color=false")||ve("color=never")?as=0:(ve("color")||ve("colors")||ve("color=true")||ve("color=always"))&&(as=1);function Ib(){if("FORCE_COLOR"in X)return X.FORCE_COLOR==="true"?1:X.FORCE_COLOR==="false"?0:X.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(X.FORCE_COLOR,10),3)}function Lb(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function $b(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let n=Ib();n!==void 0&&(as=n);let i=r?as:n;if(i===0)return 0;if(r){if(ve("color=16m")||ve("color=full")||ve("color=truecolor"))return 3;if(ve("color=256"))return 2}if("TF_BUILD"in X&&"AGENT_NAME"in X)return 1;if(t&&!e&&i===void 0)return 0;let a=i||0;if(X.TERM==="dumb")return a;if(Fi.platform==="win32"){let u=Ob.release().split(".");return Number(u[0])>=10&&Number(u[2])>=10586?Number(u[2])>=14931?3:2:1}if("CI"in X)return"GITHUB_ACTIONS"in X?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(u=>u in X)||X.CI_NAME==="codeship"?1:a;if("TEAMCITY_VERSION"in X)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(X.TEAMCITY_VERSION)?1:0;if(X.COLORTERM==="truecolor"||X.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in X){let u=Number.parseInt((X.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(X.TERM_PROGRAM){case"iTerm.app":return u>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(X.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(X.TERM)||"COLORTERM"in X?1:a}function Kc(t,e={}){let r=$b(t,{streamIsTTY:t&&t.isTTY,...e});return Lb(r)}var Pb={stdout:Kc({isTTY:Qc.isatty(1)}),stderr:Kc({isTTY:Qc.isatty(2)})},Xc=Pb;var Zc=!0;function Jc(){Zc=!1}function qi(t,e,r){return Zc?`\x1B[${e}m${t}\x1B[${r}m`:t}var Ui=t=>qi(t,31,39),rr=t=>qi(t,32,39);var ls=t=>qi(t,35,39);var Bh=Re(gh(),1);var qb=t=>{let e=typeof t;return t!==null&&(e==="object"||e==="function")};var ki=new Set(["__proto__","prototype","constructor"]),Ub=new Set("0123456789");function zb(t){let e=[],r="",n="start",i=!1;for(let a of t)switch(a){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");i&&(r+=a),n="property",i=!i;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(i){i=!1,r+=a;break}if(ki.has(r))return[];e.push(r),r="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(i){i=!1,r+=a;break}if(n==="property"){if(ki.has(r))return[];e.push(r),r=""}n="index";break}case"]":{if(n==="index"){e.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!Ub.has(a))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),i&&(i=!1,r+="\\"),r+=a}}switch(i&&(r+="\\"),n){case"property":{if(ki.has(r))return[];e.push(r);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function Mb(t,e){if(typeof e!="number"&&Array.isArray(t)){let r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return!1}function bh(t,e,r){if(!qb(t)||typeof e!="string")return r===void 0?t:r;let n=zb(e);if(n.length===0)return r;for(let i=0;i<n.length;i++){let a=n[i];if(Mb(t,a)?t=i===n.length-1?void 0:null:t=t[a],t==null){if(i!==n.length-1)return r;break}}return t===void 0?r:t}var ji=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},yh=t=>globalThis.DOMException===void 0?new ji(t):new DOMException(t),_h=t=>{let e=t.reason===void 0?yh("This operation was aborted."):t.reason;return e instanceof Error?e:yh(e)};async function Vi(t,e,{concurrency:r=Number.POSITIVE_INFINITY,stopOnError:n=!0,signal:i}={}){return new Promise((a,u)=>{if(t[Symbol.iterator]===void 0&&t[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof t})`);if(typeof e!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(r)||r===Number.POSITIVE_INFINITY)&&r>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${r}\` (${typeof r})`);let h=[],f=[],c=new Map,g=!1,b=!1,m=!1,p=0,_=0,R=t[Symbol.iterator]===void 0?t[Symbol.asyncIterator]():t[Symbol.iterator](),E=N=>{g=!0,b=!0,u(N)};i&&(i.aborted&&E(_h(i)),i.addEventListener("abort",()=>{E(_h(i))}));let A=async()=>{if(b)return;let N=await R.next(),$=_;if(_++,N.done){if(m=!0,p===0&&!b){if(!n&&f.length>0){E(new AggregateError(f));return}if(b=!0,c.size===0){a(h);return}let T=[];for(let[L,D]of h.entries())c.get(L)!==wh&&T.push(D);a(T)}return}p++,(async()=>{try{let T=await N.value;if(b)return;let L=await e(T,$);L===wh&&c.set($,L),h[$]=L,p--,await A()}catch(T){if(n)E(T);else{f.push(T),p--;try{await A()}catch(L){E(L)}}}})()};(async()=>{for(let N=0;N<r;N++){try{await A()}catch($){E($);break}if(m||g)break}})()})}var wh=Symbol("skip");async function Gi(t,e){return Vi(t,r=>r(),e)}function sr(t,e){var r=0,n,i;e=e||{};function a(){var u=n,h=arguments.length,f,c;e:for(;u;){if(u.args.length!==arguments.length){u=u.next;continue}for(c=0;c<h;c++)if(u.args[c]!==arguments[c]){u=u.next;continue e}return u!==n&&(u===i&&(i=u.prev),u.prev.next=u.next,u.next&&(u.next.prev=u.prev),u.next=n,u.prev=null,n.prev=u,n=u),u.val}for(f=new Array(h),c=0;c<h;c++)f[c]=arguments[c];return u={args:f,val:t.apply(null,f)},n?(n.prev=u,u.next=n):i=u,r===e.maxSize?(i=i.prev,i.next=null):r++,n=u,u.val}return a.clear=function(){n=null,i=null,r=0},a}var{fromUrl:Jb}=Dh.default,ur,Oh;globalThis.fetch&&!((Oh=Vb)!=null&&Oh.node)?ur=globalThis.fetch:ur=Ks(Un,{undici:!1});var Fh=96,ct="\0",ey=/^.*?:\/\/(.*?@)?(github\.com[:/])/i,ty=/^([^/]+)\/([^/#]+)?.*?\/([0-9a-f]+|v?[0-9]+\.[0-9]+\.[0-9]+)$/i,Ji=/^[0-9a-f]{7,}$/i,Eh=/[0-9]+(\.[0-9]+)?(\.[0-9]+)?/g,Th=t=>t.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&"),ry=sr(Jb),Yi=sr(Lh.default),ny=sr(Ph.default),ps=sr(t=>t.endsWith("/")?t.substring(0,t.length-1):t),sy=new Set(["patch"]),iy=new Set(["patch","minor"]),oy=new Set(["patch","minor","major"]),qh="14.2.3",xe={},z=(0,Ih.default)(jb.slice(2),{boolean:["E","error-on-outdated","U","error-on-unchanged","h","help","j","json","n","no-color","u","update","v","version","V","verbose"],string:["d","allow-downgrade","f","file","g","greatest","l","language","m","minor","P","patch","p","prerelease","R","release","r","registry","t","types","githubapi","pypiapi"],alias:{d:"allow-downgrade",E:"error-on-outdated",U:"error-on-unchanged",e:"exclude",f:"file",g:"greatest",h:"help",i:"include",j:"json",l:"language",m:"minor",n:"no-color",P:"patch",p:"prerelease",r:"registry",R:"release",s:"semver",S:"sockets",t:"types",u:"update",v:"version",V:"verbose"}});(z["no-color"]||!Xc.stdout)&&Jc();var ir=cr(z.greatest),Qi=cr(z.prerelease),Ki=cr(z.release),or=cr(z.patch),ar=cr(z.minor),lr=cr(z["allow-downgrade"]),ze=(0,$h.default)("npm",{registry:"https://registry.npmjs.org"}),Xi={npmrc:ze,recursive:!0},Ah=z.githubapi?ps(z.githubapi):"https://api.github.com",ay=z.pypiapi?ps(z.pypiapi):"https://pypi.org",Uh=typeof z.sockets=="number"?parseInt(z.sockets):Fh;function Ch(t){return Array.from(t.matchAll(/(----BEGIN CERT[^]+?IFICATE----)/g),e=>e[0])}function zh(t,e,r){let n=ds(e,t);try{return Xb(n),n}catch{}let i=Hh(e);return r&&n===r||i===e?null:zh(t,i,r)}function ly(t,e){if(t.startsWith("@")){let r=(/@[a-z0-9][\w-.]+/.exec(t)||[])[0],n=ps(ny(r,ze));if(n!==e)try{let i=Yi(n,Xi);if(i!=null&&i.token)return[i,n]}catch{}return[Yi(e,Xi),e]}else return[Yi(e,Xi),e]}var Mh=sr((t,e,r)=>({...Object.keys(t).length&&{agentOpts:t},headers:{"user-agent":`updates/${qh}`,...r&&{Authorization:`${e} ${r}`}}}));async function uy(t,e,r,n){let[i,a]=ly(t,r),h=(e==="resolutions"?wy(t):t).replace(/\//g,"%2f"),f=`${a}/${h}`;z.verbose&&console.error(`${ls("fetch")} ${f}`);let c=await ur(f,Mh(n,i==null?void 0:i.type,i==null?void 0:i.token));if(c!=null&&c.ok)return z.verbose&&console.error(`${rr("done")} ${f}`),[await c.json(),e,a,t];throw c!=null&&c.status&&(c!=null&&c.statusText)?new Error(`Received ${c.status} ${c.statusText} for ${t} from ${a}`):new Error(`Unable to fetch ${t} from ${a}`)}async function cy(t,e,r){let n=`${ay}/pypi/${t}/json`;z.verbose&&console.error(`${ls("fetch")} ${n}`);let i=await ur(n,Mh(r));if(i!=null&&i.ok)return z.verbose&&console.error(`${rr("done")} ${n}`),[await i.json(),e,null,t];throw i!=null&&i.status&&(i!=null&&i.statusText)?new Error(`Received ${i.status} ${i.statusText} for ${t} from PyPi`):new Error(`Unable to fetch ${t} from PyPi`)}function hy({repository:t,homepage:e,info:r},n,i){r&&(t=r.project_urls.repository||r.project_urls.Repository||r.project_urls.repo||r.project_urls.Repo||r.project_urls.source||r.project_urls.Source||r.project_urls["source code"]||r.project_urls["Source Code"]||r.project_urls.homepage||r.project_urls.Homepage||`https://pypi.org/project/${i}/`);let a;if(n==="https://npm.pkg.github.com")return`https://github.com/${i.replace(/^@/,"")}`;if(t){let h=typeof t=="string"?t:t.url,f=ry(h);f!=null&&f.browse&&(a=f.browse()),a&&t.directory&&f.treepath&&(a=`${a}/${f.treepath}/HEAD/${t.directory}`),!a&&(t!=null&&t.url)&&/^https?:/.test(t.url)&&(a=t.url)}let u=a||e||"";if(u){let h=new URL(u);h.protocol==="http:"&&h.hostname==="github.com"&&(h.protocol="https:",u=String(h))}return u}function Oe(t,e={}){let r={},n=t instanceof Error;typeof t=="string"?r.message=t:n&&(r.error=t.stack||t.message);for(let i of Object.values(e))"oldPrint"in i&&(i.old=i.oldPrint,delete i.oldPrint),"newPrint"in i&&(i.new=i.newPrint,delete i.newPrint),"oldOriginal"in i&&(i.old=i.oldOriginal,delete i.oldOriginal);if(z.json){if(!n){r.results={};for(let[i,a]of Object.entries(e)){let[u,h]=i.split(ct);r.results[u]||(r.results[u]={}),r.results[u][h]=a}}console.info(JSON.stringify(r))}else Object.keys(e).length&&!n&&console.info(dy(e)),(r.message||r.error)&&(r.message?console.info(r.message):r.error&&console.info(Ui(r.error)));z["error-on-outdated"]?Yr(Object.keys(e).length?2:0):z["error-on-unchanged"]?Yr(Object.keys(e).length?0:2):Yr(r.error?1:0)}function fy(t,e){let r=Zb()==="win32";r&&Qb(t,0),Kb(t,e,r?{flag:"r+"}:void 0)}function vh(t,e,r){let n=t.split(/\./),i=e.split(/\./),a=r?rr:Ui,u=/^[0-9a-zA-Z-.]+$/,h="";for(let f=0;f<n.length;f++)if(n[f]!==i[f]){u.test(n[f])?h+=a(n.slice(f).join(".")):h+=n[f].split("").map(c=>u.test(c)?a(c):c).join("")+a(`.${n.slice(f+1).join(".")}`);break}else h+=`${n[f]}.`;return h}function dy(t){let e=[["NAME","OLD","NEW","AGE","INFO"]];for(let[r,n]of Object.entries(t))e.push([r.split(ct)[1],vh(n.old,n.new,!1),vh(n.new,n.old,!0),n.age||"",n.info]);return(0,Nh.default)(e,{hsep:" ",stringLength:r=>r.replace(Ws(),"").length})}function py(t,e){let r=t;for(let n of Object.keys(e)){let i=n.split(ct)[1],a=e[n].oldOriginal||e[n].old,u=new RegExp(`"${Th(i)}": +"${Th(a)}"`,"g");r=r.replace(u,`"${i}": "${e[n].new}"`)}return r}function my(t,e){return t.replace(/[0-9]+\.[0-9]+\.[0-9]+(-.+)?/g,e)}function Zi(t){let e=ne.default.parse(t);return e?!!e.prerelease.length:!1}function Wh(t){return/[0-9]+\.[0-9]+\.[0-9]+-.+/.test(t)}function gy(t){try{return ne.default.coerce(t).version}catch{return null}}function by(t,e,{range:r,semvers:n,usePre:i,useRel:a,useGreatest:u}={}){let h=gy(r),f=0;n=new Set(n),i=Wh(r)||i,i&&(n.add("prerelease"),n.has("patch")&&n.add("prepatch"),n.has("minor")&&n.add("preminor"),n.has("major")&&n.add("premajor"));for(let c of e){let g=ne.default.parse(c);if(g.prerelease.length&&(!i||a))continue;let b=ne.default.diff(h,g.version);if(!(!b||!n.has(b)))if(u||!("time"in t))ne.default.gte(ne.default.coerce(g.version).version,h)&&(h=g.version);else{let m=new Date(t.time[c]).getTime();m>=0&&m>f&&(h=g.version,f=m)}}return h||null}function xh(t){return ne.default.coerce(t).version}function yy(t,{language:e,range:r,useGreatest:n,useRel:i,usePre:a,semvers:u}={}){var c;if(r==="*"||r.includes("||"))return null;let h=Object.keys(e==="py"?t.releases:t.versions).filter(g=>ne.default.valid(g)),f=by(t,h,{range:r,semvers:u,usePre:a,useRel:i,useGreatest:n});if(n)return f;{let g;e==="py"?g=xh(t.info.version):g=t["dist-tags"].latest;let b=xh(r),m=Wh(r),p=Zi(f),_=Zi(g),R=ne.default.gt(f,b);if(!i&&a||m&&p||i&&!R&&m&&!p||m&&!p&&R)return f;if(m&&!p&&!R)return null;let E=ne.default.diff(b,g);return E&&E!=="prerelease"&&!u.has(E.replace(/^pre/,""))||i&&Zi(g)?f:ne.default.lt(g,b)&&!_?lr===!0||(c=lr==null?void 0:lr.has)!=null&&c.call(lr,t.name)?g:null:g}}async function _y([t,e],{useGreatest:r}={}){var f,c;let n=e.old.replace(ey,""),[i,a,u,h]=ty.exec(n)||[];if(!(!a||!u||!h))if(Ji.test(h)){let g={maxSockets:Uh},b=fs.UPDATES_GITHUB_API_TOKEN||fs.GITHUB_API_TOKEN||fs.GH_TOKEN||fs.HOMEBREW_GITHUB_API_TOKEN;b&&(g.headers={Authorization:`Bearer ${b}`});let m=`${Ah}/repos/${a}/${u}/commits`;z.verbose&&console.error(`${ls("fetch")} ${m}`);let p=await ur(m,g);if(z.verbose&&(p!=null&&p.ok)&&console.error(`${rr("done")} ${m}`),!p||!p.ok)return;let _=await p.json(),{sha:R,commit:E}=_[0];if(!R||!R.length)return;let A=((f=E==null?void 0:E.committer)==null?void 0:f.date)??((c=E==null?void 0:E.author)==null?void 0:c.date);if(R=R.substring(0,h.length),h!==R){let N=e.old.replace(h,R);return{key:t,newRange:N,user:a,repo:u,oldRef:h,newRef:R,newDate:A}}}else{let g=await ur(`${Ah}/repos/${a}/${u}/git/refs/tags`);if(!g||!g.ok)return;let m=(await g.json()).map(_=>_.ref.replace(/^refs\/tags\//,"")),p=h.replace(/^v/,"");if(!ne.default.valid(p))return;if(r){let _=h,R=h.replace(/^v/,"");for(let E of m){let A=E.replace(/^v/,"");ne.default.valid(A)&&(!_||ne.default.gt(A,R))&&(_=E,R=A)}if(ne.default.neq(p,R))return{key:t,newRange:_,user:a,repo:u,oldRef:h,newRef:_}}else{let _=m[m.length-1],R=_.replace(/^v/,"");if(!ne.default.valid(R))return;if(ne.default.neq(p,R))return{key:t,newRange:_,user:a,repo:u,oldRef:h,newRef:_}}}}function wy(t){let e=t.match(/(@[^/]+\/)?([^/]+)/g)||[];return e[e.length-1]}function Sy(t){let e=t.match(Eh);return(e==null?void 0:e.length)!==1?t:t.replace(Eh,ne.default.coerce(e[0]))}function cr(t){return t===void 0?!1:t===""?!0:typeof t=="string"?t.includes(",")?new Set(t.split(",")):new Set([t]):Array.isArray(t)?new Set(t):!1}async function Ry(){var T,L,D,H,V,K,ee,oe,Be,xt;for(let v of[process.stdout,process.stderr])(L=(T=v==null?void 0:v._handle)==null?void 0:T.setBlocking)==null||L.call(T,!0);let{help:t,version:e,language:r,file:n,types:i,update:a}=z;if(t&&(kb.write(`usage: updates [options]
|
|
28
|
+
`),n=!1,i=!1,a;t.on("response",u=>{let{headers:h}=u;n=h["transfer-encoding"]==="chunked"&&!h["content-length"]}),t.on("socket",u=>{let h=()=>{if(n&&!i){let c=new Error("Premature close");c.code="ERR_STREAM_PREMATURE_CLOSE",e(c)}},f=c=>{i=qn.compare(c.slice(-5),r)===0,!i&&a&&(i=qn.compare(a.slice(-3),r.slice(0,3))===0&&qn.compare(c.slice(-2),r.slice(3))===0),a=c};u.prependListener("close",h),u.on("data",f),t.on("close",()=>{u.removeListener("close",h),u.removeListener("data",f)})})}var Lh=Re(Il(),1),$h=Re(Mn(),1),Ph=Re($l(),1),ne=Re(Oc(),1),Nh=Re(Nc(),1),Dh=Re(Yc(),1);import{cwd as Wb,stdout as kb,argv as jb,env as fs,exit as Yr,versions as Vb}from"node:process";import{join as ds,dirname as Hh,basename as Gb}from"node:path";import{lstatSync as Yb,readFileSync as Sh,truncateSync as Qb,writeFileSync as Kb,accessSync as Xb}from"node:fs";import{platform as Zb}from"node:os";import{rootCertificates as Rh}from"node:tls";var vb=[[1e3,6e4,"sec"],[6e4,36e5,"min"],[36e5,864e5,"hour"],[864e5,6048e5,"day"],[6048e5,2628e6,"week"],[2628e6,31536e6,"month"],[31536e6,1/0,"year"]],xb={"1 day ago":"yesterday","1 week ago":"last week","1 month ago":"last month","1 year ago":"last year","in 1 day":"tomorrow","in 1 week":"next week","in 1 month":"next month","in 1 year":"next year"};function os(t,{noAffix:e=!1,times:r=vb,nowThreshold:n=1e4,nowString:i="now",aliases:a=!1,aliasesMap:u=xb}={}){let h=Date.now();if(t=typeof t=="number"?t:Date.parse(t),Number.isNaN(t))return"unknown";let f=!1,c=h-t;if(c<0&&(f=!0,c=Math.abs(c)),c<n)return i;let g,b;for(let p=0,_=r.length;p<_;p++){let R=r[p];if(!(c>=R[1])){g=Math.floor(c/R[0]),b=R[2]+(g>1?"s":"");break}}let m=`${f&&!e?"in ":""}${g} ${b}${!f&&!e?" ago":""}`;return a?u[m]??m:m}import Fi from"node:process";import Ob from"node:os";import Qc from"node:tty";function ve(t,e=globalThis.Deno?globalThis.Deno.args:Fi.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}var{env:X}=Fi,as;ve("no-color")||ve("no-colors")||ve("color=false")||ve("color=never")?as=0:(ve("color")||ve("colors")||ve("color=true")||ve("color=always"))&&(as=1);function Ib(){if("FORCE_COLOR"in X)return X.FORCE_COLOR==="true"?1:X.FORCE_COLOR==="false"?0:X.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(X.FORCE_COLOR,10),3)}function Lb(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function $b(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let n=Ib();n!==void 0&&(as=n);let i=r?as:n;if(i===0)return 0;if(r){if(ve("color=16m")||ve("color=full")||ve("color=truecolor"))return 3;if(ve("color=256"))return 2}if("TF_BUILD"in X&&"AGENT_NAME"in X)return 1;if(t&&!e&&i===void 0)return 0;let a=i||0;if(X.TERM==="dumb")return a;if(Fi.platform==="win32"){let u=Ob.release().split(".");return Number(u[0])>=10&&Number(u[2])>=10586?Number(u[2])>=14931?3:2:1}if("CI"in X)return"GITHUB_ACTIONS"in X?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(u=>u in X)||X.CI_NAME==="codeship"?1:a;if("TEAMCITY_VERSION"in X)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(X.TEAMCITY_VERSION)?1:0;if(X.COLORTERM==="truecolor"||X.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in X){let u=Number.parseInt((X.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(X.TERM_PROGRAM){case"iTerm.app":return u>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(X.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(X.TERM)||"COLORTERM"in X?1:a}function Kc(t,e={}){let r=$b(t,{streamIsTTY:t&&t.isTTY,...e});return Lb(r)}var Pb={stdout:Kc({isTTY:Qc.isatty(1)}),stderr:Kc({isTTY:Qc.isatty(2)})},Xc=Pb;var Zc=!0;function Jc(){Zc=!1}function qi(t,e,r){return Zc?`\x1B[${e}m${t}\x1B[${r}m`:t}var Ui=t=>qi(t,31,39),rr=t=>qi(t,32,39);var ls=t=>qi(t,35,39);var Bh=Re(gh(),1);var qb=t=>{let e=typeof t;return t!==null&&(e==="object"||e==="function")};var ki=new Set(["__proto__","prototype","constructor"]),Ub=new Set("0123456789");function zb(t){let e=[],r="",n="start",i=!1;for(let a of t)switch(a){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");i&&(r+=a),n="property",i=!i;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(i){i=!1,r+=a;break}if(ki.has(r))return[];e.push(r),r="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(i){i=!1,r+=a;break}if(n==="property"){if(ki.has(r))return[];e.push(r),r=""}n="index";break}case"]":{if(n==="index"){e.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!Ub.has(a))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),i&&(i=!1,r+="\\"),r+=a}}switch(i&&(r+="\\"),n){case"property":{if(ki.has(r))return[];e.push(r);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function Mb(t,e){if(typeof e!="number"&&Array.isArray(t)){let r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return!1}function bh(t,e,r){if(!qb(t)||typeof e!="string")return r===void 0?t:r;let n=zb(e);if(n.length===0)return r;for(let i=0;i<n.length;i++){let a=n[i];if(Mb(t,a)?t=i===n.length-1?void 0:null:t=t[a],t==null){if(i!==n.length-1)return r;break}}return t===void 0?r:t}var ji=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},yh=t=>globalThis.DOMException===void 0?new ji(t):new DOMException(t),_h=t=>{let e=t.reason===void 0?yh("This operation was aborted."):t.reason;return e instanceof Error?e:yh(e)};async function Vi(t,e,{concurrency:r=Number.POSITIVE_INFINITY,stopOnError:n=!0,signal:i}={}){return new Promise((a,u)=>{if(t[Symbol.iterator]===void 0&&t[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof t})`);if(typeof e!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(r)||r===Number.POSITIVE_INFINITY)&&r>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${r}\` (${typeof r})`);let h=[],f=[],c=new Map,g=!1,b=!1,m=!1,p=0,_=0,R=t[Symbol.iterator]===void 0?t[Symbol.asyncIterator]():t[Symbol.iterator](),E=N=>{g=!0,b=!0,u(N)};i&&(i.aborted&&E(_h(i)),i.addEventListener("abort",()=>{E(_h(i))}));let A=async()=>{if(b)return;let N=await R.next(),$=_;if(_++,N.done){if(m=!0,p===0&&!b){if(!n&&f.length>0){E(new AggregateError(f));return}if(b=!0,c.size===0){a(h);return}let T=[];for(let[L,D]of h.entries())c.get(L)!==wh&&T.push(D);a(T)}return}p++,(async()=>{try{let T=await N.value;if(b)return;let L=await e(T,$);L===wh&&c.set($,L),h[$]=L,p--,await A()}catch(T){if(n)E(T);else{f.push(T),p--;try{await A()}catch(L){E(L)}}}})()};(async()=>{for(let N=0;N<r;N++){try{await A()}catch($){E($);break}if(m||g)break}})()})}var wh=Symbol("skip");async function Gi(t,e){return Vi(t,r=>r(),e)}function sr(t,e){var r=0,n,i;e=e||{};function a(){var u=n,h=arguments.length,f,c;e:for(;u;){if(u.args.length!==arguments.length){u=u.next;continue}for(c=0;c<h;c++)if(u.args[c]!==arguments[c]){u=u.next;continue e}return u!==n&&(u===i&&(i=u.prev),u.prev.next=u.next,u.next&&(u.next.prev=u.prev),u.next=n,u.prev=null,n.prev=u,n=u),u.val}for(f=new Array(h),c=0;c<h;c++)f[c]=arguments[c];return u={args:f,val:t.apply(null,f)},n?(n.prev=u,u.next=n):i=u,r===e.maxSize?(i=i.prev,i.next=null):r++,n=u,u.val}return a.clear=function(){n=null,i=null,r=0},a}var{fromUrl:Jb}=Dh.default,ur,Oh;globalThis.fetch&&!((Oh=Vb)!=null&&Oh.node)?ur=globalThis.fetch:ur=Ks(Un,{undici:!1});var Fh=96,ct="\0",ey=/^.*?:\/\/(.*?@)?(github\.com[:/])/i,ty=/^([^/]+)\/([^/#]+)?.*?\/([0-9a-f]+|v?[0-9]+\.[0-9]+\.[0-9]+)$/i,Ji=/^[0-9a-f]{7,}$/i,Eh=/[0-9]+(\.[0-9]+)?(\.[0-9]+)?/g,Th=t=>t.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&"),ry=sr(Jb),Yi=sr(Lh.default),ny=sr(Ph.default),ps=sr(t=>t.endsWith("/")?t.substring(0,t.length-1):t),sy=new Set(["patch"]),iy=new Set(["patch","minor"]),oy=new Set(["patch","minor","major"]),qh="14.2.4",xe={},z=(0,Ih.default)(jb.slice(2),{boolean:["E","error-on-outdated","U","error-on-unchanged","h","help","j","json","n","no-color","u","update","v","version","V","verbose"],string:["d","allow-downgrade","f","file","g","greatest","l","language","m","minor","P","patch","p","prerelease","R","release","r","registry","t","types","githubapi","pypiapi"],alias:{d:"allow-downgrade",E:"error-on-outdated",U:"error-on-unchanged",e:"exclude",f:"file",g:"greatest",h:"help",i:"include",j:"json",l:"language",m:"minor",n:"no-color",P:"patch",p:"prerelease",r:"registry",R:"release",s:"semver",S:"sockets",t:"types",u:"update",v:"version",V:"verbose"}});(z["no-color"]||!Xc.stdout)&&Jc();var ir=cr(z.greatest),Qi=cr(z.prerelease),Ki=cr(z.release),or=cr(z.patch),ar=cr(z.minor),lr=cr(z["allow-downgrade"]),ze=(0,$h.default)("npm",{registry:"https://registry.npmjs.org"}),Xi={npmrc:ze,recursive:!0},Ah=z.githubapi?ps(z.githubapi):"https://api.github.com",ay=z.pypiapi?ps(z.pypiapi):"https://pypi.org",Uh=typeof z.sockets=="number"?parseInt(z.sockets):Fh;function Ch(t){return Array.from(t.matchAll(/(----BEGIN CERT[^]+?IFICATE----)/g),e=>e[0])}function zh(t,e,r){let n=ds(e,t);try{return Xb(n),n}catch{}let i=Hh(e);return r&&n===r||i===e?null:zh(t,i,r)}function ly(t,e){if(t.startsWith("@")){let r=(/@[a-z0-9][\w-.]+/.exec(t)||[])[0],n=ps(ny(r,ze));if(n!==e)try{let i=Yi(n,Xi);if(i!=null&&i.token)return[i,n]}catch{}return[Yi(e,Xi),e]}else return[Yi(e,Xi),e]}var Mh=sr((t,e,r)=>({...Object.keys(t).length&&{agentOpts:t},headers:{"user-agent":`updates/${qh}`,...r&&{Authorization:`${e} ${r}`}}}));async function uy(t,e,r,n){let[i,a]=ly(t,r),h=(e==="resolutions"?wy(t):t).replace(/\//g,"%2f"),f=`${a}/${h}`;z.verbose&&console.error(`${ls("fetch")} ${f}`);let c=await ur(f,Mh(n,i==null?void 0:i.type,i==null?void 0:i.token));if(c!=null&&c.ok)return z.verbose&&console.error(`${rr("done")} ${f}`),[await c.json(),e,a,t];throw c!=null&&c.status&&(c!=null&&c.statusText)?new Error(`Received ${c.status} ${c.statusText} for ${t} from ${a}`):new Error(`Unable to fetch ${t} from ${a}`)}async function cy(t,e,r){let n=`${ay}/pypi/${t}/json`;z.verbose&&console.error(`${ls("fetch")} ${n}`);let i=await ur(n,Mh(r));if(i!=null&&i.ok)return z.verbose&&console.error(`${rr("done")} ${n}`),[await i.json(),e,null,t];throw i!=null&&i.status&&(i!=null&&i.statusText)?new Error(`Received ${i.status} ${i.statusText} for ${t} from PyPi`):new Error(`Unable to fetch ${t} from PyPi`)}function hy({repository:t,homepage:e,info:r},n,i){r&&(t=r.project_urls.repository||r.project_urls.Repository||r.project_urls.repo||r.project_urls.Repo||r.project_urls.source||r.project_urls.Source||r.project_urls["source code"]||r.project_urls["Source Code"]||r.project_urls.homepage||r.project_urls.Homepage||`https://pypi.org/project/${i}/`);let a;if(n==="https://npm.pkg.github.com")return`https://github.com/${i.replace(/^@/,"")}`;if(t){let h=typeof t=="string"?t:t.url,f=ry(h);f!=null&&f.browse&&(a=f.browse()),a&&t.directory&&f.treepath&&(a=`${a}/${f.treepath}/HEAD/${t.directory}`),!a&&(t!=null&&t.url)&&/^https?:/.test(t.url)&&(a=t.url)}let u=a||e||"";if(u){let h=new URL(u);h.protocol==="http:"&&h.hostname==="github.com"&&(h.protocol="https:",u=String(h))}return u}function Oe(t,e={}){let r={},n=t instanceof Error;typeof t=="string"?r.message=t:n&&(r.error=t.stack||t.message);for(let i of Object.values(e))"oldPrint"in i&&(i.old=i.oldPrint,delete i.oldPrint),"newPrint"in i&&(i.new=i.newPrint,delete i.newPrint),"oldOriginal"in i&&(i.old=i.oldOriginal,delete i.oldOriginal);if(z.json){if(!n){r.results={};for(let[i,a]of Object.entries(e)){let[u,h]=i.split(ct);r.results[u]||(r.results[u]={}),r.results[u][h]=a}}console.info(JSON.stringify(r))}else Object.keys(e).length&&!n&&console.info(dy(e)),(r.message||r.error)&&(r.message?console.info(r.message):r.error&&console.info(Ui(r.error)));z["error-on-outdated"]?Yr(Object.keys(e).length?2:0):z["error-on-unchanged"]?Yr(Object.keys(e).length?0:2):Yr(r.error?1:0)}function fy(t,e){let r=Zb()==="win32";r&&Qb(t,0),Kb(t,e,r?{flag:"r+"}:void 0)}function vh(t,e,r){let n=t.split(/\./),i=e.split(/\./),a=r?rr:Ui,u=/^[0-9a-zA-Z-.]+$/,h="";for(let f=0;f<n.length;f++)if(n[f]!==i[f]){u.test(n[f])?h+=a(n.slice(f).join(".")):h+=n[f].split("").map(c=>u.test(c)?a(c):c).join("")+a(`.${n.slice(f+1).join(".")}`);break}else h+=`${n[f]}.`;return h}function dy(t){let e=[["NAME","OLD","NEW","AGE","INFO"]];for(let[r,n]of Object.entries(t))e.push([r.split(ct)[1],vh(n.old,n.new,!1),vh(n.new,n.old,!0),n.age||"",n.info]);return(0,Nh.default)(e,{hsep:" ",stringLength:r=>r.replace(Ws(),"").length})}function py(t,e){let r=t;for(let n of Object.keys(e)){let i=n.split(ct)[1],a=e[n].oldOriginal||e[n].old,u=new RegExp(`"${Th(i)}": +"${Th(a)}"`,"g");r=r.replace(u,`"${i}": "${e[n].new}"`)}return r}function my(t,e){return t.replace(/[0-9]+\.[0-9]+\.[0-9]+(-.+)?/g,e)}function Zi(t){let e=ne.default.parse(t);return e?!!e.prerelease.length:!1}function Wh(t){return/[0-9]+\.[0-9]+\.[0-9]+-.+/.test(t)}function gy(t){try{return ne.default.coerce(t).version}catch{return null}}function by(t,e,{range:r,semvers:n,usePre:i,useRel:a,useGreatest:u}={}){let h=gy(r),f=0;n=new Set(n),i=Wh(r)||i,i&&(n.add("prerelease"),n.has("patch")&&n.add("prepatch"),n.has("minor")&&n.add("preminor"),n.has("major")&&n.add("premajor"));for(let c of e){let g=ne.default.parse(c);if(g.prerelease.length&&(!i||a))continue;let b=ne.default.diff(h,g.version);if(!(!b||!n.has(b)))if(u||!("time"in t))ne.default.gte(ne.default.coerce(g.version).version,h)&&(h=g.version);else{let m=new Date(t.time[c]).getTime();m>=0&&m>f&&(h=g.version,f=m)}}return h||null}function xh(t){return ne.default.coerce(t).version}function yy(t,{language:e,range:r,useGreatest:n,useRel:i,usePre:a,semvers:u}={}){var c;if(r==="*"||r.includes("||"))return null;let h=Object.keys(e==="py"?t.releases:t.versions).filter(g=>ne.default.valid(g)),f=by(t,h,{range:r,semvers:u,usePre:a,useRel:i,useGreatest:n});if(n)return f;{let g;e==="py"?g=xh(t.info.version):g=t["dist-tags"].latest;let b=xh(r),m=Wh(r),p=Zi(f),_=Zi(g),R=ne.default.gt(f,b);if(!i&&a||m&&p||i&&!R&&m&&!p||m&&!p&&R)return f;if(m&&!p&&!R)return null;let E=ne.default.diff(b,g);return E&&E!=="prerelease"&&!u.has(E.replace(/^pre/,""))||i&&Zi(g)?f:ne.default.lt(g,b)&&!_?lr===!0||(c=lr==null?void 0:lr.has)!=null&&c.call(lr,t.name)?g:null:g}}async function _y([t,e],{useGreatest:r}={}){var f,c;let n=e.old.replace(ey,""),[i,a,u,h]=ty.exec(n)||[];if(!(!a||!u||!h))if(Ji.test(h)){let g={maxSockets:Uh},b=fs.UPDATES_GITHUB_API_TOKEN||fs.GITHUB_API_TOKEN||fs.GH_TOKEN||fs.HOMEBREW_GITHUB_API_TOKEN;b&&(g.headers={Authorization:`Bearer ${b}`});let m=`${Ah}/repos/${a}/${u}/commits`;z.verbose&&console.error(`${ls("fetch")} ${m}`);let p=await ur(m,g);if(z.verbose&&(p!=null&&p.ok)&&console.error(`${rr("done")} ${m}`),!p||!p.ok)return;let _=await p.json(),{sha:R,commit:E}=_[0];if(!R||!R.length)return;let A=((f=E==null?void 0:E.committer)==null?void 0:f.date)??((c=E==null?void 0:E.author)==null?void 0:c.date);if(R=R.substring(0,h.length),h!==R){let N=e.old.replace(h,R);return{key:t,newRange:N,user:a,repo:u,oldRef:h,newRef:R,newDate:A}}}else{let g=await ur(`${Ah}/repos/${a}/${u}/git/refs/tags`);if(!g||!g.ok)return;let m=(await g.json()).map(_=>_.ref.replace(/^refs\/tags\//,"")),p=h.replace(/^v/,"");if(!ne.default.valid(p))return;if(r){let _=h,R=h.replace(/^v/,"");for(let E of m){let A=E.replace(/^v/,"");ne.default.valid(A)&&(!_||ne.default.gt(A,R))&&(_=E,R=A)}if(ne.default.neq(p,R))return{key:t,newRange:_,user:a,repo:u,oldRef:h,newRef:_}}else{let _=m[m.length-1],R=_.replace(/^v/,"");if(!ne.default.valid(R))return;if(ne.default.neq(p,R))return{key:t,newRange:_,user:a,repo:u,oldRef:h,newRef:_}}}}function wy(t){let e=t.match(/(@[^/]+\/)?([^/]+)/g)||[];return e[e.length-1]}function Sy(t){let e=t.match(Eh);return(e==null?void 0:e.length)!==1?t:t.replace(Eh,ne.default.coerce(e[0]))}function cr(t){return t===void 0?!1:t===""?!0:typeof t=="string"?t.includes(",")?new Set(t.split(",")):new Set([t]):Array.isArray(t)?new Set(t):!1}async function Ry(){var T,L,D,H,V,K,ee,oe,Be,xt;for(let v of[process.stdout,process.stderr])(L=(T=v==null?void 0:v._handle)==null?void 0:T.setBlocking)==null||L.call(T,!0);let{help:t,version:e,language:r,file:n,types:i,update:a}=z;if(t&&(kb.write(`usage: updates [options]
|
|
29
29
|
|
|
30
30
|
Options:
|
|
31
|
+
-l, --language <lang> Language to check, either 'js' or 'py'
|
|
31
32
|
-u, --update Update versions and write package file
|
|
32
33
|
-p, --prerelease [<pkg,...>] Consider prerelease versions
|
|
33
34
|
-R, --release [<pkg,...>] Only use release versions, may downgrade
|
|
@@ -35,7 +36,6 @@ Content-Type: ${a.type||"application/octet-stream"}\r
|
|
|
35
36
|
-i, --include <pkg,...> Include only given packages
|
|
36
37
|
-e, --exclude <pkg,...> Exclude given packages
|
|
37
38
|
-t, --types <type,...> Check only given dependency types
|
|
38
|
-
-l, --language <lang> Language to check, either 'js' or 'py'
|
|
39
39
|
-P, --patch [<pkg,...>] Consider only up to semver-patch
|
|
40
40
|
-m, --minor [<pkg,...>] Consider only up to semver-minor
|
|
41
41
|
-d, --allow-downgrade [<pkg,...>] Allow version downgrades when using latest version
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "updates",
|
|
3
|
-
"version": "14.2.
|
|
4
|
-
"description": "Flexible npm dependency update tool",
|
|
3
|
+
"version": "14.2.4",
|
|
4
|
+
"description": "Flexible npm and poetry dependency update tool",
|
|
5
5
|
"author": "silverwind",
|
|
6
6
|
"repository": "silverwind/updates",
|
|
7
7
|
"license": "BSD-2-Clause",
|