diff --git a/dist/index.js b/dist/index.js index 3096e91..21298d5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -18,7 +18,7 @@ Content-Type: ${v.type||"application/octet-stream"}\r `)),c.push(`--${b}--`),new B(c,{type:"multipart/form-data; boundary="+b})}async function consumeBody(data){if(data[INTERNALS$2].disturbed)throw new TypeError(`body used already for: ${data.url}`);if(data[INTERNALS$2].disturbed=!0,data[INTERNALS$2].error)throw data[INTERNALS$2].error;let{body}=data;if(body===null)return import_node_buffer.Buffer.alloc(0);if(!(body instanceof import_node_stream.default))return import_node_buffer.Buffer.alloc(0);let accum=[],accumBytes=0;try{for await(let chunk of body){if(data.size>0&&accumBytes+chunk.length>data.size){let error=new FetchError(`content size at ${data.url} over limit: ${data.size}`,"max-size");throw body.destroy(error),error}accumBytes+=chunk.length,accum.push(chunk)}}catch(error){throw error instanceof FetchBaseError?error:new FetchError(`Invalid response body while trying to fetch ${data.url}: ${error.message}`,"system",error)}if(body.readableEnded===!0||body._readableState.ended===!0)try{return accum.every(c=>typeof c=="string")?import_node_buffer.Buffer.from(accum.join("")):import_node_buffer.Buffer.concat(accum,accumBytes)}catch(error){throw new FetchError(`Could not create Buffer from response body for ${data.url}: ${error.message}`,"system",error)}else throw new FetchError(`Premature close of server response while trying to fetch ${data.url}`)}function fromRawHeaders(headers=[]){return new Headers(headers.reduce((result,value,index,array)=>(index%2===0&&result.push(array.slice(index,index+2)),result),[]).filter(([name,value])=>{try{return validateHeaderName(name),validateHeaderValue(name,String(value)),!0}catch{return!1}}))}function stripURLForUseAsAReferrer(url,originOnly=!1){return url==null||(url=new URL(url),/^(about|blob|data):$/.test(url.protocol))?"no-referrer":(url.username="",url.password="",url.hash="",originOnly&&(url.pathname="",url.search=""),url)}function validateReferrerPolicy(referrerPolicy){if(!ReferrerPolicy.has(referrerPolicy))throw new TypeError(`Invalid referrerPolicy: ${referrerPolicy}`);return referrerPolicy}function isOriginPotentiallyTrustworthy(url){if(/^(http|ws)s:$/.test(url.protocol))return!0;let hostIp=url.host.replace(/(^\[)|(]$)/g,""),hostIPVersion=(0,import_node_net.isIP)(hostIp);return hostIPVersion===4&&/^127\./.test(hostIp)||hostIPVersion===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(hostIp)?!0:url.host==="localhost"||url.host.endsWith(".localhost")?!1:url.protocol==="file:"}function isUrlPotentiallyTrustworthy(url){return/^about:(blank|srcdoc)$/.test(url)||url.protocol==="data:"||/^(blob|filesystem):$/.test(url.protocol)?!0:isOriginPotentiallyTrustworthy(url)}function determineRequestsReferrer(request,{referrerURLCallback,referrerOriginCallback}={}){if(request.referrer==="no-referrer"||request.referrerPolicy==="")return null;let policy=request.referrerPolicy;if(request.referrer==="about:client")return"no-referrer";let referrerSource=request.referrer,referrerURL=stripURLForUseAsAReferrer(referrerSource),referrerOrigin=stripURLForUseAsAReferrer(referrerSource,!0);referrerURL.toString().length>4096&&(referrerURL=referrerOrigin),referrerURLCallback&&(referrerURL=referrerURLCallback(referrerURL)),referrerOriginCallback&&(referrerOrigin=referrerOriginCallback(referrerOrigin));let currentURL=new URL(request.url);switch(policy){case"no-referrer":return"no-referrer";case"origin":return referrerOrigin;case"unsafe-url":return referrerURL;case"strict-origin":return isUrlPotentiallyTrustworthy(referrerURL)&&!isUrlPotentiallyTrustworthy(currentURL)?"no-referrer":referrerOrigin.toString();case"strict-origin-when-cross-origin":return referrerURL.origin===currentURL.origin?referrerURL:isUrlPotentiallyTrustworthy(referrerURL)&&!isUrlPotentiallyTrustworthy(currentURL)?"no-referrer":referrerOrigin;case"same-origin":return referrerURL.origin===currentURL.origin?referrerURL:"no-referrer";case"origin-when-cross-origin":return referrerURL.origin===currentURL.origin?referrerURL:referrerOrigin;case"no-referrer-when-downgrade":return isUrlPotentiallyTrustworthy(referrerURL)&&!isUrlPotentiallyTrustworthy(currentURL)?"no-referrer":referrerURL;default:throw new TypeError(`Invalid referrerPolicy: ${policy}`)}}function parseReferrerPolicyFromHeader(headers){let policyTokens=(headers.get("referrer-policy")||"").split(/[,\s]+/),policy="";for(let token of policyTokens)token&&ReferrerPolicy.has(token)&&(policy=token);return policy}async function fetch(url,options_){return new Promise((resolve,reject)=>{let request=new Request(url,options_),{parsedURL,options}=getNodeRequestOptions(request);if(!supportedSchemas.has(parsedURL.protocol))throw new TypeError(`node-fetch cannot load ${url}. URL scheme "${parsedURL.protocol.replace(/:$/,"")}" is not supported.`);if(parsedURL.protocol==="data:"){let data=dataUriToBuffer(request.url),response2=new Response(data,{headers:{"Content-Type":data.typeFull}});resolve(response2);return}let send=(parsedURL.protocol==="https:"?import_node_https.default:import_node_http.default).request,{signal}=request,response=null,abort=()=>{let error=new AbortError("The operation was aborted.");reject(error),request.body&&request.body instanceof import_node_stream.default.Readable&&request.body.destroy(error),!(!response||!response.body)&&response.body.emit("error",error)};if(signal&&signal.aborted){abort();return}let abortAndFinalize=()=>{abort(),finalize()},request_=send(parsedURL.toString(),options);signal&&signal.addEventListener("abort",abortAndFinalize);let finalize=()=>{request_.abort(),signal&&signal.removeEventListener("abort",abortAndFinalize)};request_.on("error",error=>{reject(new FetchError(`request to ${request.url} failed, reason: ${error.message}`,"system",error)),finalize()}),fixResponseChunkedTransferBadEnding(request_,error=>{response&&response.body&&response.body.destroy(error)}),process.version<"v14"&&request_.on("socket",s2=>{let endedWithEventsCount;s2.prependListener("end",()=>{endedWithEventsCount=s2._eventsCount}),s2.prependListener("close",hadError=>{if(response&&endedWithEventsCount{request_.setTimeout(0);let headers=fromRawHeaders(response_.rawHeaders);if(isRedirect(response_.statusCode)){let location=headers.get("Location"),locationURL=null;try{locationURL=location===null?null:new URL(location,request.url)}catch{if(request.redirect!=="manual"){reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`,"invalid-redirect")),finalize();return}}switch(request.redirect){case"error":reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`,"no-redirect")),finalize();return;case"manual":break;case"follow":{if(locationURL===null)break;if(request.counter>=request.follow){reject(new FetchError(`maximum redirect reached at: ${request.url}`,"max-redirect")),finalize();return}let requestOptions={headers:new Headers(request.headers),follow:request.follow,counter:request.counter+1,agent:request.agent,compress:request.compress,method:request.method,body:clone(request),signal:request.signal,size:request.size,referrer:request.referrer,referrerPolicy:request.referrerPolicy};if(!isDomainOrSubdomain(request.url,locationURL)||!isSameProtocol(request.url,locationURL))for(let name of["authorization","www-authenticate","cookie","cookie2"])requestOptions.headers.delete(name);if(response_.statusCode!==303&&request.body&&options_.body instanceof import_node_stream.default.Readable){reject(new FetchError("Cannot follow redirect with body being a readable stream","unsupported-redirect")),finalize();return}(response_.statusCode===303||(response_.statusCode===301||response_.statusCode===302)&&request.method==="POST")&&(requestOptions.method="GET",requestOptions.body=void 0,requestOptions.headers.delete("content-length"));let responseReferrerPolicy=parseReferrerPolicyFromHeader(headers);responseReferrerPolicy&&(requestOptions.referrerPolicy=responseReferrerPolicy),resolve(fetch(new Request(locationURL,requestOptions))),finalize();return}default:return reject(new TypeError(`Redirect option '${request.redirect}' is not a valid value of RequestRedirect`))}}signal&&response_.once("end",()=>{signal.removeEventListener("abort",abortAndFinalize)});let body=(0,import_node_stream.pipeline)(response_,new import_node_stream.PassThrough,error=>{error&&reject(error)});process.version<"v12.10"&&response_.on("aborted",abortAndFinalize);let responseOptions={url:request.url,status:response_.statusCode,statusText:response_.statusMessage,headers,size:request.size,counter:request.counter,highWaterMark:request.highWaterMark},codings=headers.get("Content-Encoding");if(!request.compress||request.method==="HEAD"||codings===null||response_.statusCode===204||response_.statusCode===304){response=new Response(body,responseOptions),resolve(response);return}let zlibOptions={flush:import_node_zlib.default.Z_SYNC_FLUSH,finishFlush:import_node_zlib.default.Z_SYNC_FLUSH};if(codings==="gzip"||codings==="x-gzip"){body=(0,import_node_stream.pipeline)(body,import_node_zlib.default.createGunzip(zlibOptions),error=>{error&&reject(error)}),response=new Response(body,responseOptions),resolve(response);return}if(codings==="deflate"||codings==="x-deflate"){let raw=(0,import_node_stream.pipeline)(response_,new import_node_stream.PassThrough,error=>{error&&reject(error)});raw.once("data",chunk=>{(chunk[0]&15)===8?body=(0,import_node_stream.pipeline)(body,import_node_zlib.default.createInflate(),error=>{error&&reject(error)}):body=(0,import_node_stream.pipeline)(body,import_node_zlib.default.createInflateRaw(),error=>{error&&reject(error)}),response=new Response(body,responseOptions),resolve(response)}),raw.once("end",()=>{response||(response=new Response(body,responseOptions),resolve(response))});return}if(codings==="br"){body=(0,import_node_stream.pipeline)(body,import_node_zlib.default.createBrotliDecompress(),error=>{error&&reject(error)}),response=new Response(body,responseOptions),resolve(response);return}response=new Response(body,responseOptions),resolve(response)}),writeToStream(request_,request).catch(reject)})}function fixResponseChunkedTransferBadEnding(request,errorCallback){let LAST_CHUNK=import_node_buffer.Buffer.from(`0\r \r `),isChunkedTransfer=!1,properLastChunkReceived=!1,previousChunk;request.on("response",response=>{let{headers}=response;isChunkedTransfer=headers["transfer-encoding"]==="chunked"&&!headers["content-length"]}),request.on("socket",socket=>{let onSocketClose=()=>{if(isChunkedTransfer&&!properLastChunkReceived){let error=new Error("Premature close");error.code="ERR_STREAM_PREMATURE_CLOSE",errorCallback(error)}},onData=buf=>{properLastChunkReceived=import_node_buffer.Buffer.compare(buf.slice(-5),LAST_CHUNK)===0,!properLastChunkReceived&&previousChunk&&(properLastChunkReceived=import_node_buffer.Buffer.compare(previousChunk.slice(-3),LAST_CHUNK.slice(0,3))===0&&import_node_buffer.Buffer.compare(buf.slice(-2),LAST_CHUNK.slice(3))===0),previousChunk=buf};socket.prependListener("close",onSocketClose),socket.on("data",onData),request.on("close",()=>{socket.removeListener("close",onSocketClose),socket.removeListener("data",onData)})})}function pd(event){let retv=privateData.get(event);return console.assert(retv!=null,"'this' is expected an Event object, but got",event),retv}function setCancelFlag(data){if(data.passiveListener!=null){typeof console<"u"&&typeof console.error=="function"&&console.error("Unable to preventDefault inside passive event listener invocation.",data.passiveListener);return}data.event.cancelable&&(data.canceled=!0,typeof data.event.preventDefault=="function"&&data.event.preventDefault())}function Event(eventTarget,event){privateData.set(this,{eventTarget,event,eventPhase:2,currentTarget:eventTarget,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:event.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let keys=Object.keys(event);for(let i2=0;i20){let types2=new Array(arguments.length);for(let i2=0;i2{},Object.assign(globalThis,require("node:stream/web")),process2.emitWarning=emitWarning}catch(error){throw process2.emitWarning=emitWarning,error}}catch{Object.assign(globalThis,requirePonyfill_es2018())}try{let{Blob:Blob4}=require("buffer");Blob4&&!Blob4.prototype.stream&&(Blob4.prototype.stream=function(params){let position=0,blob=this;return new ReadableStream({type:"bytes",async pull(ctrl){let buffer=await blob.slice(position,Math.min(blob.size,position+POOL_SIZE$1)).arrayBuffer();position+=buffer.byteLength,ctrl.enqueue(new Uint8Array(buffer)),position===blob.size&&ctrl.close()}})})}catch{}POOL_SIZE=65536;_Blob=class Blob{#parts=[];#type="";#size=0;#endings="transparent";constructor(blobParts=[],options={}){if(typeof blobParts!="object"||blobParts===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof blobParts[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof options!="object"&&typeof options!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");options===null&&(options={});let encoder=new TextEncoder;for(let element of blobParts){let part;ArrayBuffer.isView(element)?part=new Uint8Array(element.buffer.slice(element.byteOffset,element.byteOffset+element.byteLength)):element instanceof ArrayBuffer?part=new Uint8Array(element.slice(0)):element instanceof Blob?part=element:part=encoder.encode(`${element}`),this.#size+=ArrayBuffer.isView(part)?part.byteLength:part.size,this.#parts.push(part)}this.#endings=`${options.endings===void 0?"transparent":options.endings}`;let type=options.type===void 0?"":String(options.type);this.#type=/^[\x20-\x7E]*$/.test(type)?type:""}get size(){return this.#size}get type(){return this.#type}async text(){let decoder=new TextDecoder,str="";for await(let part of toIterator(this.#parts,!1))str+=decoder.decode(part,{stream:!0});return str+=decoder.decode(),str}async arrayBuffer(){let data=new Uint8Array(this.size),offset=0;for await(let chunk of toIterator(this.#parts,!1))data.set(chunk,offset),offset+=chunk.length;return data.buffer}stream(){let it=toIterator(this.#parts,!0);return new globalThis.ReadableStream({type:"bytes",async pull(ctrl){let chunk=await it.next();chunk.done?ctrl.close():ctrl.enqueue(chunk.value)},async cancel(){await it.return()}})}slice(start=0,end=this.size,type=""){let{size}=this,relativeStart=start<0?Math.max(size+start,0):Math.min(start,size),relativeEnd=end<0?Math.max(size+end,0):Math.min(end,size),span=Math.max(relativeEnd-relativeStart,0),parts=this.#parts,blobParts=[],added=0;for(let part of parts){if(added>=span)break;let size2=ArrayBuffer.isView(part)?part.byteLength:part.size;if(relativeStart&&size2<=relativeStart)relativeStart-=size2,relativeEnd-=size2;else{let chunk;ArrayBuffer.isView(part)?(chunk=part.subarray(relativeStart,Math.min(size2,relativeEnd)),added+=chunk.byteLength):(chunk=part.slice(relativeStart,Math.min(size2,relativeEnd)),added+=chunk.size),relativeEnd-=size2,blobParts.push(chunk),relativeStart=0}}let blob=new Blob([],{type:String(type).toLowerCase()});return blob.#size=span,blob.#parts=blobParts,blob}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](object){return object&&typeof object=="object"&&typeof object.constructor=="function"&&(typeof object.stream=="function"||typeof object.arrayBuffer=="function")&&/^(Blob|File)$/.test(object[Symbol.toStringTag])}};Object.defineProperties(_Blob.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});Blob2=_Blob,_Blob$1=Blob2,_File=class extends _Blob$1{#lastModified=0;#name="";constructor(fileBits,fileName,options={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(fileBits,options),options===null&&(options={});let lastModified=options.lastModified===void 0?Date.now():Number(options.lastModified);Number.isNaN(lastModified)||(this.#lastModified=lastModified),this.#name=String(fileName)}get name(){return this.#name}get lastModified(){return this.#lastModified}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](object){return!!object&&object instanceof _Blob$1&&/^(File)$/.test(object[Symbol.toStringTag])}},File2=_File,File$1=File2;({toStringTag:t,iterator:i,hasInstance:h}=Symbol),r=Math.random,m="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),f2=(a,b,c)=>(a+="",/^(Blob|File)$/.test(b&&b[t])?[(c=c!==void 0?c+"":b[t]=="File"?b.name:"blob",a),b.name!==c||b[t]=="blob"?new File$1([b],c,b):b]:[a,b+""]),e=(c,f3)=>(f3?c:c.replace(/\r?\n|\r/g,`\r -`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),x=(n,a,e2)=>{if(a.lengthtypeof o[m2]!="function")}append(...a){x("append",arguments,2),this.#d.push(f2(...a))}delete(a){x("delete",arguments,1),a+="",this.#d=this.#d.filter(([b])=>b!==a)}get(a){x("get",arguments,1),a+="";for(var b=this.#d,l=b.length,c=0;cc[0]===a&&b.push(c[1])),b}has(a){return x("has",arguments,1),a+="",this.#d.some(b=>b[0]===a)}forEach(a,b){x("forEach",arguments,1);for(var[c,d]of this)a.call(b,d,c,this)}set(...a){x("set",arguments,2);var b=[],c=!0;a=f2(...a),this.#d.forEach(d=>{d[0]===a[0]?c&&(c=!b.push(a)):b.push(d)}),c&&b.push(a),this.#d=b}*entries(){yield*this.#d}*keys(){for(var[a]of this)yield a}*values(){for(var[,a]of this)yield a}};FetchBaseError=class extends Error{constructor(message,type){super(message),Error.captureStackTrace(this,this.constructor),this.type=type}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}},FetchError=class extends FetchBaseError{constructor(message,type,systemError){super(message,type),systemError&&(this.code=this.errno=systemError.code,this.erroredSysCall=systemError.syscall)}},NAME=Symbol.toStringTag,isURLSearchParameters=object=>typeof object=="object"&&typeof object.append=="function"&&typeof object.delete=="function"&&typeof object.get=="function"&&typeof object.getAll=="function"&&typeof object.has=="function"&&typeof object.set=="function"&&typeof object.sort=="function"&&object[NAME]==="URLSearchParams",isBlob=object=>object&&typeof object=="object"&&typeof object.arrayBuffer=="function"&&typeof object.type=="string"&&typeof object.stream=="function"&&typeof object.constructor=="function"&&/^(Blob|File)$/.test(object[NAME]),isAbortSignal=object=>typeof object=="object"&&(object[NAME]==="AbortSignal"||object[NAME]==="EventTarget"),isDomainOrSubdomain=(destination,original)=>{let orig=new URL(original).hostname,dest=new URL(destination).hostname;return orig===dest||orig.endsWith(`.${dest}`)},isSameProtocol=(destination,original)=>{let orig=new URL(original).protocol,dest=new URL(destination).protocol;return orig===dest},pipeline=(0,import_node_util.promisify)(import_node_stream.default.pipeline),INTERNALS$2=Symbol("Body internals"),Body=class{constructor(body,{size=0}={}){let boundary=null;body===null?body=null:isURLSearchParameters(body)?body=import_node_buffer.Buffer.from(body.toString()):isBlob(body)||import_node_buffer.Buffer.isBuffer(body)||(import_node_util.types.isAnyArrayBuffer(body)?body=import_node_buffer.Buffer.from(body):ArrayBuffer.isView(body)?body=import_node_buffer.Buffer.from(body.buffer,body.byteOffset,body.byteLength):body instanceof import_node_stream.default||(body instanceof FormData?(body=formDataToBlob(body),boundary=body.type.split("=")[1]):body=import_node_buffer.Buffer.from(String(body))));let stream=body;import_node_buffer.Buffer.isBuffer(body)?stream=import_node_stream.default.Readable.from(body):isBlob(body)&&(stream=import_node_stream.default.Readable.from(body.stream())),this[INTERNALS$2]={body,stream,boundary,disturbed:!1,error:null},this.size=size,body instanceof import_node_stream.default&&body.on("error",error_=>{let error=error_ instanceof FetchBaseError?error_:new FetchError(`Invalid response body while trying to fetch ${this.url}: ${error_.message}`,"system",error_);this[INTERNALS$2].error=error})}get body(){return this[INTERNALS$2].stream}get bodyUsed(){return this[INTERNALS$2].disturbed}async arrayBuffer(){let{buffer,byteOffset,byteLength}=await consumeBody(this);return buffer.slice(byteOffset,byteOffset+byteLength)}async formData(){let ct=this.headers.get("content-type");if(ct.startsWith("application/x-www-form-urlencoded")){let formData=new FormData,parameters=new URLSearchParams(await this.text());for(let[name,value]of parameters)formData.append(name,value);return formData}let{toFormData:toFormData2}=await Promise.resolve().then(()=>(init_multipart_parser(),multipart_parser_exports));return toFormData2(this.body,ct)}async blob(){let ct=this.headers&&this.headers.get("content-type")||this[INTERNALS$2].body&&this[INTERNALS$2].body.type||"",buf=await this.arrayBuffer();return new _Blob$1([buf],{type:ct})}async json(){let text=await this.text();return JSON.parse(text)}async text(){let buffer=await consumeBody(this);return new TextDecoder().decode(buffer)}buffer(){return consumeBody(this)}};Body.prototype.buffer=(0,import_node_util.deprecate)(Body.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Body.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,import_node_util.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});clone=(instance,highWaterMark)=>{let p1,p2,{body}=instance[INTERNALS$2];if(instance.bodyUsed)throw new Error("cannot clone body after it is used");return body instanceof import_node_stream.default&&typeof body.getBoundary!="function"&&(p1=new import_node_stream.PassThrough({highWaterMark}),p2=new import_node_stream.PassThrough({highWaterMark}),body.pipe(p1),body.pipe(p2),instance[INTERNALS$2].stream=p1,body=p2),body},getNonSpecFormDataBoundary=(0,import_node_util.deprecate)(body=>body.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),extractContentType=(body,request)=>body===null?null:typeof body=="string"?"text/plain;charset=UTF-8":isURLSearchParameters(body)?"application/x-www-form-urlencoded;charset=UTF-8":isBlob(body)?body.type||null:import_node_buffer.Buffer.isBuffer(body)||import_node_util.types.isAnyArrayBuffer(body)||ArrayBuffer.isView(body)?null:body instanceof FormData?`multipart/form-data; boundary=${request[INTERNALS$2].boundary}`:body&&typeof body.getBoundary=="function"?`multipart/form-data;boundary=${getNonSpecFormDataBoundary(body)}`:body instanceof import_node_stream.default?null:"text/plain;charset=UTF-8",getTotalBytes=request=>{let{body}=request[INTERNALS$2];return body===null?0:isBlob(body)?body.size:import_node_buffer.Buffer.isBuffer(body)?body.length:body&&typeof body.getLengthSync=="function"&&body.hasKnownLength&&body.hasKnownLength()?body.getLengthSync():null},writeToStream=async(dest,{body})=>{body===null?dest.end():await pipeline(body,dest)},validateHeaderName=typeof import_node_http.default.validateHeaderName=="function"?import_node_http.default.validateHeaderName:name=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(name)){let error=new TypeError(`Header name must be a valid HTTP token [${name}]`);throw Object.defineProperty(error,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),error}},validateHeaderValue=typeof import_node_http.default.validateHeaderValue=="function"?import_node_http.default.validateHeaderValue:(name,value)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(value)){let error=new TypeError(`Invalid character in header content ["${name}"]`);throw Object.defineProperty(error,"code",{value:"ERR_INVALID_CHAR"}),error}},Headers=class _Headers extends URLSearchParams{constructor(init){let result=[];if(init instanceof _Headers){let raw=init.raw();for(let[name,values]of Object.entries(raw))result.push(...values.map(value=>[name,value]))}else if(init!=null)if(typeof init=="object"&&!import_node_util.types.isBoxedPrimitive(init)){let method=init[Symbol.iterator];if(method==null)result.push(...Object.entries(init));else{if(typeof method!="function")throw new TypeError("Header pairs must be iterable");result=[...init].map(pair=>{if(typeof pair!="object"||import_node_util.types.isBoxedPrimitive(pair))throw new TypeError("Each header pair must be an iterable object");return[...pair]}).map(pair=>{if(pair.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...pair]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence> or record)");return result=result.length>0?result.map(([name,value])=>(validateHeaderName(name),validateHeaderValue(name,String(value)),[String(name).toLowerCase(),String(value)])):void 0,super(result),new Proxy(this,{get(target,p,receiver){switch(p){case"append":case"set":return(name,value)=>(validateHeaderName(name),validateHeaderValue(name,String(value)),URLSearchParams.prototype[p].call(target,String(name).toLowerCase(),String(value)));case"delete":case"has":case"getAll":return name=>(validateHeaderName(name),URLSearchParams.prototype[p].call(target,String(name).toLowerCase()));case"keys":return()=>(target.sort(),new Set(URLSearchParams.prototype.keys.call(target)).keys());default:return Reflect.get(target,p,receiver)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(name){let values=this.getAll(name);if(values.length===0)return null;let value=values.join(", ");return/^content-encoding$/i.test(name)&&(value=value.toLowerCase()),value}forEach(callback,thisArg=void 0){for(let name of this.keys())Reflect.apply(callback,thisArg,[this.get(name),name,this])}*values(){for(let name of this.keys())yield this.get(name)}*entries(){for(let name of this.keys())yield[name,this.get(name)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((result,key)=>(result[key]=this.getAll(key),result),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((result,key)=>{let values=this.getAll(key);return key==="host"?result[key]=values[0]:result[key]=values.length>1?values:values[0],result},{})}};Object.defineProperties(Headers.prototype,["get","entries","forEach","values"].reduce((result,property)=>(result[property]={enumerable:!0},result),{}));redirectStatus=new Set([301,302,303,307,308]),isRedirect=code=>redirectStatus.has(code),INTERNALS$1=Symbol("Response internals"),Response=class _Response extends Body{constructor(body=null,options={}){super(body,options);let status=options.status!=null?options.status:200,headers=new Headers(options.headers);if(body!==null&&!headers.has("Content-Type")){let contentType=extractContentType(body,this);contentType&&headers.append("Content-Type",contentType)}this[INTERNALS$1]={type:"default",url:options.url,status,statusText:options.statusText||"",headers,counter:options.counter,highWaterMark:options.highWaterMark}}get type(){return this[INTERNALS$1].type}get url(){return this[INTERNALS$1].url||""}get status(){return this[INTERNALS$1].status}get ok(){return this[INTERNALS$1].status>=200&&this[INTERNALS$1].status<300}get redirected(){return this[INTERNALS$1].counter>0}get statusText(){return this[INTERNALS$1].statusText}get headers(){return this[INTERNALS$1].headers}get highWaterMark(){return this[INTERNALS$1].highWaterMark}clone(){return new _Response(clone(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(url,status=302){if(!isRedirect(status))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new _Response(null,{headers:{location:new URL(url).toString()},status})}static error(){let response=new _Response(null,{status:0,statusText:""});return response[INTERNALS$1].type="error",response}static json(data=void 0,init={}){let body=JSON.stringify(data);if(body===void 0)throw new TypeError("data is not JSON serializable");let headers=new Headers(init&&init.headers);return headers.has("content-type")||headers.set("content-type","application/json"),new _Response(body,{...init,headers})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Response.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}});getSearch=parsedURL=>{if(parsedURL.search)return parsedURL.search;let lastOffset=parsedURL.href.length-1,hash=parsedURL.hash||(parsedURL.href[lastOffset]==="#"?"#":"");return parsedURL.href[lastOffset-hash.length]==="?"?"?":""};ReferrerPolicy=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),DEFAULT_REFERRER_POLICY="strict-origin-when-cross-origin";INTERNALS=Symbol("Request internals"),isRequest=object=>typeof object=="object"&&typeof object[INTERNALS]=="object",doBadDataWarn=(0,import_node_util.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Request=class _Request extends Body{constructor(input,init={}){let parsedURL;if(isRequest(input)?parsedURL=new URL(input.url):(parsedURL=new URL(input),input={}),parsedURL.username!==""||parsedURL.password!=="")throw new TypeError(`${parsedURL} is an url with embedded credentials.`);let method=init.method||input.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(method)&&(method=method.toUpperCase()),!isRequest(init)&&"data"in init&&doBadDataWarn(),(init.body!=null||isRequest(input)&&input.body!==null)&&(method==="GET"||method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let inputBody=init.body?init.body:isRequest(input)&&input.body!==null?clone(input):null;super(inputBody,{size:init.size||input.size||0});let headers=new Headers(init.headers||input.headers||{});if(inputBody!==null&&!headers.has("Content-Type")){let contentType=extractContentType(inputBody,this);contentType&&headers.set("Content-Type",contentType)}let signal=isRequest(input)?input.signal:null;if("signal"in init&&(signal=init.signal),signal!=null&&!isAbortSignal(signal))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let referrer=init.referrer==null?input.referrer:init.referrer;if(referrer==="")referrer="no-referrer";else if(referrer){let parsedReferrer=new URL(referrer);referrer=/^about:(\/\/)?client$/.test(parsedReferrer)?"client":parsedReferrer}else referrer=void 0;this[INTERNALS]={method,redirect:init.redirect||input.redirect||"follow",headers,parsedURL,signal,referrer},this.follow=init.follow===void 0?input.follow===void 0?20:input.follow:init.follow,this.compress=init.compress===void 0?input.compress===void 0?!0:input.compress:init.compress,this.counter=init.counter||input.counter||0,this.agent=init.agent||input.agent,this.highWaterMark=init.highWaterMark||input.highWaterMark||16384,this.insecureHTTPParser=init.insecureHTTPParser||input.insecureHTTPParser||!1,this.referrerPolicy=init.referrerPolicy||input.referrerPolicy||""}get method(){return this[INTERNALS].method}get url(){return(0,import_node_url.format)(this[INTERNALS].parsedURL)}get headers(){return this[INTERNALS].headers}get redirect(){return this[INTERNALS].redirect}get signal(){return this[INTERNALS].signal}get referrer(){if(this[INTERNALS].referrer==="no-referrer")return"";if(this[INTERNALS].referrer==="client")return"about:client";if(this[INTERNALS].referrer)return this[INTERNALS].referrer.toString()}get referrerPolicy(){return this[INTERNALS].referrerPolicy}set referrerPolicy(referrerPolicy){this[INTERNALS].referrerPolicy=validateReferrerPolicy(referrerPolicy)}clone(){return new _Request(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Request.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}});getNodeRequestOptions=request=>{let{parsedURL}=request[INTERNALS],headers=new Headers(request[INTERNALS].headers);headers.has("Accept")||headers.set("Accept","*/*");let contentLengthValue=null;if(request.body===null&&/^(post|put)$/i.test(request.method)&&(contentLengthValue="0"),request.body!==null){let totalBytes=getTotalBytes(request);typeof totalBytes=="number"&&!Number.isNaN(totalBytes)&&(contentLengthValue=String(totalBytes))}contentLengthValue&&headers.set("Content-Length",contentLengthValue),request.referrerPolicy===""&&(request.referrerPolicy=DEFAULT_REFERRER_POLICY),request.referrer&&request.referrer!=="no-referrer"?request[INTERNALS].referrer=determineRequestsReferrer(request):request[INTERNALS].referrer="no-referrer",request[INTERNALS].referrer instanceof URL&&headers.set("Referer",request.referrer),headers.has("User-Agent")||headers.set("User-Agent","node-fetch"),request.compress&&!headers.has("Accept-Encoding")&&headers.set("Accept-Encoding","gzip, deflate, br");let{agent}=request;typeof agent=="function"&&(agent=agent(parsedURL)),!headers.has("Connection")&&!agent&&headers.set("Connection","close");let search=getSearch(parsedURL),options={path:parsedURL.pathname+search,method:request.method,headers:headers[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:request.insecureHTTPParser,agent};return{parsedURL,options}},AbortError=class extends FetchBaseError{constructor(message,type="aborted"){super(message,type)}};if(!globalThis.DOMException)try{let{MessageChannel}=require("worker_threads"),port=new MessageChannel().port1,ab=new ArrayBuffer;port.postMessage(ab,[ab,ab])}catch(err){err.constructor.name==="DOMException"&&(globalThis.DOMException=err.constructor)}nodeDomexception=globalThis.DOMException,DOMException$1=getDefaultExportFromCjs(nodeDomexception),supportedSchemas=new Set(["data:","http:","https:"]);privateData=new WeakMap,wrappers=new WeakMap;Event.prototype={get type(){return pd(this).event.type},get target(){return pd(this).eventTarget},get currentTarget(){return pd(this).currentTarget},composedPath(){let currentTarget=pd(this).currentTarget;return currentTarget==null?[]:[currentTarget]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return pd(this).eventPhase},stopPropagation(){let data=pd(this);data.stopped=!0,typeof data.event.stopPropagation=="function"&&data.event.stopPropagation()},stopImmediatePropagation(){let data=pd(this);data.stopped=!0,data.immediateStopped=!0,typeof data.event.stopImmediatePropagation=="function"&&data.event.stopImmediatePropagation()},get bubbles(){return!!pd(this).event.bubbles},get cancelable(){return!!pd(this).event.cancelable},preventDefault(){setCancelFlag(pd(this))},get defaultPrevented(){return pd(this).canceled},get composed(){return!!pd(this).event.composed},get timeStamp(){return pd(this).timeStamp},get srcElement(){return pd(this).eventTarget},get cancelBubble(){return pd(this).stopped},set cancelBubble(value){if(!value)return;let data=pd(this);data.stopped=!0,typeof data.event.cancelBubble=="boolean"&&(data.event.cancelBubble=!0)},get returnValue(){return!pd(this).canceled},set returnValue(value){value||setCancelFlag(pd(this))},initEvent(){}};Object.defineProperty(Event.prototype,"constructor",{value:Event,configurable:!0,writable:!0});typeof window<"u"&&typeof window.Event<"u"&&(Object.setPrototypeOf(Event.prototype,window.Event.prototype),wrappers.set(window.Event.prototype,Event));listenersMap=new WeakMap,CAPTURE=1,BUBBLE=2,ATTRIBUTE=3;EventTarget.prototype={addEventListener(eventName,listener,options){if(listener==null)return;if(typeof listener!="function"&&!isObject(listener))throw new TypeError("'listener' should be a function or an object.");let listeners=getListeners(this),optionsIsObj=isObject(options),listenerType=(optionsIsObj?!!options.capture:!!options)?CAPTURE:BUBBLE,newNode={listener,listenerType,passive:optionsIsObj&&!!options.passive,once:optionsIsObj&&!!options.once,next:null},node=listeners.get(eventName);if(node===void 0){listeners.set(eventName,newNode);return}let prev=null;for(;node!=null;){if(node.listener===listener&&node.listenerType===listenerType)return;prev=node,node=node.next}prev.next=newNode},removeEventListener(eventName,listener,options){if(listener==null)return;let listeners=getListeners(this),listenerType=(isObject(options)?!!options.capture:!!options)?CAPTURE:BUBBLE,prev=null,node=listeners.get(eventName);for(;node!=null;){if(node.listener===listener&&node.listenerType===listenerType){prev!==null?prev.next=node.next:node.next!==null?listeners.set(eventName,node.next):listeners.delete(eventName);return}prev=node,node=node.next}},dispatchEvent(event){if(event==null||typeof event.type!="string")throw new TypeError('"event.type" should be a string.');let listeners=getListeners(this),eventName=event.type,node=listeners.get(eventName);if(node==null)return!0;let wrappedEvent=wrapEvent(this,event),prev=null;for(;node!=null;){if(node.once?prev!==null?prev.next=node.next:node.next!==null?listeners.set(eventName,node.next):listeners.delete(eventName):prev=node,setPassiveListener(wrappedEvent,node.passive?node.listener:null),typeof node.listener=="function")try{node.listener.call(this,wrappedEvent)}catch(err){typeof console<"u"&&typeof console.error=="function"&&console.error(err)}else node.listenerType!==ATTRIBUTE&&typeof node.listener.handleEvent=="function"&&node.listener.handleEvent(wrappedEvent);if(isStopped(wrappedEvent))break;node=node.next}return setPassiveListener(wrappedEvent,null),setEventPhase(wrappedEvent,0),setCurrentTarget(wrappedEvent,null),!wrappedEvent.defaultPrevented}};Object.defineProperty(EventTarget.prototype,"constructor",{value:EventTarget,configurable:!0,writable:!0});typeof window<"u"&&typeof window.EventTarget<"u"&&Object.setPrototypeOf(EventTarget.prototype,window.EventTarget.prototype);AbortSignal=class extends EventTarget{constructor(){throw super(),new TypeError("AbortSignal cannot be constructed directly")}get aborted(){let aborted=abortedFlags.get(this);if(typeof aborted!="boolean")throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return aborted}};defineEventAttribute(AbortSignal.prototype,"abort");abortedFlags=new WeakMap;Object.defineProperties(AbortSignal.prototype,{aborted:{enumerable:!0}});typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(AbortSignal.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});AbortController$1=class{constructor(){signals.set(this,createAbortSignal())}get signal(){return getSignal(this)}abort(){abortSignal(getSignal(this))}},signals=new WeakMap;Object.defineProperties(AbortController$1.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(AbortController$1.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"})}});var import_core=__toESM(require_core()),import_exec=__toESM(require_exec());var import_node_http2=__toESM(require("node:http"),1),import_node_https2=__toESM(require("node:https"),1);init_node_fetch_native_d7878b77();init_node_fetch_native_d7878b77();var import_node_fs=require("node:fs");init_node_fetch_native_d7878b77();var{stat}=import_node_fs.promises;var BlobDataItem=class _BlobDataItem{#path;#start;constructor(options){this.#path=options.path,this.#start=options.start,this.size=options.size,this.lastModified=options.lastModified}slice(start,end){return new _BlobDataItem({path:this.#path,lastModified:this.lastModified,size:end-start,start:this.#start+start})}async*stream(){let{mtimeMs}=await stat(this.#path);if(mtimeMs>this.lastModified)throw new DOMException$1("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.","NotReadableError");yield*(0,import_node_fs.createReadStream)(this.#path,{start:this.#start,end:this.#start+this.size-1})}get[Symbol.toStringTag](){return"Blob"}};var _forceNodeFetch=typeof process!==void 0&&typeof process.env!==void 0&&process.env.FORCE_NODE_FETCH;function _getFetch(){return!_forceNodeFetch&&globalThis.fetch?globalThis.fetch:fetch}var fetch2=_getFetch(),Blob3=!_forceNodeFetch&&globalThis.Blob||_Blob$1,File3=!_forceNodeFetch&&globalThis.File||File$1,FormData3=!_forceNodeFetch&&globalThis.FormData||FormData,Headers2=!_forceNodeFetch&&globalThis.Headers||Headers,Request2=!_forceNodeFetch&&globalThis.Request||Request,Response2=!_forceNodeFetch&&globalThis.Response||Response,AbortController3=!_forceNodeFetch&&globalThis.AbortController||AbortController$1;var suspectProtoRx=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,suspectConstructorRx=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,JsonSigRx=/^\s*["[{]|^\s*-?\d[\d.]{0,14}\s*$/;function jsonParseTransform(key,value){if(key==="__proto__"||key==="constructor"&&value&&typeof value=="object"&&"prototype"in value){warnKeyDropped(key);return}return value}function warnKeyDropped(key){console.warn(`[destr] Dropping "${key}" key to prevent prototype pollution.`)}function destr(value,options={}){if(typeof value!="string")return value;let _value=value.trim();if(value[0]==='"'&&value[value.length-1]==='"')return _value.slice(1,-1);let _lval=_value.toLowerCase();if(_lval==="true")return!0;if(_lval==="false")return!1;if(_lval!=="undefined"){if(_lval==="null")return null;if(_lval==="nan")return Number.NaN;if(_lval==="infinity")return Number.POSITIVE_INFINITY;if(_lval==="-infinity")return Number.NEGATIVE_INFINITY;if(!JsonSigRx.test(value)){if(options.strict)throw new SyntaxError("[destr] Invalid JSON");return value}try{if(suspectProtoRx.test(value)||suspectConstructorRx.test(value)){if(options.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(value,jsonParseTransform)}return JSON.parse(value)}catch(error){if(options.strict)throw error;return value}}}var r2=String.fromCharCode;var HASH_RE=/#/g,AMPERSAND_RE=/&/g;var EQUAL_RE=/=/g;var PLUS_RE=/\+/g,ENC_CARET_RE=/%5e/gi,ENC_BACKTICK_RE=/%60/gi;var ENC_PIPE_RE=/%7c/gi;var ENC_SPACE_RE=/%20/gi;function encode(text){return encodeURI(""+text).replace(ENC_PIPE_RE,"|")}function encodeQueryValue(input){return encode(typeof input=="string"?input:JSON.stringify(input)).replace(PLUS_RE,"%2B").replace(ENC_SPACE_RE,"+").replace(HASH_RE,"%23").replace(AMPERSAND_RE,"%26").replace(ENC_BACKTICK_RE,"`").replace(ENC_CARET_RE,"^")}function encodeQueryKey(text){return encodeQueryValue(text).replace(EQUAL_RE,"%3D")}function decode(text=""){try{return decodeURIComponent(""+text)}catch{return""+text}}function decodeQueryValue(text){return decode(text.replace(PLUS_RE," "))}function parseQuery(parametersString=""){let object={};parametersString[0]==="?"&&(parametersString=parametersString.slice(1));for(let parameter of parametersString.split("&")){let s2=parameter.match(/([^=]+)=?(.*)/)||[];if(s2.length<2)continue;let key=decode(s2[1]);if(key==="__proto__"||key==="constructor")continue;let value=decodeQueryValue(s2[2]||"");typeof object[key]<"u"?Array.isArray(object[key])?object[key].push(value):object[key]=[object[key],value]:object[key]=value}return object}function encodeQueryItem(key,value){return(typeof value=="number"||typeof value=="boolean")&&(value=String(value)),value?Array.isArray(value)?value.map(_value=>`${encodeQueryKey(key)}=${encodeQueryValue(_value)}`).join("&"):`${encodeQueryKey(key)}=${encodeQueryValue(value)}`:encodeQueryKey(key)}function stringifyQuery(query){return Object.keys(query).filter(k=>query[k]!==void 0).map(k=>encodeQueryItem(k,query[k])).join("&")}var PROTOCOL_STRICT_REGEX=/^\w{2,}:([/\\]{1,2})/,PROTOCOL_REGEX=/^\w{2,}:([/\\]{2})?/,PROTOCOL_RELATIVE_REGEX=/^([/\\]\s*){2,}[^/\\]/;function hasProtocol(inputString,opts={}){return typeof opts=="boolean"&&(opts={acceptRelative:opts}),opts.strict?PROTOCOL_STRICT_REGEX.test(inputString):PROTOCOL_REGEX.test(inputString)||(opts.acceptRelative?PROTOCOL_RELATIVE_REGEX.test(inputString):!1)}var TRAILING_SLASH_RE=/\/$|\/\?/;function hasTrailingSlash(input="",queryParameters=!1){return queryParameters?TRAILING_SLASH_RE.test(input):input.endsWith("/")}function withoutTrailingSlash(input="",queryParameters=!1){if(!queryParameters)return(hasTrailingSlash(input)?input.slice(0,-1):input)||"/";if(!hasTrailingSlash(input,!0))return input||"/";let[s0,...s2]=input.split("?");return(s0.slice(0,-1)||"/")+(s2.length>0?`?${s2.join("?")}`:"")}function withTrailingSlash(input="",queryParameters=!1){if(!queryParameters)return input.endsWith("/")?input:input+"/";if(hasTrailingSlash(input,!0))return input||"/";let[s0,...s2]=input.split("?");return s0+"/"+(s2.length>0?`?${s2.join("?")}`:"")}function hasLeadingSlash(input=""){return input.startsWith("/")}function withoutLeadingSlash(input=""){return(hasLeadingSlash(input)?input.slice(1):input)||"/"}function withBase(input,base){if(isEmptyURL(base)||hasProtocol(input))return input;let _base=withoutTrailingSlash(base);return input.startsWith(_base)?input:joinURL(_base,input)}function withQuery(input,query){let parsed=parseURL(input),mergedQuery={...parseQuery(parsed.search),...query};return parsed.search=stringifyQuery(mergedQuery),stringifyParsedURL(parsed)}function isEmptyURL(url){return!url||url==="/"}function isNonEmptyURL(url){return url&&url!=="/"}function joinURL(base,...input){let url=base||"";for(let index of input.filter(url2=>isNonEmptyURL(url2)))url=url?withTrailingSlash(url)+withoutLeadingSlash(index):index;return url}function parseURL(input="",defaultProto){if(!hasProtocol(input,{acceptRelative:!0}))return defaultProto?parseURL(defaultProto+input):parsePath(input);let[protocol="",auth,hostAndPath=""]=(input.replace(/\\/g,"/").match(/([^/:]+:)?\/\/([^/@]+@)?(.*)/)||[]).splice(1),[host="",path=""]=(hostAndPath.match(/([^#/?]*)(.*)?/)||[]).splice(1),{pathname,search,hash}=parsePath(path.replace(/\/(?=[A-Za-z]:)/,""));return{protocol,auth:auth?auth.slice(0,Math.max(0,auth.length-1)):"",host,pathname,search,hash}}function parsePath(input=""){let[pathname="",search="",hash=""]=(input.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname,search,hash}}function stringifyParsedURL(parsed){let fullpath=parsed.pathname+(parsed.search?(parsed.search.startsWith("?")?"":"?")+parsed.search:"")+parsed.hash;return parsed.protocol?parsed.protocol+"//"+(parsed.auth?parsed.auth+"@":"")+parsed.host+fullpath:fullpath}var FetchError2=class extends Error{constructor(){super(...arguments),this.name="FetchError"}};function createFetchError(request,error,response){let message="";error&&(message=error.message),request&&response?message=`${message} (${response.status} ${response.statusText} (${request.toString()}))`:request&&(message=`${message} (${request.toString()})`);let fetchError=new FetchError2(message);return Object.defineProperty(fetchError,"request",{get(){return request}}),Object.defineProperty(fetchError,"response",{get(){return response}}),Object.defineProperty(fetchError,"data",{get(){return response&&response._data}}),Object.defineProperty(fetchError,"status",{get(){return response&&response.status}}),Object.defineProperty(fetchError,"statusText",{get(){return response&&response.statusText}}),Object.defineProperty(fetchError,"statusCode",{get(){return response&&response.status}}),Object.defineProperty(fetchError,"statusMessage",{get(){return response&&response.statusText}}),fetchError}var payloadMethods=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function isPayloadMethod(method="GET"){return payloadMethods.has(method.toUpperCase())}function isJSONSerializable(value){if(value===void 0)return!1;let t2=typeof value;return t2==="string"||t2==="number"||t2==="boolean"||t2===null?!0:t2!=="object"?!1:Array.isArray(value)?!0:value.constructor&&value.constructor.name==="Object"||typeof value.toJSON=="function"}var textTypes=new Set(["image/svg","application/xml","application/xhtml","application/html"]),JSON_RE=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function detectResponseType(_contentType=""){if(!_contentType)return"json";let contentType=_contentType.split(";").shift()||"";return JSON_RE.test(contentType)?"json":textTypes.has(contentType)||contentType.startsWith("text/")?"text":"blob"}function mergeFetchOptions(input,defaults,Headers4=globalThis.Headers){let merged={...defaults,...input};if(defaults?.params&&input?.params&&(merged.params={...defaults?.params,...input?.params}),defaults?.query&&input?.query&&(merged.query={...defaults?.query,...input?.query}),defaults?.headers&&input?.headers){merged.headers=new Headers4(defaults?.headers||{});for(let[key,value]of new Headers4(input?.headers||{}))merged.headers.set(key,value)}return merged}var retryStatusCodes=new Set([408,409,425,429,500,502,503,504]);function createFetch(globalOptions){let{fetch:fetch4,Headers:Headers4}=globalOptions;function onError(context){let isAbort=context.error&&context.error.name==="AbortError"||!1;if(context.options.retry!==!1&&!isAbort){let retries;typeof context.options.retry=="number"?retries=context.options.retry:retries=isPayloadMethod(context.options.method)?0:1;let responseCode=context.response&&context.response.status||500;if(retries>0&&retryStatusCodes.has(responseCode))return $fetchRaw(context.request,{...context.options,retry:retries-1})}let error=createFetchError(context.request,context.error,context.response);throw Error.captureStackTrace&&Error.captureStackTrace(error,$fetchRaw),error}let $fetchRaw=async function(_request,_options={}){let context={request:_request,options:mergeFetchOptions(_options,globalOptions.defaults,Headers4),response:void 0,error:void 0};context.options.onRequest&&await context.options.onRequest(context),typeof context.request=="string"&&(context.options.baseURL&&(context.request=withBase(context.request,context.options.baseURL)),(context.options.query||context.options.params)&&(context.request=withQuery(context.request,{...context.options.params,...context.options.query})),context.options.body&&isPayloadMethod(context.options.method)&&isJSONSerializable(context.options.body)&&(context.options.body=typeof context.options.body=="string"?context.options.body:JSON.stringify(context.options.body),context.options.headers=new Headers4(context.options.headers||{}),context.options.headers.has("content-type")||context.options.headers.set("content-type","application/json"),context.options.headers.has("accept")||context.options.headers.set("accept","application/json")));try{context.response=await fetch4(context.request,context.options)}catch(error){return context.error=error,context.options.onRequestError&&await context.options.onRequestError(context),await onError(context)}let responseType=(context.options.parseResponse?"json":context.options.responseType)||detectResponseType(context.response.headers.get("content-type")||"");if(responseType==="json"){let data=await context.response.text(),parseFunction=context.options.parseResponse||destr;context.response._data=parseFunction(data)}else responseType==="stream"?context.response._data=context.response.body:context.response._data=await context.response[responseType]();return context.options.onResponse&&await context.options.onResponse(context),!context.options.ignoreResponseError&&context.response.status>=400&&context.response.status<600?(context.options.onResponseError&&await context.options.onResponseError(context),await onError(context)):context.response},$fetch=async function(request,options){return(await $fetchRaw(request,options))._data};return $fetch.raw=$fetchRaw,$fetch.native=fetch4,$fetch.create=(defaultOptions={})=>createFetch({...globalOptions,defaults:{...globalOptions.defaults,...defaultOptions}}),$fetch}function createNodeFetch(){if(!JSON.parse(process.env.FETCH_KEEP_ALIVE||"false"))return fetch2;let agentOptions={keepAlive:!0},httpAgent=new import_node_http2.default.Agent(agentOptions),httpsAgent=new import_node_https2.default.Agent(agentOptions),nodeFetchOptions={agent(parsedURL){return parsedURL.protocol==="http:"?httpAgent:httpsAgent}};return function(input,init){return fetch2(input,{...nodeFetchOptions,...init})}}var fetch3=globalThis.fetch||createNodeFetch(),Headers3=globalThis.Headers||Headers2,ofetch=createFetch({fetch:fetch3,Headers:Headers3});var import_promises=require("node:fs/promises"),import_node_os=require("node:os"),import_node_path=require("node:path"),install=async()=>{(0,import_core.startGroup)("Install attic");let installScript=await fetch3("https://raw.githubusercontent.com/zhaofengli/attic/main/.github/install-attic-ci.sh").then(r3=>{if(!r3.ok)throw new Error(`Failed to fetch install script: ${r3.status} ${r3.statusText}`);return r3.text()}),installScriptPath=(0,import_node_path.join)((0,import_node_os.tmpdir)(),"install-attic-ci.sh");await(0,import_promises.writeFile)(installScriptPath,installScript),await(0,import_exec.exec)("bash",[installScriptPath]),(0,import_core.endGroup)()};var import_core2=__toESM(require_core()),import_exec2=__toESM(require_exec()),configure=async()=>{(0,import_core2.startGroup)("Configure attic");let endpoint=(0,import_core2.getInput)("endpoint"),token=(0,import_core2.getInput)("token");await(0,import_exec2.exec)("attic",["login","--set-default","ci",endpoint,token]),(0,import_core2.endGroup)()};var import_core3=__toESM(require_core()),import_exec3=__toESM(require_exec()),push=async()=>{let cache=(0,import_core3.getInput)("cache"),paths=(0,import_core3.getMultilineInput)("token");await(0,import_exec3.exec)("attic",["push",cache,...paths])};(async()=>{await install(),await configure(),await push()})().catch(e2=>{console.error(e2),process.exit(1)}); +`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),x=(n,a,e2)=>{if(a.lengthtypeof o[m2]!="function")}append(...a){x("append",arguments,2),this.#d.push(f2(...a))}delete(a){x("delete",arguments,1),a+="",this.#d=this.#d.filter(([b])=>b!==a)}get(a){x("get",arguments,1),a+="";for(var b=this.#d,l=b.length,c=0;cc[0]===a&&b.push(c[1])),b}has(a){return x("has",arguments,1),a+="",this.#d.some(b=>b[0]===a)}forEach(a,b){x("forEach",arguments,1);for(var[c,d]of this)a.call(b,d,c,this)}set(...a){x("set",arguments,2);var b=[],c=!0;a=f2(...a),this.#d.forEach(d=>{d[0]===a[0]?c&&(c=!b.push(a)):b.push(d)}),c&&b.push(a),this.#d=b}*entries(){yield*this.#d}*keys(){for(var[a]of this)yield a}*values(){for(var[,a]of this)yield a}};FetchBaseError=class extends Error{constructor(message,type){super(message),Error.captureStackTrace(this,this.constructor),this.type=type}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}},FetchError=class extends FetchBaseError{constructor(message,type,systemError){super(message,type),systemError&&(this.code=this.errno=systemError.code,this.erroredSysCall=systemError.syscall)}},NAME=Symbol.toStringTag,isURLSearchParameters=object=>typeof object=="object"&&typeof object.append=="function"&&typeof object.delete=="function"&&typeof object.get=="function"&&typeof object.getAll=="function"&&typeof object.has=="function"&&typeof object.set=="function"&&typeof object.sort=="function"&&object[NAME]==="URLSearchParams",isBlob=object=>object&&typeof object=="object"&&typeof object.arrayBuffer=="function"&&typeof object.type=="string"&&typeof object.stream=="function"&&typeof object.constructor=="function"&&/^(Blob|File)$/.test(object[NAME]),isAbortSignal=object=>typeof object=="object"&&(object[NAME]==="AbortSignal"||object[NAME]==="EventTarget"),isDomainOrSubdomain=(destination,original)=>{let orig=new URL(original).hostname,dest=new URL(destination).hostname;return orig===dest||orig.endsWith(`.${dest}`)},isSameProtocol=(destination,original)=>{let orig=new URL(original).protocol,dest=new URL(destination).protocol;return orig===dest},pipeline=(0,import_node_util.promisify)(import_node_stream.default.pipeline),INTERNALS$2=Symbol("Body internals"),Body=class{constructor(body,{size=0}={}){let boundary=null;body===null?body=null:isURLSearchParameters(body)?body=import_node_buffer.Buffer.from(body.toString()):isBlob(body)||import_node_buffer.Buffer.isBuffer(body)||(import_node_util.types.isAnyArrayBuffer(body)?body=import_node_buffer.Buffer.from(body):ArrayBuffer.isView(body)?body=import_node_buffer.Buffer.from(body.buffer,body.byteOffset,body.byteLength):body instanceof import_node_stream.default||(body instanceof FormData?(body=formDataToBlob(body),boundary=body.type.split("=")[1]):body=import_node_buffer.Buffer.from(String(body))));let stream=body;import_node_buffer.Buffer.isBuffer(body)?stream=import_node_stream.default.Readable.from(body):isBlob(body)&&(stream=import_node_stream.default.Readable.from(body.stream())),this[INTERNALS$2]={body,stream,boundary,disturbed:!1,error:null},this.size=size,body instanceof import_node_stream.default&&body.on("error",error_=>{let error=error_ instanceof FetchBaseError?error_:new FetchError(`Invalid response body while trying to fetch ${this.url}: ${error_.message}`,"system",error_);this[INTERNALS$2].error=error})}get body(){return this[INTERNALS$2].stream}get bodyUsed(){return this[INTERNALS$2].disturbed}async arrayBuffer(){let{buffer,byteOffset,byteLength}=await consumeBody(this);return buffer.slice(byteOffset,byteOffset+byteLength)}async formData(){let ct=this.headers.get("content-type");if(ct.startsWith("application/x-www-form-urlencoded")){let formData=new FormData,parameters=new URLSearchParams(await this.text());for(let[name,value]of parameters)formData.append(name,value);return formData}let{toFormData:toFormData2}=await Promise.resolve().then(()=>(init_multipart_parser(),multipart_parser_exports));return toFormData2(this.body,ct)}async blob(){let ct=this.headers&&this.headers.get("content-type")||this[INTERNALS$2].body&&this[INTERNALS$2].body.type||"",buf=await this.arrayBuffer();return new _Blob$1([buf],{type:ct})}async json(){let text=await this.text();return JSON.parse(text)}async text(){let buffer=await consumeBody(this);return new TextDecoder().decode(buffer)}buffer(){return consumeBody(this)}};Body.prototype.buffer=(0,import_node_util.deprecate)(Body.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Body.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,import_node_util.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});clone=(instance,highWaterMark)=>{let p1,p2,{body}=instance[INTERNALS$2];if(instance.bodyUsed)throw new Error("cannot clone body after it is used");return body instanceof import_node_stream.default&&typeof body.getBoundary!="function"&&(p1=new import_node_stream.PassThrough({highWaterMark}),p2=new import_node_stream.PassThrough({highWaterMark}),body.pipe(p1),body.pipe(p2),instance[INTERNALS$2].stream=p1,body=p2),body},getNonSpecFormDataBoundary=(0,import_node_util.deprecate)(body=>body.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),extractContentType=(body,request)=>body===null?null:typeof body=="string"?"text/plain;charset=UTF-8":isURLSearchParameters(body)?"application/x-www-form-urlencoded;charset=UTF-8":isBlob(body)?body.type||null:import_node_buffer.Buffer.isBuffer(body)||import_node_util.types.isAnyArrayBuffer(body)||ArrayBuffer.isView(body)?null:body instanceof FormData?`multipart/form-data; boundary=${request[INTERNALS$2].boundary}`:body&&typeof body.getBoundary=="function"?`multipart/form-data;boundary=${getNonSpecFormDataBoundary(body)}`:body instanceof import_node_stream.default?null:"text/plain;charset=UTF-8",getTotalBytes=request=>{let{body}=request[INTERNALS$2];return body===null?0:isBlob(body)?body.size:import_node_buffer.Buffer.isBuffer(body)?body.length:body&&typeof body.getLengthSync=="function"&&body.hasKnownLength&&body.hasKnownLength()?body.getLengthSync():null},writeToStream=async(dest,{body})=>{body===null?dest.end():await pipeline(body,dest)},validateHeaderName=typeof import_node_http.default.validateHeaderName=="function"?import_node_http.default.validateHeaderName:name=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(name)){let error=new TypeError(`Header name must be a valid HTTP token [${name}]`);throw Object.defineProperty(error,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),error}},validateHeaderValue=typeof import_node_http.default.validateHeaderValue=="function"?import_node_http.default.validateHeaderValue:(name,value)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(value)){let error=new TypeError(`Invalid character in header content ["${name}"]`);throw Object.defineProperty(error,"code",{value:"ERR_INVALID_CHAR"}),error}},Headers=class _Headers extends URLSearchParams{constructor(init){let result=[];if(init instanceof _Headers){let raw=init.raw();for(let[name,values]of Object.entries(raw))result.push(...values.map(value=>[name,value]))}else if(init!=null)if(typeof init=="object"&&!import_node_util.types.isBoxedPrimitive(init)){let method=init[Symbol.iterator];if(method==null)result.push(...Object.entries(init));else{if(typeof method!="function")throw new TypeError("Header pairs must be iterable");result=[...init].map(pair=>{if(typeof pair!="object"||import_node_util.types.isBoxedPrimitive(pair))throw new TypeError("Each header pair must be an iterable object");return[...pair]}).map(pair=>{if(pair.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...pair]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence> or record)");return result=result.length>0?result.map(([name,value])=>(validateHeaderName(name),validateHeaderValue(name,String(value)),[String(name).toLowerCase(),String(value)])):void 0,super(result),new Proxy(this,{get(target,p,receiver){switch(p){case"append":case"set":return(name,value)=>(validateHeaderName(name),validateHeaderValue(name,String(value)),URLSearchParams.prototype[p].call(target,String(name).toLowerCase(),String(value)));case"delete":case"has":case"getAll":return name=>(validateHeaderName(name),URLSearchParams.prototype[p].call(target,String(name).toLowerCase()));case"keys":return()=>(target.sort(),new Set(URLSearchParams.prototype.keys.call(target)).keys());default:return Reflect.get(target,p,receiver)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(name){let values=this.getAll(name);if(values.length===0)return null;let value=values.join(", ");return/^content-encoding$/i.test(name)&&(value=value.toLowerCase()),value}forEach(callback,thisArg=void 0){for(let name of this.keys())Reflect.apply(callback,thisArg,[this.get(name),name,this])}*values(){for(let name of this.keys())yield this.get(name)}*entries(){for(let name of this.keys())yield[name,this.get(name)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((result,key)=>(result[key]=this.getAll(key),result),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((result,key)=>{let values=this.getAll(key);return key==="host"?result[key]=values[0]:result[key]=values.length>1?values:values[0],result},{})}};Object.defineProperties(Headers.prototype,["get","entries","forEach","values"].reduce((result,property)=>(result[property]={enumerable:!0},result),{}));redirectStatus=new Set([301,302,303,307,308]),isRedirect=code=>redirectStatus.has(code),INTERNALS$1=Symbol("Response internals"),Response=class _Response extends Body{constructor(body=null,options={}){super(body,options);let status=options.status!=null?options.status:200,headers=new Headers(options.headers);if(body!==null&&!headers.has("Content-Type")){let contentType=extractContentType(body,this);contentType&&headers.append("Content-Type",contentType)}this[INTERNALS$1]={type:"default",url:options.url,status,statusText:options.statusText||"",headers,counter:options.counter,highWaterMark:options.highWaterMark}}get type(){return this[INTERNALS$1].type}get url(){return this[INTERNALS$1].url||""}get status(){return this[INTERNALS$1].status}get ok(){return this[INTERNALS$1].status>=200&&this[INTERNALS$1].status<300}get redirected(){return this[INTERNALS$1].counter>0}get statusText(){return this[INTERNALS$1].statusText}get headers(){return this[INTERNALS$1].headers}get highWaterMark(){return this[INTERNALS$1].highWaterMark}clone(){return new _Response(clone(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(url,status=302){if(!isRedirect(status))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new _Response(null,{headers:{location:new URL(url).toString()},status})}static error(){let response=new _Response(null,{status:0,statusText:""});return response[INTERNALS$1].type="error",response}static json(data=void 0,init={}){let body=JSON.stringify(data);if(body===void 0)throw new TypeError("data is not JSON serializable");let headers=new Headers(init&&init.headers);return headers.has("content-type")||headers.set("content-type","application/json"),new _Response(body,{...init,headers})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Response.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}});getSearch=parsedURL=>{if(parsedURL.search)return parsedURL.search;let lastOffset=parsedURL.href.length-1,hash=parsedURL.hash||(parsedURL.href[lastOffset]==="#"?"#":"");return parsedURL.href[lastOffset-hash.length]==="?"?"?":""};ReferrerPolicy=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),DEFAULT_REFERRER_POLICY="strict-origin-when-cross-origin";INTERNALS=Symbol("Request internals"),isRequest=object=>typeof object=="object"&&typeof object[INTERNALS]=="object",doBadDataWarn=(0,import_node_util.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Request=class _Request extends Body{constructor(input,init={}){let parsedURL;if(isRequest(input)?parsedURL=new URL(input.url):(parsedURL=new URL(input),input={}),parsedURL.username!==""||parsedURL.password!=="")throw new TypeError(`${parsedURL} is an url with embedded credentials.`);let method=init.method||input.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(method)&&(method=method.toUpperCase()),!isRequest(init)&&"data"in init&&doBadDataWarn(),(init.body!=null||isRequest(input)&&input.body!==null)&&(method==="GET"||method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let inputBody=init.body?init.body:isRequest(input)&&input.body!==null?clone(input):null;super(inputBody,{size:init.size||input.size||0});let headers=new Headers(init.headers||input.headers||{});if(inputBody!==null&&!headers.has("Content-Type")){let contentType=extractContentType(inputBody,this);contentType&&headers.set("Content-Type",contentType)}let signal=isRequest(input)?input.signal:null;if("signal"in init&&(signal=init.signal),signal!=null&&!isAbortSignal(signal))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let referrer=init.referrer==null?input.referrer:init.referrer;if(referrer==="")referrer="no-referrer";else if(referrer){let parsedReferrer=new URL(referrer);referrer=/^about:(\/\/)?client$/.test(parsedReferrer)?"client":parsedReferrer}else referrer=void 0;this[INTERNALS]={method,redirect:init.redirect||input.redirect||"follow",headers,parsedURL,signal,referrer},this.follow=init.follow===void 0?input.follow===void 0?20:input.follow:init.follow,this.compress=init.compress===void 0?input.compress===void 0?!0:input.compress:init.compress,this.counter=init.counter||input.counter||0,this.agent=init.agent||input.agent,this.highWaterMark=init.highWaterMark||input.highWaterMark||16384,this.insecureHTTPParser=init.insecureHTTPParser||input.insecureHTTPParser||!1,this.referrerPolicy=init.referrerPolicy||input.referrerPolicy||""}get method(){return this[INTERNALS].method}get url(){return(0,import_node_url.format)(this[INTERNALS].parsedURL)}get headers(){return this[INTERNALS].headers}get redirect(){return this[INTERNALS].redirect}get signal(){return this[INTERNALS].signal}get referrer(){if(this[INTERNALS].referrer==="no-referrer")return"";if(this[INTERNALS].referrer==="client")return"about:client";if(this[INTERNALS].referrer)return this[INTERNALS].referrer.toString()}get referrerPolicy(){return this[INTERNALS].referrerPolicy}set referrerPolicy(referrerPolicy){this[INTERNALS].referrerPolicy=validateReferrerPolicy(referrerPolicy)}clone(){return new _Request(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Request.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}});getNodeRequestOptions=request=>{let{parsedURL}=request[INTERNALS],headers=new Headers(request[INTERNALS].headers);headers.has("Accept")||headers.set("Accept","*/*");let contentLengthValue=null;if(request.body===null&&/^(post|put)$/i.test(request.method)&&(contentLengthValue="0"),request.body!==null){let totalBytes=getTotalBytes(request);typeof totalBytes=="number"&&!Number.isNaN(totalBytes)&&(contentLengthValue=String(totalBytes))}contentLengthValue&&headers.set("Content-Length",contentLengthValue),request.referrerPolicy===""&&(request.referrerPolicy=DEFAULT_REFERRER_POLICY),request.referrer&&request.referrer!=="no-referrer"?request[INTERNALS].referrer=determineRequestsReferrer(request):request[INTERNALS].referrer="no-referrer",request[INTERNALS].referrer instanceof URL&&headers.set("Referer",request.referrer),headers.has("User-Agent")||headers.set("User-Agent","node-fetch"),request.compress&&!headers.has("Accept-Encoding")&&headers.set("Accept-Encoding","gzip, deflate, br");let{agent}=request;typeof agent=="function"&&(agent=agent(parsedURL)),!headers.has("Connection")&&!agent&&headers.set("Connection","close");let search=getSearch(parsedURL),options={path:parsedURL.pathname+search,method:request.method,headers:headers[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:request.insecureHTTPParser,agent};return{parsedURL,options}},AbortError=class extends FetchBaseError{constructor(message,type="aborted"){super(message,type)}};if(!globalThis.DOMException)try{let{MessageChannel}=require("worker_threads"),port=new MessageChannel().port1,ab=new ArrayBuffer;port.postMessage(ab,[ab,ab])}catch(err){err.constructor.name==="DOMException"&&(globalThis.DOMException=err.constructor)}nodeDomexception=globalThis.DOMException,DOMException$1=getDefaultExportFromCjs(nodeDomexception),supportedSchemas=new Set(["data:","http:","https:"]);privateData=new WeakMap,wrappers=new WeakMap;Event.prototype={get type(){return pd(this).event.type},get target(){return pd(this).eventTarget},get currentTarget(){return pd(this).currentTarget},composedPath(){let currentTarget=pd(this).currentTarget;return currentTarget==null?[]:[currentTarget]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return pd(this).eventPhase},stopPropagation(){let data=pd(this);data.stopped=!0,typeof data.event.stopPropagation=="function"&&data.event.stopPropagation()},stopImmediatePropagation(){let data=pd(this);data.stopped=!0,data.immediateStopped=!0,typeof data.event.stopImmediatePropagation=="function"&&data.event.stopImmediatePropagation()},get bubbles(){return!!pd(this).event.bubbles},get cancelable(){return!!pd(this).event.cancelable},preventDefault(){setCancelFlag(pd(this))},get defaultPrevented(){return pd(this).canceled},get composed(){return!!pd(this).event.composed},get timeStamp(){return pd(this).timeStamp},get srcElement(){return pd(this).eventTarget},get cancelBubble(){return pd(this).stopped},set cancelBubble(value){if(!value)return;let data=pd(this);data.stopped=!0,typeof data.event.cancelBubble=="boolean"&&(data.event.cancelBubble=!0)},get returnValue(){return!pd(this).canceled},set returnValue(value){value||setCancelFlag(pd(this))},initEvent(){}};Object.defineProperty(Event.prototype,"constructor",{value:Event,configurable:!0,writable:!0});typeof window<"u"&&typeof window.Event<"u"&&(Object.setPrototypeOf(Event.prototype,window.Event.prototype),wrappers.set(window.Event.prototype,Event));listenersMap=new WeakMap,CAPTURE=1,BUBBLE=2,ATTRIBUTE=3;EventTarget.prototype={addEventListener(eventName,listener,options){if(listener==null)return;if(typeof listener!="function"&&!isObject(listener))throw new TypeError("'listener' should be a function or an object.");let listeners=getListeners(this),optionsIsObj=isObject(options),listenerType=(optionsIsObj?!!options.capture:!!options)?CAPTURE:BUBBLE,newNode={listener,listenerType,passive:optionsIsObj&&!!options.passive,once:optionsIsObj&&!!options.once,next:null},node=listeners.get(eventName);if(node===void 0){listeners.set(eventName,newNode);return}let prev=null;for(;node!=null;){if(node.listener===listener&&node.listenerType===listenerType)return;prev=node,node=node.next}prev.next=newNode},removeEventListener(eventName,listener,options){if(listener==null)return;let listeners=getListeners(this),listenerType=(isObject(options)?!!options.capture:!!options)?CAPTURE:BUBBLE,prev=null,node=listeners.get(eventName);for(;node!=null;){if(node.listener===listener&&node.listenerType===listenerType){prev!==null?prev.next=node.next:node.next!==null?listeners.set(eventName,node.next):listeners.delete(eventName);return}prev=node,node=node.next}},dispatchEvent(event){if(event==null||typeof event.type!="string")throw new TypeError('"event.type" should be a string.');let listeners=getListeners(this),eventName=event.type,node=listeners.get(eventName);if(node==null)return!0;let wrappedEvent=wrapEvent(this,event),prev=null;for(;node!=null;){if(node.once?prev!==null?prev.next=node.next:node.next!==null?listeners.set(eventName,node.next):listeners.delete(eventName):prev=node,setPassiveListener(wrappedEvent,node.passive?node.listener:null),typeof node.listener=="function")try{node.listener.call(this,wrappedEvent)}catch(err){typeof console<"u"&&typeof console.error=="function"&&console.error(err)}else node.listenerType!==ATTRIBUTE&&typeof node.listener.handleEvent=="function"&&node.listener.handleEvent(wrappedEvent);if(isStopped(wrappedEvent))break;node=node.next}return setPassiveListener(wrappedEvent,null),setEventPhase(wrappedEvent,0),setCurrentTarget(wrappedEvent,null),!wrappedEvent.defaultPrevented}};Object.defineProperty(EventTarget.prototype,"constructor",{value:EventTarget,configurable:!0,writable:!0});typeof window<"u"&&typeof window.EventTarget<"u"&&Object.setPrototypeOf(EventTarget.prototype,window.EventTarget.prototype);AbortSignal=class extends EventTarget{constructor(){throw super(),new TypeError("AbortSignal cannot be constructed directly")}get aborted(){let aborted=abortedFlags.get(this);if(typeof aborted!="boolean")throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return aborted}};defineEventAttribute(AbortSignal.prototype,"abort");abortedFlags=new WeakMap;Object.defineProperties(AbortSignal.prototype,{aborted:{enumerable:!0}});typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(AbortSignal.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});AbortController$1=class{constructor(){signals.set(this,createAbortSignal())}get signal(){return getSignal(this)}abort(){abortSignal(getSignal(this))}},signals=new WeakMap;Object.defineProperties(AbortController$1.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(AbortController$1.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"})}});var import_core=__toESM(require_core()),import_exec=__toESM(require_exec());var import_node_http2=__toESM(require("node:http"),1),import_node_https2=__toESM(require("node:https"),1);init_node_fetch_native_d7878b77();init_node_fetch_native_d7878b77();var import_node_fs=require("node:fs");init_node_fetch_native_d7878b77();var{stat}=import_node_fs.promises;var BlobDataItem=class _BlobDataItem{#path;#start;constructor(options){this.#path=options.path,this.#start=options.start,this.size=options.size,this.lastModified=options.lastModified}slice(start,end){return new _BlobDataItem({path:this.#path,lastModified:this.lastModified,size:end-start,start:this.#start+start})}async*stream(){let{mtimeMs}=await stat(this.#path);if(mtimeMs>this.lastModified)throw new DOMException$1("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.","NotReadableError");yield*(0,import_node_fs.createReadStream)(this.#path,{start:this.#start,end:this.#start+this.size-1})}get[Symbol.toStringTag](){return"Blob"}};var _forceNodeFetch=typeof process!==void 0&&typeof process.env!==void 0&&process.env.FORCE_NODE_FETCH;function _getFetch(){return!_forceNodeFetch&&globalThis.fetch?globalThis.fetch:fetch}var fetch2=_getFetch(),Blob3=!_forceNodeFetch&&globalThis.Blob||_Blob$1,File3=!_forceNodeFetch&&globalThis.File||File$1,FormData3=!_forceNodeFetch&&globalThis.FormData||FormData,Headers2=!_forceNodeFetch&&globalThis.Headers||Headers,Request2=!_forceNodeFetch&&globalThis.Request||Request,Response2=!_forceNodeFetch&&globalThis.Response||Response,AbortController3=!_forceNodeFetch&&globalThis.AbortController||AbortController$1;var suspectProtoRx=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,suspectConstructorRx=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,JsonSigRx=/^\s*["[{]|^\s*-?\d[\d.]{0,14}\s*$/;function jsonParseTransform(key,value){if(key==="__proto__"||key==="constructor"&&value&&typeof value=="object"&&"prototype"in value){warnKeyDropped(key);return}return value}function warnKeyDropped(key){console.warn(`[destr] Dropping "${key}" key to prevent prototype pollution.`)}function destr(value,options={}){if(typeof value!="string")return value;let _value=value.trim();if(value[0]==='"'&&value[value.length-1]==='"')return _value.slice(1,-1);let _lval=_value.toLowerCase();if(_lval==="true")return!0;if(_lval==="false")return!1;if(_lval!=="undefined"){if(_lval==="null")return null;if(_lval==="nan")return Number.NaN;if(_lval==="infinity")return Number.POSITIVE_INFINITY;if(_lval==="-infinity")return Number.NEGATIVE_INFINITY;if(!JsonSigRx.test(value)){if(options.strict)throw new SyntaxError("[destr] Invalid JSON");return value}try{if(suspectProtoRx.test(value)||suspectConstructorRx.test(value)){if(options.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(value,jsonParseTransform)}return JSON.parse(value)}catch(error){if(options.strict)throw error;return value}}}var r2=String.fromCharCode;var HASH_RE=/#/g,AMPERSAND_RE=/&/g;var EQUAL_RE=/=/g;var PLUS_RE=/\+/g,ENC_CARET_RE=/%5e/gi,ENC_BACKTICK_RE=/%60/gi;var ENC_PIPE_RE=/%7c/gi;var ENC_SPACE_RE=/%20/gi;function encode(text){return encodeURI(""+text).replace(ENC_PIPE_RE,"|")}function encodeQueryValue(input){return encode(typeof input=="string"?input:JSON.stringify(input)).replace(PLUS_RE,"%2B").replace(ENC_SPACE_RE,"+").replace(HASH_RE,"%23").replace(AMPERSAND_RE,"%26").replace(ENC_BACKTICK_RE,"`").replace(ENC_CARET_RE,"^")}function encodeQueryKey(text){return encodeQueryValue(text).replace(EQUAL_RE,"%3D")}function decode(text=""){try{return decodeURIComponent(""+text)}catch{return""+text}}function decodeQueryValue(text){return decode(text.replace(PLUS_RE," "))}function parseQuery(parametersString=""){let object={};parametersString[0]==="?"&&(parametersString=parametersString.slice(1));for(let parameter of parametersString.split("&")){let s2=parameter.match(/([^=]+)=?(.*)/)||[];if(s2.length<2)continue;let key=decode(s2[1]);if(key==="__proto__"||key==="constructor")continue;let value=decodeQueryValue(s2[2]||"");typeof object[key]<"u"?Array.isArray(object[key])?object[key].push(value):object[key]=[object[key],value]:object[key]=value}return object}function encodeQueryItem(key,value){return(typeof value=="number"||typeof value=="boolean")&&(value=String(value)),value?Array.isArray(value)?value.map(_value=>`${encodeQueryKey(key)}=${encodeQueryValue(_value)}`).join("&"):`${encodeQueryKey(key)}=${encodeQueryValue(value)}`:encodeQueryKey(key)}function stringifyQuery(query){return Object.keys(query).filter(k=>query[k]!==void 0).map(k=>encodeQueryItem(k,query[k])).join("&")}var PROTOCOL_STRICT_REGEX=/^\w{2,}:([/\\]{1,2})/,PROTOCOL_REGEX=/^\w{2,}:([/\\]{2})?/,PROTOCOL_RELATIVE_REGEX=/^([/\\]\s*){2,}[^/\\]/;function hasProtocol(inputString,opts={}){return typeof opts=="boolean"&&(opts={acceptRelative:opts}),opts.strict?PROTOCOL_STRICT_REGEX.test(inputString):PROTOCOL_REGEX.test(inputString)||(opts.acceptRelative?PROTOCOL_RELATIVE_REGEX.test(inputString):!1)}var TRAILING_SLASH_RE=/\/$|\/\?/;function hasTrailingSlash(input="",queryParameters=!1){return queryParameters?TRAILING_SLASH_RE.test(input):input.endsWith("/")}function withoutTrailingSlash(input="",queryParameters=!1){if(!queryParameters)return(hasTrailingSlash(input)?input.slice(0,-1):input)||"/";if(!hasTrailingSlash(input,!0))return input||"/";let[s0,...s2]=input.split("?");return(s0.slice(0,-1)||"/")+(s2.length>0?`?${s2.join("?")}`:"")}function withTrailingSlash(input="",queryParameters=!1){if(!queryParameters)return input.endsWith("/")?input:input+"/";if(hasTrailingSlash(input,!0))return input||"/";let[s0,...s2]=input.split("?");return s0+"/"+(s2.length>0?`?${s2.join("?")}`:"")}function hasLeadingSlash(input=""){return input.startsWith("/")}function withoutLeadingSlash(input=""){return(hasLeadingSlash(input)?input.slice(1):input)||"/"}function withBase(input,base){if(isEmptyURL(base)||hasProtocol(input))return input;let _base=withoutTrailingSlash(base);return input.startsWith(_base)?input:joinURL(_base,input)}function withQuery(input,query){let parsed=parseURL(input),mergedQuery={...parseQuery(parsed.search),...query};return parsed.search=stringifyQuery(mergedQuery),stringifyParsedURL(parsed)}function isEmptyURL(url){return!url||url==="/"}function isNonEmptyURL(url){return url&&url!=="/"}function joinURL(base,...input){let url=base||"";for(let index of input.filter(url2=>isNonEmptyURL(url2)))url=url?withTrailingSlash(url)+withoutLeadingSlash(index):index;return url}function parseURL(input="",defaultProto){if(!hasProtocol(input,{acceptRelative:!0}))return defaultProto?parseURL(defaultProto+input):parsePath(input);let[protocol="",auth,hostAndPath=""]=(input.replace(/\\/g,"/").match(/([^/:]+:)?\/\/([^/@]+@)?(.*)/)||[]).splice(1),[host="",path=""]=(hostAndPath.match(/([^#/?]*)(.*)?/)||[]).splice(1),{pathname,search,hash}=parsePath(path.replace(/\/(?=[A-Za-z]:)/,""));return{protocol,auth:auth?auth.slice(0,Math.max(0,auth.length-1)):"",host,pathname,search,hash}}function parsePath(input=""){let[pathname="",search="",hash=""]=(input.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname,search,hash}}function stringifyParsedURL(parsed){let fullpath=parsed.pathname+(parsed.search?(parsed.search.startsWith("?")?"":"?")+parsed.search:"")+parsed.hash;return parsed.protocol?parsed.protocol+"//"+(parsed.auth?parsed.auth+"@":"")+parsed.host+fullpath:fullpath}var FetchError2=class extends Error{constructor(){super(...arguments),this.name="FetchError"}};function createFetchError(request,error,response){let message="";error&&(message=error.message),request&&response?message=`${message} (${response.status} ${response.statusText} (${request.toString()}))`:request&&(message=`${message} (${request.toString()})`);let fetchError=new FetchError2(message);return Object.defineProperty(fetchError,"request",{get(){return request}}),Object.defineProperty(fetchError,"response",{get(){return response}}),Object.defineProperty(fetchError,"data",{get(){return response&&response._data}}),Object.defineProperty(fetchError,"status",{get(){return response&&response.status}}),Object.defineProperty(fetchError,"statusText",{get(){return response&&response.statusText}}),Object.defineProperty(fetchError,"statusCode",{get(){return response&&response.status}}),Object.defineProperty(fetchError,"statusMessage",{get(){return response&&response.statusText}}),fetchError}var payloadMethods=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function isPayloadMethod(method="GET"){return payloadMethods.has(method.toUpperCase())}function isJSONSerializable(value){if(value===void 0)return!1;let t2=typeof value;return t2==="string"||t2==="number"||t2==="boolean"||t2===null?!0:t2!=="object"?!1:Array.isArray(value)?!0:value.constructor&&value.constructor.name==="Object"||typeof value.toJSON=="function"}var textTypes=new Set(["image/svg","application/xml","application/xhtml","application/html"]),JSON_RE=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function detectResponseType(_contentType=""){if(!_contentType)return"json";let contentType=_contentType.split(";").shift()||"";return JSON_RE.test(contentType)?"json":textTypes.has(contentType)||contentType.startsWith("text/")?"text":"blob"}function mergeFetchOptions(input,defaults,Headers4=globalThis.Headers){let merged={...defaults,...input};if(defaults?.params&&input?.params&&(merged.params={...defaults?.params,...input?.params}),defaults?.query&&input?.query&&(merged.query={...defaults?.query,...input?.query}),defaults?.headers&&input?.headers){merged.headers=new Headers4(defaults?.headers||{});for(let[key,value]of new Headers4(input?.headers||{}))merged.headers.set(key,value)}return merged}var retryStatusCodes=new Set([408,409,425,429,500,502,503,504]);function createFetch(globalOptions){let{fetch:fetch4,Headers:Headers4}=globalOptions;function onError(context){let isAbort=context.error&&context.error.name==="AbortError"||!1;if(context.options.retry!==!1&&!isAbort){let retries;typeof context.options.retry=="number"?retries=context.options.retry:retries=isPayloadMethod(context.options.method)?0:1;let responseCode=context.response&&context.response.status||500;if(retries>0&&retryStatusCodes.has(responseCode))return $fetchRaw(context.request,{...context.options,retry:retries-1})}let error=createFetchError(context.request,context.error,context.response);throw Error.captureStackTrace&&Error.captureStackTrace(error,$fetchRaw),error}let $fetchRaw=async function(_request,_options={}){let context={request:_request,options:mergeFetchOptions(_options,globalOptions.defaults,Headers4),response:void 0,error:void 0};context.options.onRequest&&await context.options.onRequest(context),typeof context.request=="string"&&(context.options.baseURL&&(context.request=withBase(context.request,context.options.baseURL)),(context.options.query||context.options.params)&&(context.request=withQuery(context.request,{...context.options.params,...context.options.query})),context.options.body&&isPayloadMethod(context.options.method)&&isJSONSerializable(context.options.body)&&(context.options.body=typeof context.options.body=="string"?context.options.body:JSON.stringify(context.options.body),context.options.headers=new Headers4(context.options.headers||{}),context.options.headers.has("content-type")||context.options.headers.set("content-type","application/json"),context.options.headers.has("accept")||context.options.headers.set("accept","application/json")));try{context.response=await fetch4(context.request,context.options)}catch(error){return context.error=error,context.options.onRequestError&&await context.options.onRequestError(context),await onError(context)}let responseType=(context.options.parseResponse?"json":context.options.responseType)||detectResponseType(context.response.headers.get("content-type")||"");if(responseType==="json"){let data=await context.response.text(),parseFunction=context.options.parseResponse||destr;context.response._data=parseFunction(data)}else responseType==="stream"?context.response._data=context.response.body:context.response._data=await context.response[responseType]();return context.options.onResponse&&await context.options.onResponse(context),!context.options.ignoreResponseError&&context.response.status>=400&&context.response.status<600?(context.options.onResponseError&&await context.options.onResponseError(context),await onError(context)):context.response},$fetch=async function(request,options){return(await $fetchRaw(request,options))._data};return $fetch.raw=$fetchRaw,$fetch.native=fetch4,$fetch.create=(defaultOptions={})=>createFetch({...globalOptions,defaults:{...globalOptions.defaults,...defaultOptions}}),$fetch}function createNodeFetch(){if(!JSON.parse(process.env.FETCH_KEEP_ALIVE||"false"))return fetch2;let agentOptions={keepAlive:!0},httpAgent=new import_node_http2.default.Agent(agentOptions),httpsAgent=new import_node_https2.default.Agent(agentOptions),nodeFetchOptions={agent(parsedURL){return parsedURL.protocol==="http:"?httpAgent:httpsAgent}};return function(input,init){return fetch2(input,{...nodeFetchOptions,...init})}}var fetch3=globalThis.fetch||createNodeFetch(),Headers3=globalThis.Headers||Headers2,ofetch=createFetch({fetch:fetch3,Headers:Headers3});var import_promises=require("node:fs/promises"),import_node_os=require("node:os"),import_node_path=require("node:path"),install=async()=>{(0,import_core.startGroup)("Install attic");let installScript=await fetch3("https://raw.githubusercontent.com/zhaofengli/attic/main/.github/install-attic-ci.sh").then(r3=>{if(!r3.ok)throw new Error(`Failed to fetch install script: ${r3.status} ${r3.statusText}`);return r3.text()}),installScriptPath=(0,import_node_path.join)((0,import_node_os.tmpdir)(),"install-attic-ci.sh");await(0,import_promises.writeFile)(installScriptPath,installScript),await(0,import_exec.exec)("bash",[installScriptPath]),(0,import_core.endGroup)()};var import_core2=__toESM(require_core()),import_exec2=__toESM(require_exec()),configure=async()=>{(0,import_core2.startGroup)("Configure attic");let endpoint=(0,import_core2.getInput)("endpoint"),token=(0,import_core2.getInput)("token");await(0,import_exec2.exec)("attic",["login","--set-default","ci",endpoint,token]),(0,import_core2.endGroup)()};var import_core3=__toESM(require_core()),import_exec3=__toESM(require_exec()),push=async()=>{let cache=(0,import_core3.getInput)("cache"),paths=(0,import_core3.getMultilineInput)("paths");await(0,import_exec3.exec)("attic",["push",cache,...paths])};(async()=>{await install(),await configure(),await push()})().catch(e2=>{console.error(e2),process.exit(1)}); /*! Bundled license information: node-fetch-native/dist/shared/node-fetch-native.d7878b77.mjs: diff --git a/src/stages/push.ts b/src/stages/push.ts index 9ec513d..ec4aa51 100644 --- a/src/stages/push.ts +++ b/src/stages/push.ts @@ -3,7 +3,7 @@ import { exec } from "@actions/exec"; export const push = async () => { const cache = getInput("cache"); - const paths = getMultilineInput("token"); + const paths = getMultilineInput("paths"); await exec("attic", ["push", cache, ...paths]); };