3
0
Fork 0
mirror of https://gitea.com/docker/login-action.git synced 2024-11-22 17:39:35 +01:00
docker-login/dist/index.js

19 lines
995 KiB
JavaScript
Raw Normal View History

require('./sourcemap-register.js');(()=>{var e={7351:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var A=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);o(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.issue=t.issueCommand=void 0;const s=A(r(2037));const i=r(5278);function issueCommand(e,t,r){const n=new Command(e,t,r);process.stdout.write(n.toString()+s.EOL)}t.issueCommand=issueCommand;function issue(e,t=""){issueCommand(e,{},t)}t.issue=issue;const a="::";class Command{constructor(e,t,r){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=r}toString(){let e=a+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=true;for(const r in this.properties){if(this.properties.hasOwnProperty(r)){const n=this.properties[r];if(n){if(t){t=false}else{e+=","}e+=`${r}=${escapeProperty(n)}`}}}}e+=`${a}${escapeData(this.message)}`;return e}}function escapeData(e){return i.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return i.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},2186:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var A=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);o(t,e);return t};var s=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function fulfilled(e){try{step(n.next(e))}catch(e){o(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){o(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.getIDToken=t.getState=t.saveState=t.group=t.endGroup=t.startGroup=t.info=t.notice=t.warning=t.error=t.debug=t.isDebug=t.setFailed=t.setCommandEcho=t.setOutput=t.getBooleanInput=t.getMultilineInput=t.getInput=t.addPath=t.setSecret=t.exportVariable=t.ExitCode=void 0;const i=r(7351);const a=r(717);const c=r(5278);const l=A(r(2037));const u=A(r(1017));const d=r(8041);var g;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(g=t.ExitCode||(t.ExitCode={}));function exportVariable(e,t){const r=c.toCommandValue(t);process.env[e]=r;const n=process.env["GITHUB_ENV"]||"";if(n){return a.issueFileCommand("ENV",a.prepareKeyValueMessage(e,t))}i.issueCommand("set-env",{name:e},r)}t.exportVariable=exportVariable;function setSecret(e){i.issueCommand("add-mask",{},e)}t.setSecret=setSecret;function addPath(e){const t=process.env["GITHUB_PATH"]||"";if(t){a.issueFileCommand("PATH",e)}else{i.issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${u.delimiter}${process.env["PATH"]}`}t.addPath=addPath;function getInput(e,t){const r=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(t&&t.required&&!r){throw new Error(`Input required and not supplied: ${e}`)}if(t&&t.trimWhitespace===false){return r}return r.trim()}t.getInput=getInput;function getMultilineInput(e,t){const r=getInput(e,t).split("\n").filter((e=>e!==""));if(t&&t.trimWhitespace===false){return r}return r.map((e=>e.trim()))}t.getM
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var t;var r;var n;var o;var A;var s;var i;var a;var c;var l;var u;var d;var g;var h;var E;var f;var p;var C;var I;var Q;var B;var m;var y;(function(t){var r=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd){define("tslib",["exports"],(function(e){t(createExporter(r,createExporter(e)))}))}else if(true&&typeof e.exports==="object"){t(createExporter(r,createExporter(e.exports)))}else{t(createExporter(r))}function createExporter(e,t){if(e!==r){if(typeof Object.create==="function"){Object.defineProperty(e,"__esModule",{value:true})}else{e.__esModule=true}}return function(r,n){return e[r]=t?t(r,n):n}}})((function(e){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};t=function(e,t){v(e,t);function __(){this.constructor=e}e.prototype=t===null?Object.create(t):(__.prototype=t.prototype,new __)};r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))e[o]=t[o]}return e};n=function(e,t){var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0)r[n]=e[n];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++){if(t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o]))r[n[o]]=e[n[o]]}return r};o=function(e,t,r,n){var o=arguments.length,A=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")A=Reflect.decorate(e,t,r,n);else for(var i=e.length-1;i>=0;i--)if(s=e[i])A=(o<3?s(A):o>3?s(t,r,A):s(t,r))||A;return o>3&&A&&Object.defineProperty(t,r,A),A};A=function(e,t){return function(r,n){t(r,n,e)}};s=function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};i=function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function fulfilled(e){try{step(n.next(e))}catch(e){o(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){o(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};a=function(e,t){var r={label:0,sent:function(){if(A[0]&1)throw A[1];return A[1]},trys:[],ops:[]},n,o,A,s;return s={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function verb(e){return function(t){return step([e,t])}}function step(s){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,o&&(A=s[0]&2?o["return"]:s[0]?o["throw"]||((A=o["return"])&&A.call(o),0):o.next)&&!(A=A.call(o,s[1])).done)return A;if(o=0,A)s=[s[0]&2,A.value];switch(s[0]){case 0:case 1:A=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;o=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(A=r.trys,A=A.length>0&&A[A.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!A||s[1]>A[0]&&s[1]<A[3])){r.label=s[1];break}if(s[0]===6&&r.label<A[1]){r.label=A[1];A=s;break}if(A&&r.label<A[2]){r.label=A[2];r.ops.push(s);break}if(A[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];o=0}finally{n=A=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};y=function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]};c=function(e,t){for(var r in e)if(r!=="default"&&!t.hasOwnProperty(r))t[r]=e[r]};l=function(e){var t=typeof Symbol==="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length==="number")return{next:function(){if(e&&n>=e.length)e=void 0;return{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};u=function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,A=[],s;try{while((t===void 0||t-- >0)&&!(o=n.next()).done)A.push(o.value)}catch(e){s={error:e}}finally{try{if(o&&!o.done&&(r=n[
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=e=>e.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=e=>e.replace(/\r?\n|\r/g,"\r\n");const n=[];const o=new Uint8Array([13,10]);u=0;let A=false;for(const[t,s]of e){if(typeof s==="string"){const e=S.encode(r+`; name="${escape(normalizeLinefeeds(t))}"`+`\r\n\r\n${normalizeLinefeeds(s)}\r\n`);n.push(e);u+=e.byteLength}else{const e=S.encode(`${r}; name="${escape(normalizeLinefeeds(t))}"`+(s.name?`; filename="${escape(s.name)}"`:"")+"\r\n"+`Content-Type: ${s.type||"application/octet-stream"}\r\n\r\n`);n.push(e,s,o);if(typeof s.size==="number"){u+=e.byteLength+s.size+o.byteLength}else{A=true}}}const s=S.encode(`--${t}--`);n.push(s);u+=s.byteLength;if(A){u=null}l=e;c=async function*(){for(const e of n){if(e.stream){yield*e.stream()}else{yield e}}};d="multipart/form-data; boundary="+t}else if(s(e)){l=e;u=e.size;if(e.type){d=e.type}}else if(typeof e[Symbol.asyncIterator]==="function"){if(t){throw new TypeError("keepalive")}if(o.isDisturbed(e)||e.locked){throw new TypeError("Response body object should not be disturbed or locked")}n=e instanceof b?e:A(e)}if(typeof l==="string"||o.isBuffer(l)){u=Buffer.byteLength(l)}if(c!=null){let t;n=new b({async start(){t=c(e)[Symbol.asyncIterator]()},async pull(e){const{value:r,done:o}=await t.next();if(o){queueMicrotask((()=>{e.close()}))}else{if(!Q(n)){e.enqueue(new Uint8Array(r))}}return e.desiredSize>0},async cancel(e){await t.return()},type:undefined})}const g={stream:n,source:l,length:u};return[g,d]}function safelyExtractBody(e,t=false){if(!b){b=r(5356).ReadableStream}if(e instanceof b){I(!o.isDisturbed(e),"The body has already been consumed.");I(!e.locked,"The stream is locked.")}return extractBody(e,t)}function cloneBody(e){const[t,r]=e.stream.tee();const n=E(r,{transfer:[r]});const[,o]=n.tee();e.stream=t;return{stream:o,length:e.length,source:e.source}}async function*consumeBody(e){if(e){if(B(e)){yield e}else{const t=e.stream;if(o.isDisturbed(t)){throw new TypeError("The body has already been consumed.")}if(t.locked){throw new TypeError("The stream is locked.")}t[C]=true;yield*t}}}function throwIfAborted(e){if(e.aborted){throw new h("The operation was aborted.","AbortError")}}function bodyMixinMethods(e){const t={blob(){return specConsumeBody(this,(e=>{let t=bodyMimeType(this);if(t==="failure"){t=""}else if(t){t=w(t)}return new f([e],{type:t})}),e)},arrayBuffer(){return specConsumeBody(this,(e=>new Uint8Array(e).buffer),e)},text(){return specConsumeBody(this,utf8DecodeBytes,e)},json(){return specConsumeBody(this,parseJSONFromBytes,e)},async formData(){g.brandCheck(this,e);throwIfAborted(this[d]);const t=this.headers.get("Content-Type");if(/multipart\/form-data/.test(t)){const e={};for(const[t,r]of this.headers)e[t.toLowerCase()]=r;const t=new u;let r;try{r=new n({headers:e,preservePath:true})}catch(e){throw new h(`${e}`,"AbortError")}r.on("field",((e,r)=>{t.append(e,r)}));r.on("file",((e,r,n,o,A)=>{const s=[];if(o==="base64"||o.toLowerCase()==="base64"){let o="";r.on("data",(e=>{o+=e.toString().replace(/[\r\n]/gm,"");const t=o.length-o.length%4;s.push(Buffer.from(o.slice(0,t),"base64"));o=o.slice(t)}));r.on("end",(()=>{s.push(Buffer.from(o,"base64"));t.append(e,new R(s,n,{type:A}))}))}else{r.on("data",(e=>{s.push(e)}));r.on("end",(()=>{t.append(e,new R(s,n,{type:A}))}))}}));const o=new Promise(((e,t)=>{r.on("finish",e);r.on("error",(e=>t(new TypeError(e))))}));if(this.body!==null)for await(const e of consumeBody(this[d].body))r.write(e);r.end();await o;return t}else if(/application\/x-www-form-urlencoded/.test(t)){let e;try{let t="";const r=new TextDecoder("utf-8",{ignoreBOM:true});for await(const e of consumeBody(this[d].body)){if(!B(e)){throw new TypeError("Expected Uint8Array chunk")}t+=r.decode(e,{stream:true})}t+=r.decode();e=new URLSearchParams(t)}catch(e){throw Object.assign(new TypeError,{cause:e})}const t=new u;for(const[r,n]of e){t.append(r,n)}return t}else{await Promise.resolve();throwIfAborted(this[d]);throw g.errors.exception({he
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */A[o-4]=this.maskKey[0];A[o-3]=this.maskKey[1];A[o-2]=this.maskKey[2];A[o-1]=this.maskKey[3];A[1]=r;if(r===126){A.writeUInt16BE(t,2)}else if(r===127){A[2]=A[3]=0;A.writeUIntBE(t,4,6)}A[1]|=128;for(let e=0;e<t;e++){A[o+e]=this.frameData[e]^this.maskKey[e%4]}return A}}e.exports={WebsocketFrameSend:WebsocketFrameSend}},1688:(e,t,r)=>{"use strict";const{Writable:n}=r(2781);const o=r(7643);const{parserStates:A,opcodes:s,states:i,emptyBuffer:a}=r(9188);const{kReadyState:c,kSentClose:l,kResponse:u,kReceivedClose:d}=r(7578);const{isValidStatusCode:g,failWebsocketConnection:h,websocketMessageReceived:E}=r(5515);const{WebsocketFrameSend:f}=r(5444);const p={};p.ping=o.channel("undici:websocket:ping");p.pong=o.channel("undici:websocket:pong");class ByteParser extends n{#s=[];#i=0;#a=A.INFO;#c={};#l=[];constructor(e){super();this.ws=e}_write(e,t,r){this.#s.push(e);this.#i+=e.length;this.run(r)}run(e){while(true){if(this.#a===A.INFO){if(this.#i<2){return e()}const t=this.consume(2);this.#c.fin=(t[0]&128)!==0;this.#c.opcode=t[0]&15;this.#c.originalOpcode??=this.#c.opcode;this.#c.fragmented=!this.#c.fin&&this.#c.opcode!==s.CONTINUATION;if(this.#c.fragmented&&this.#c.opcode!==s.BINARY&&this.#c.opcode!==s.TEXT){h(this.ws,"Invalid frame type was fragmented.");return}const r=t[1]&127;if(r<=125){this.#c.payloadLength=r;this.#a=A.READ_DATA}else if(r===126){this.#a=A.PAYLOADLENGTH_16}else if(r===127){this.#a=A.PAYLOADLENGTH_64}if(this.#c.fragmented&&r>125){h(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((this.#c.opcode===s.PING||this.#c.opcode===s.PONG||this.#c.opcode===s.CLOSE)&&r>125){h(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(this.#c.opcode===s.CLOSE){if(r===1){h(this.ws,"Received close frame with a 1-byte body.");return}const e=this.consume(r);this.#c.closeInfo=this.parseCloseBody(false,e);if(!this.ws[l]){const e=Buffer.allocUnsafe(2);e.writeUInt16BE(this.#c.closeInfo.code,0);const t=new f(e);this.ws[u].socket.write(t.createFrame(s.CLOSE),(e=>{if(!e){this.ws[l]=true}}))}this.ws[c]=i.CLOSING;this.ws[d]=true;this.end();return}else if(this.#c.opcode===s.PING){const t=this.consume(r);if(!this.ws[d]){const e=new f(t);this.ws[u].socket.write(e.createFrame(s.PONG));if(p.ping.hasSubscribers){p.ping.publish({payload:t})}}this.#a=A.INFO;if(this.#i>0){continue}else{e();return}}else if(this.#c.opcode===s.PONG){const t=this.consume(r);if(p.pong.hasSubscribers){p.pong.publish({payload:t})}if(this.#i>0){continue}else{e();return}}}else if(this.#a===A.PAYLOADLENGTH_16){if(this.#i<2){return e()}const t=this.consume(2);this.#c.payloadLength=t.readUInt16BE(0);this.#a=A.READ_DATA}else if(this.#a===A.PAYLOADLENGTH_64){if(this.#i<8){return e()}const t=this.consume(8);const r=t.readUInt32BE(0);if(r>2**31-1){h(this.ws,"Received payload length > 2^31 bytes.");return}const n=t.readUInt32BE(4);this.#c.payloadLength=(r<<8)+n;this.#a=A.READ_DATA}else if(this.#a===A.READ_DATA){if(this.#i<this.#c.payloadLength){return e()}else if(this.#i>=this.#c.payloadLength){const e=this.consume(this.#c.payloadLength);this.#l.push(e);if(!this.#c.fragmented||this.#c.fin&&this.#c.opcode===s.CONTINUATION){const e=Buffer.concat(this.#l);E(this.ws,this.#c.originalOpcode,e);this.#c={};this.#l.length=0}this.#a=A.INFO}}if(this.#i>0){continue}else{e();break}}}consume(e){if(e>this.#i){return null}else if(e===0){return a}if(this.#s[0].length===e){this.#i-=this.#s[0].length;return this.#s.shift()}const t=Buffer.allocUnsafe(e);let r=0;while(r!==e){const n=this.#s[0];const{length:o}=n;if(o+r===e){t.set(this.#s.shift(),r);break}else if(o+r>e){t.set(n.subarray(0,e-r),r);this.#s[0]=n.subarray(e-r);break}else{t.set(this.#s.shift(),r);r+=n.length}}this.#i-=e;return t}parseCloseBody(e,t){let r;if(t.length>=2){r=t.readUInt16BE(0)}if(e){if(!g(r)){return null}return{code:r}}let n=t.subarray(2);if(n[0]===239&&n[1]===187&&n[2]===191){n=n.subarray(3)}if(r!==undefined&&!g(r)){return null}try{n=new TextDecoder("utf-8",{fatal:true}).decode(n)}catch{return null}return{code:r,reason:n}}get closingIn
//# sourceMappingURL=index.js.map