diff options
66 files changed, 4406 insertions, 7131 deletions
diff --git a/.editorconfig b/.editorconfig index 2de35d8..a336d0b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -34,7 +34,6 @@ trim_trailing_whitespace = true # JavaScript, JSON, JSX, JavaScript Modules, TypeScript # https://github.com/feross/standard -# https://prettier.io [*.{cjs,js,json,jsx,mjs,ts,tsx}] indent_size = 4 tab_width = 4 diff --git a/.eslintignore b/.eslintignore deleted file mode 120000 index 656b796..0000000 --- a/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -.prettierignore
\ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 31ba093..a8601e5 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,61 +1,61 @@ name: 🐞 Bug Report description: Report a bug labels: - - kind/bug - - status/needs-triage + - kind/bug + - status/needs-triage body: - - type: checkboxes - id: product - attributes: - label: Product name - description: What Polyfrost product are you using? - options: - - label: Website - - label: Launcher - - label: Installer + - type: checkboxes + id: product + attributes: + label: Product name + description: What Polyfrost product are you using? + options: + - label: Website + - label: Launcher + - label: Installer - - type: markdown - attributes: - value: | - ## First of all - 1. Please search for [existing issues](https://github.com/polyfrost/nexus/issues?q=is%3Aissue) about this problem first. - 2. Make sure it's an issue with our products and not something else you are using. - 3. Remember to follow our community guidelines and be friendly. + - type: markdown + attributes: + value: | + ## First of all + 1. Please search for [existing issues](https://github.com/polyfrost/nexus/issues?q=is%3Aissue) about this problem first. + 2. Make sure it's an issue with our products and not something else you are using. + 3. Remember to follow our community guidelines and be friendly. - - type: textarea - id: description - attributes: - label: Describe the bug - description: A clear description of what the bug is. Include screenshots if applicable. - placeholder: Bug description - validations: - required: true + - type: textarea + id: description + attributes: + label: Describe the bug + description: A clear description of what the bug is. Include screenshots if applicable. + placeholder: Bug description + validations: + required: true - - type: textarea - id: reproduction - attributes: - label: Reproduction - description: Steps to reproduce the behavior. - placeholder: | - 1. Go to ... - 2. Click on ... - 3. See error + - type: textarea + id: reproduction + attributes: + label: Reproduction + description: Steps to reproduce the behavior. + placeholder: | + 1. Go to ... + 2. Click on ... + 3. See error - - type: textarea - id: expected-behavior - attributes: - label: Expected behavior - description: A clear description of what you expected to happen. + - type: textarea + id: expected-behavior + attributes: + label: Expected behavior + description: A clear description of what you expected to happen. - - type: textarea - id: logs - attributes: - label: Stack trace (optional) - render: Shell + - type: textarea + id: logs + attributes: + label: Stack trace (optional) + render: Shell - - type: textarea - id: context - attributes: - label: Additional context - description: Add any other context about the problem here. + - type: textarea + id: context + attributes: + label: Additional context + description: Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 77fbf47..ddd6b22 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -2,12 +2,12 @@ # yaml-language-server: $schema=https://json.schemastore.org/github-issue-config.json blank_issues_enabled: false contact_links: - - name: 🙏 Get Help - url: https://github.com/polyfrost/nexus/discussions/new?category=help - about: If you can't get something to work the way you expect, open a question in our discussion forums. - - name: 💡 Feature Request - url: https://github.com/polyfrost/nexus/discussions/new?category=ideas - about: Suggest any ideas you have using our discussion forums. - - name: 💬 Discord Chat - url: https://polyfrost.cc/discord - about: Ask questions and talk to other Polyfrost product users and the devs. + - name: 🙏 Get Help + url: https://github.com/polyfrost/nexus/discussions/new?category=help + about: If you can't get something to work the way you expect, open a question in our discussion forums. + - name: 💡 Feature Request + url: https://github.com/polyfrost/nexus/discussions/new?category=ideas + about: Suggest any ideas you have using our discussion forums. + - name: 💬 Discord Chat + url: https://polyfrost.cc/discord + about: Ask questions and talk to other Polyfrost product users and the devs. diff --git a/.github/actions/publish-artifacts/action.yaml b/.github/actions/publish-artifacts/action.yaml index c3679af..1bc878a 100644 --- a/.github/actions/publish-artifacts/action.yaml +++ b/.github/actions/publish-artifacts/action.yaml @@ -1,14 +1,14 @@ name: Publish artifacts description: Publishes artifacts after CI process inputs: - target: - description: target triples for built artifact - profile: - description: "'debug' or 'release'" - os: - description: "'darwin', 'windows', or 'linux'" - arch: - description: "'x86_64' or 'aarch64'" + target: + description: target triples for built artifact + profile: + description: '''debug'' or ''release''' + os: + description: '''darwin'', ''windows'', or ''linux''' + arch: + description: '''x86_64'' or ''aarch64''' runs: - using: node20 - main: dist/index.js + using: node20 + main: dist/index.js diff --git a/.github/actions/publish-artifacts/dist/index.js b/.github/actions/publish-artifacts/dist/index.js index ab88e6b..b117d74 100644 --- a/.github/actions/publish-artifacts/dist/index.js +++ b/.github/actions/publish-artifacts/dist/index.js @@ -1,4 +1,4 @@ -(()=>{var A={5049:(A,e,t)=>{"use strict";var r;r={value:true};e.U=void 0;const n=t(7697);function create(){return n.DefaultArtifactClient.create()}e.U=create},7697:function(A,e,t){"use strict";var r=this&&this.__createBinding||(Object.create?function(A,e,t,r){if(r===undefined)r=t;var n=Object.getOwnPropertyDescriptor(e,t);if(!n||("get"in n?!e.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return e[t]}}}Object.defineProperty(A,r,n)}:function(A,e,t,r){if(r===undefined)r=t;A[r]=e[t]});var n=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:true,value:e})}:function(A,e){A["default"]=e});var i=this&&this.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)if(t!=="default"&&Object.prototype.hasOwnProperty.call(A,t))r(e,A,t);n(e,A);return e};var s=this&&this.__awaiter||function(A,e,t,r){function adopt(A){return A instanceof t?A:new t((function(e){e(A)}))}return new(t||(t=Promise))((function(t,n){function fulfilled(A){try{step(r.next(A))}catch(A){n(A)}}function rejected(A){try{step(r["throw"](A))}catch(A){n(A)}}function step(A){A.done?t(A.value):adopt(A.value).then(fulfilled,rejected)}step((r=r.apply(A,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:true});e.DefaultArtifactClient=void 0;const o=i(t(9050));const a=t(1661);const c=t(2523);const g=t(4172);const E=t(9574);const l=t(5339);const Q=t(7103);const B=t(2996);const h=t(1017);class DefaultArtifactClient{static create(){return new DefaultArtifactClient}uploadArtifact(A,e,t,r){return s(this,void 0,void 0,(function*(){o.info(`Starting artifact upload\nFor more detailed logs during the artifact upload process, enable step-debugging: https://docs.github.com/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging`);(0,E.checkArtifactName)(A);const n=(0,a.getUploadSpecification)(A,t,e);const i={artifactName:A,artifactItems:[],size:0,failedItems:[]};const s=new c.UploadHttpClient;if(n.length===0){o.warning(`No files found that can be uploaded`)}else{const e=yield s.createArtifactInFileContainer(A,r);if(!e.fileContainerResourceUrl){o.debug(e.toString());throw new Error("No URL provided by the Artifact Service to upload an artifact to")}o.debug(`Upload Resource URL: ${e.fileContainerResourceUrl}`);o.info(`Container for artifact "${A}" successfully created. Starting upload of file(s)`);const t=yield s.uploadArtifactToFileContainer(e.fileContainerResourceUrl,n,r);o.info(`File upload process has finished. Finalizing the artifact upload`);yield s.patchArtifactSize(t.totalSize,A);if(t.failedItems.length>0){o.info(`Upload finished. There were ${t.failedItems.length} items that failed to upload`)}else{o.info(`Artifact has been finalized. All files have been successfully uploaded!`)}o.info(`\nThe raw size of all the files that were specified for upload is ${t.totalSize} bytes\nThe size of all the files that were uploaded is ${t.uploadSize} bytes. This takes into account any gzip compression used to reduce the upload size, time and storage\n\nNote: The size of downloaded zips can differ significantly from the reported size. For more information see: https://github.com/actions/upload-artifact#zipped-artifact-downloads \r\n`);i.artifactItems=n.map((A=>A.absoluteFilePath));i.size=t.uploadSize;i.failedItems=t.failedItems}return i}))}downloadArtifact(A,e,t){return s(this,void 0,void 0,(function*(){const r=new l.DownloadHttpClient;const n=yield r.listArtifacts();if(n.count===0){throw new Error(`Unable to find any artifacts for the associated workflow`)}const i=n.value.find((e=>e.name===A));if(!i){throw new Error(`Unable to find an artifact with the name: ${A}`)}const s=yield r.getContainerItems(i.name,i.fileContainerResourceUrl);if(!e){e=(0,B.getWorkSpaceDirectory)()}e=(0,h.normalize)(e);e=(0,h.resolve)(e);const a=(0,Q.getDownloadSpecification)(A,s.value,e,(t===null||t===void 0?void 0:t.createArtifactFolder)||false);if(a.filesToDownload.length===0){o.info(`No downloadable files were found for the artifact: ${i.name}`)}else{yield(0,g.createDirectoriesForArtifact)(a.directoryStructure);o.info("Directory structure has been set up for the artifact");yield(0,g.createEmptyFilesForArtifact)(a.emptyFilesToCreate);yield r.downloadSingleArtifact(a.filesToDownload)}return{artifactName:A,downloadPath:a.rootDownloadLocation}}))}downloadAllArtifacts(A){return s(this,void 0,void 0,(function*(){const e=new l.DownloadHttpClient;const t=[];const r=yield e.listArtifacts();if(r.count===0){o.info("Unable to find any artifacts for the associated workflow");return t}if(!A){A=(0,B.getWorkSpaceDirectory)()}A=(0,h.normalize)(A);A=(0,h.resolve)(A);let n=0;while(n<r.count){const i=r.value[n];n+=1;o.info(`starting download of artifact ${i.name} : ${n}/${r.count}`);const s=yield e.getContainerItems(i.name,i.fileContainerResourceUrl);const a=(0,Q.getDownloadSpecification)(i.name,s.value,A,true);if(a.filesToDownload.length===0){o.info(`No downloadable files were found for any artifact ${i.name}`)}else{yield(0,g.createDirectoriesForArtifact)(a.directoryStructure);yield(0,g.createEmptyFilesForArtifact)(a.emptyFilesToCreate);yield e.downloadSingleArtifact(a.filesToDownload)}t.push({artifactName:i.name,downloadPath:a.rootDownloadLocation})}return t}))}}e.DefaultArtifactClient=DefaultArtifactClient},2996:(A,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});e.isGhes=e.getRetentionDays=e.getWorkSpaceDirectory=e.getWorkFlowRunId=e.getRuntimeUrl=e.getRuntimeToken=e.getDownloadFileConcurrency=e.getInitialRetryIntervalInMilliseconds=e.getRetryMultiplier=e.getRetryLimit=e.getUploadChunkSize=e.getUploadFileConcurrency=void 0;function getUploadFileConcurrency(){return 2}e.getUploadFileConcurrency=getUploadFileConcurrency;function getUploadChunkSize(){return 8*1024*1024}e.getUploadChunkSize=getUploadChunkSize;function getRetryLimit(){return 5}e.getRetryLimit=getRetryLimit;function getRetryMultiplier(){return 1.5}e.getRetryMultiplier=getRetryMultiplier;function getInitialRetryIntervalInMilliseconds(){return 3e3}e.getInitialRetryIntervalInMilliseconds=getInitialRetryIntervalInMilliseconds;function getDownloadFileConcurrency(){return 2}e.getDownloadFileConcurrency=getDownloadFileConcurrency;function getRuntimeToken(){const A=process.env["ACTIONS_RUNTIME_TOKEN"];if(!A){throw new Error("Unable to get ACTIONS_RUNTIME_TOKEN env variable")}return A}e.getRuntimeToken=getRuntimeToken;function getRuntimeUrl(){const A=process.env["ACTIONS_RUNTIME_URL"];if(!A){throw new Error("Unable to get ACTIONS_RUNTIME_URL env variable")}return A}e.getRuntimeUrl=getRuntimeUrl;function getWorkFlowRunId(){const A=process.env["GITHUB_RUN_ID"];if(!A){throw new Error("Unable to get GITHUB_RUN_ID env variable")}return A}e.getWorkFlowRunId=getWorkFlowRunId;function getWorkSpaceDirectory(){const A=process.env["GITHUB_WORKSPACE"];if(!A){throw new Error("Unable to get GITHUB_WORKSPACE env variable")}return A}e.getWorkSpaceDirectory=getWorkSpaceDirectory;function getRetentionDays(){return process.env["GITHUB_RETENTION_DAYS"]}e.getRetentionDays=getRetentionDays;function isGhes(){const A=new URL(process.env["GITHUB_SERVER_URL"]||"https://github.com");return A.hostname.toUpperCase()!=="GITHUB.COM"}e.isGhes=isGhes},5702:(A,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});const t=[BigInt("0x0000000000000000"),BigInt("0x7F6EF0C830358979"),BigInt("0xFEDDE190606B12F2"),BigInt("0x81B31158505E9B8B"),BigInt("0xC962E5739841B68F"),BigInt("0xB60C15BBA8743FF6"),BigInt("0x37BF04E3F82AA47D"),BigInt("0x48D1F42BC81F2D04"),BigInt("0xA61CECB46814FE75"),BigInt("0xD9721C7C5821770C"),BigInt("0x58C10D24087FEC87"),BigInt("0x27AFFDEC384A65FE"),BigInt("0x6F7E09C7F05548FA"),BigInt("0x1010F90FC060C183"),BigInt("0x91A3E857903E5A08"),BigInt("0xEECD189FA00BD371"),BigInt("0x78E0FF3B88BE6F81"),BigInt("0x078E0FF3B88BE6F8"),BigInt("0x863D1EABE8D57D73"),BigInt("0xF953EE63D8E0F40A"),BigInt("0xB1821A4810FFD90E"),BigInt("0xCEECEA8020CA5077"),BigInt("0x4F5FFBD87094CBFC"),BigInt("0x30310B1040A14285"),BigInt("0xDEFC138FE0AA91F4"),BigInt("0xA192E347D09F188D"),BigInt("0x2021F21F80C18306"),BigInt("0x5F4F02D7B0F40A7F"),BigInt("0x179EF6FC78EB277B"),BigInt("0x68F0063448DEAE02"),BigInt("0xE943176C18803589"),BigInt("0x962DE7A428B5BCF0"),BigInt("0xF1C1FE77117CDF02"),BigInt("0x8EAF0EBF2149567B"),BigInt("0x0F1C1FE77117CDF0"),BigInt("0x7072EF2F41224489"),BigInt("0x38A31B04893D698D"),BigInt("0x47CDEBCCB908E0F4"),BigInt("0xC67EFA94E9567B7F"),BigInt("0xB9100A5CD963F206"),BigInt("0x57DD12C379682177"),BigInt("0x28B3E20B495DA80E"),BigInt("0xA900F35319033385"),BigInt("0xD66E039B2936BAFC"),BigInt("0x9EBFF7B0E12997F8"),BigInt("0xE1D10778D11C1E81"),BigInt("0x606216208142850A"),BigInt("0x1F0CE6E8B1770C73"),BigInt("0x8921014C99C2B083"),BigInt("0xF64FF184A9F739FA"),BigInt("0x77FCE0DCF9A9A271"),BigInt("0x08921014C99C2B08"),BigInt("0x4043E43F0183060C"),BigInt("0x3F2D14F731B68F75"),BigInt("0xBE9E05AF61E814FE"),BigInt("0xC1F0F56751DD9D87"),BigInt("0x2F3DEDF8F1D64EF6"),BigInt("0x50531D30C1E3C78F"),BigInt("0xD1E00C6891BD5C04"),BigInt("0xAE8EFCA0A188D57D"),BigInt("0xE65F088B6997F879"),BigInt("0x9931F84359A27100"),BigInt("0x1882E91B09FCEA8B"),BigInt("0x67EC19D339C963F2"),BigInt("0xD75ADABD7A6E2D6F"),BigInt("0xA8342A754A5BA416"),BigInt("0x29873B2D1A053F9D"),BigInt("0x56E9CBE52A30B6E4"),BigInt("0x1E383FCEE22F9BE0"),BigInt("0x6156CF06D21A1299"),BigInt("0xE0E5DE5E82448912"),BigInt("0x9F8B2E96B271006B"),BigInt("0x71463609127AD31A"),BigInt("0x0E28C6C1224F5A63"),BigInt("0x8F9BD7997211C1E8"),BigInt("0xF0F5275142244891"),BigInt("0xB824D37A8A3B6595"),BigInt("0xC74A23B2BA0EECEC"),BigInt("0x46F932EAEA507767"),BigInt("0x3997C222DA65FE1E"),BigInt("0xAFBA2586F2D042EE"),BigInt("0xD0D4D54EC2E5CB97"),BigInt("0x5167C41692BB501C"),BigInt("0x2E0934DEA28ED965"),BigInt("0x66D8C0F56A91F461"),BigInt("0x19B6303D5AA47D18"),BigInt("0x980521650AFAE693"),BigInt("0xE76BD1AD3ACF6FEA"),BigInt("0x09A6C9329AC4BC9B"),BigInt("0x76C839FAAAF135E2"),BigInt("0xF77B28A2FAAFAE69"),BigInt("0x8815D86ACA9A2710"),BigInt("0xC0C42C4102850A14"),BigInt("0xBFAADC8932B0836D"),BigInt("0x3E19CDD162EE18E6"),BigInt("0x41773D1952DB919F"),BigInt("0x269B24CA6B12F26D"),BigInt("0x59F5D4025B277B14"),BigInt("0xD846C55A0B79E09F"),BigInt("0xA72835923B4C69E6"),BigInt("0xEFF9C1B9F35344E2"),BigInt("0x90973171C366CD9B"),BigInt("0x1124202993385610"),BigInt("0x6E4AD0E1A30DDF69"),BigInt("0x8087C87E03060C18"),BigInt("0xFFE938B633338561"),BigInt("0x7E5A29EE636D1EEA"),BigInt("0x0134D92653589793"),BigInt("0x49E52D0D9B47BA97"),BigInt("0x368BDDC5AB7233EE"),BigInt("0xB738CC9DFB2CA865"),BigInt("0xC8563C55CB19211C"),BigInt("0x5E7BDBF1E3AC9DEC"),BigInt("0x21152B39D3991495"),BigInt("0xA0A63A6183C78F1E"),BigInt("0xDFC8CAA9B3F20667"),BigInt("0x97193E827BED2B63"),BigInt("0xE877CE4A4BD8A21A"),BigInt("0x69C4DF121B863991"),BigInt("0x16AA2FDA2BB3B0E8"),BigInt("0xF86737458BB86399"),BigInt("0x8709C78DBB8DEAE0"),BigInt("0x06BAD6D5EBD3716B"),BigInt("0x79D4261DDBE6F812"),BigInt("0x3105D23613F9D516"),BigInt("0x4E6B22FE23CC5C6F"),BigInt("0xCFD833A67392C7E4"),BigInt("0xB0B6C36E43A74E9D"),BigInt("0x9A6C9329AC4BC9B5"),BigInt("0xE50263E19C7E40CC"),BigInt("0x64B172B9CC20DB47"),BigInt("0x1BDF8271FC15523E"),BigInt("0x530E765A340A7F3A"),BigInt("0x2C608692043FF643"),BigInt("0xADD397CA54616DC8"),BigInt("0xD2BD67026454E4B1"),BigInt("0x3C707F9DC45F37C0"),BigInt("0x431E8F55F46ABEB9"),BigInt("0xC2AD9E0DA4342532"),BigInt("0xBDC36EC59401AC4B"),BigInt("0xF5129AEE5C1E814F"),BigInt("0x8A7C6A266C2B0836"),BigInt("0x0BCF7B7E3C7593BD"),BigInt("0x74A18BB60C401AC4"),BigInt("0xE28C6C1224F5A634"),BigInt("0x9DE29CDA14C02F4D"),BigInt("0x1C518D82449EB4C6"),BigInt("0x633F7D4A74AB3DBF"),BigInt("0x2BEE8961BCB410BB"),BigInt("0x548079A98C8199C2"),BigInt("0xD53368F1DCDF0249"),BigInt("0xAA5D9839ECEA8B30"),BigInt("0x449080A64CE15841"),BigInt("0x3BFE706E7CD4D138"),BigInt("0xBA4D61362C8A4AB3"),BigInt("0xC52391FE1CBFC3CA"),BigInt("0x8DF265D5D4A0EECE"),BigInt("0xF29C951DE49567B7"),BigInt("0x732F8445B4CBFC3C"),BigInt("0x0C41748D84FE7545"),BigInt("0x6BAD6D5EBD3716B7"),BigInt("0x14C39D968D029FCE"),BigInt("0x95708CCEDD5C0445"),BigInt("0xEA1E7C06ED698D3C"),BigInt("0xA2CF882D2576A038"),BigInt("0xDDA178E515432941"),BigInt("0x5C1269BD451DB2CA"),BigInt("0x237C997575283BB3"),BigInt("0xCDB181EAD523E8C2"),BigInt("0xB2DF7122E51661BB"),BigInt("0x336C607AB548FA30"),BigInt("0x4C0290B2857D7349"),BigInt("0x04D364994D625E4D"),BigInt("0x7BBD94517D57D734"),BigInt("0xFA0E85092D094CBF"),BigInt("0x856075C11D3CC5C6"),BigInt("0x134D926535897936"),BigInt("0x6C2362AD05BCF04F"),BigInt("0xED9073F555E26BC4"),BigInt("0x92FE833D65D7E2BD"),BigInt("0xDA2F7716ADC8CFB9"),BigInt("0xA54187DE9DFD46C0"),BigInt("0x24F29686CDA3DD4B"),BigInt("0x5B9C664EFD965432"),BigInt("0xB5517ED15D9D8743"),BigInt("0xCA3F8E196DA80E3A"),BigInt("0x4B8C9F413DF695B1"),BigInt("0x34E26F890DC31CC8"),BigInt("0x7C339BA2C5DC31CC"),BigInt("0x035D6B6AF5E9B8B5"),BigInt("0x82EE7A32A5B7233E"),BigInt("0xFD808AFA9582AA47"),BigInt("0x4D364994D625E4DA"),BigInt("0x3258B95CE6106DA3"),BigInt("0xB3EBA804B64EF628"),BigInt("0xCC8558CC867B7F51"),BigInt("0x8454ACE74E645255"),BigInt("0xFB3A5C2F7E51DB2C"),BigInt("0x7A894D772E0F40A7"),BigInt("0x05E7BDBF1E3AC9DE"),BigInt("0xEB2AA520BE311AAF"),BigInt("0x944455E88E0493D6"),BigInt("0x15F744B0DE5A085D"),BigInt("0x6A99B478EE6F8124"),BigInt("0x224840532670AC20"),BigInt("0x5D26B09B16452559"),BigInt("0xDC95A1C3461BBED2"),BigInt("0xA3FB510B762E37AB"),BigInt("0x35D6B6AF5E9B8B5B"),BigInt("0x4AB846676EAE0222"),BigInt("0xCB0B573F3EF099A9"),BigInt("0xB465A7F70EC510D0"),BigInt("0xFCB453DCC6DA3DD4"),BigInt("0x83DAA314F6EFB4AD"),BigInt("0x0269B24CA6B12F26"),BigInt("0x7D0742849684A65F"),BigInt("0x93CA5A1B368F752E"),BigInt("0xECA4AAD306BAFC57"),BigInt("0x6D17BB8B56E467DC"),BigInt("0x12794B4366D1EEA5"),BigInt("0x5AA8BF68AECEC3A1"),BigInt("0x25C64FA09EFB4AD8"),BigInt("0xA4755EF8CEA5D153"),BigInt("0xDB1BAE30FE90582A"),BigInt("0xBCF7B7E3C7593BD8"),BigInt("0xC399472BF76CB2A1"),BigInt("0x422A5673A732292A"),BigInt("0x3D44A6BB9707A053"),BigInt("0x759552905F188D57"),BigInt("0x0AFBA2586F2D042E"),BigInt("0x8B48B3003F739FA5"),BigInt("0xF42643C80F4616DC"),BigInt("0x1AEB5B57AF4DC5AD"),BigInt("0x6585AB9F9F784CD4"),BigInt("0xE436BAC7CF26D75F"),BigInt("0x9B584A0FFF135E26"),BigInt("0xD389BE24370C7322"),BigInt("0xACE74EEC0739FA5B"),BigInt("0x2D545FB4576761D0"),BigInt("0x523AAF7C6752E8A9"),BigInt("0xC41748D84FE75459"),BigInt("0xBB79B8107FD2DD20"),BigInt("0x3ACAA9482F8C46AB"),BigInt("0x45A459801FB9CFD2"),BigInt("0x0D75ADABD7A6E2D6"),BigInt("0x721B5D63E7936BAF"),BigInt("0xF3A84C3BB7CDF024"),BigInt("0x8CC6BCF387F8795D"),BigInt("0x620BA46C27F3AA2C"),BigInt("0x1D6554A417C62355"),BigInt("0x9CD645FC4798B8DE"),BigInt("0xE3B8B53477AD31A7"),BigInt("0xAB69411FBFB21CA3"),BigInt("0xD407B1D78F8795DA"),BigInt("0x55B4A08FDFD90E51"),BigInt("0x2ADA5047EFEC8728")];class CRC64{constructor(){this._crc=BigInt(0)}update(A){const e=typeof A==="string"?Buffer.from(A):A;let r=CRC64.flip64Bits(this._crc);for(const A of e){const e=Number(r&BigInt(255));r=t[e^A]^r>>BigInt(8)}this._crc=CRC64.flip64Bits(r)}digest(A){switch(A){case"hex":return this._crc.toString(16).toUpperCase();case"base64":return this.toBuffer().toString("base64");default:return this.toBuffer()}}toBuffer(){return Buffer.from([0,8,16,24,32,40,48,56].map((A=>Number(this._crc>>BigInt(A)&BigInt(255)))))}static flip64Bits(A){return(BigInt(1)<<BigInt(64))-BigInt(1)-A}}e["default"]=CRC64},5339:function(A,e,t){"use strict";var r=this&&this.__createBinding||(Object.create?function(A,e,t,r){if(r===undefined)r=t;var n=Object.getOwnPropertyDescriptor(e,t);if(!n||("get"in n?!e.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return e[t]}}}Object.defineProperty(A,r,n)}:function(A,e,t,r){if(r===undefined)r=t;A[r]=e[t]});var n=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:true,value:e})}:function(A,e){A["default"]=e});var i=this&&this.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)if(t!=="default"&&Object.prototype.hasOwnProperty.call(A,t))r(e,A,t);n(e,A);return e};var s=this&&this.__awaiter||function(A,e,t,r){function adopt(A){return A instanceof t?A:new t((function(e){e(A)}))}return new(t||(t=Promise))((function(t,n){function fulfilled(A){try{step(r.next(A))}catch(A){n(A)}}function rejected(A){try{step(r["throw"](A))}catch(A){n(A)}}function step(A){A.done?t(A.value):adopt(A.value).then(fulfilled,rejected)}step((r=r.apply(A,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:true});e.DownloadHttpClient=void 0;const o=i(t(7147));const a=i(t(9050));const c=i(t(9796));const g=t(4172);const E=t(7310);const l=t(1284);const Q=t(4074);const B=t(6760);const h=t(2996);const C=t(2076);class DownloadHttpClient{constructor(){this.downloadHttpManager=new B.HttpManager((0,h.getDownloadFileConcurrency)(),"@actions/artifact-download");this.statusReporter=new l.StatusReporter(1e3)}listArtifacts(){return s(this,void 0,void 0,(function*(){const A=(0,g.getArtifactUrl)();const e=this.downloadHttpManager.getClient(0);const t=(0,g.getDownloadHeaders)("application/json");const r=yield(0,C.retryHttpClientRequest)("List Artifacts",(()=>s(this,void 0,void 0,(function*(){return e.get(A,t)}))));const n=yield r.readBody();return JSON.parse(n)}))}getContainerItems(A,e){return s(this,void 0,void 0,(function*(){const t=new E.URL(e);t.searchParams.append("itemPath",A);const r=this.downloadHttpManager.getClient(0);const n=(0,g.getDownloadHeaders)("application/json");const i=yield(0,C.retryHttpClientRequest)("Get Container Items",(()=>s(this,void 0,void 0,(function*(){return r.get(t.toString(),n)}))));const o=yield i.readBody();return JSON.parse(o)}))}downloadSingleArtifact(A){return s(this,void 0,void 0,(function*(){const e=(0,h.getDownloadFileConcurrency)();a.debug(`Download file concurrency is set to ${e}`);const t=[...new Array(e).keys()];let r=0;let n=0;a.info(`Total number of files that will be downloaded: ${A.length}`);this.statusReporter.setTotalNumberOfFilesToProcess(A.length);this.statusReporter.start();yield Promise.all(t.map((e=>s(this,void 0,void 0,(function*(){while(r<A.length){const t=A[r];r+=1;const i=Q.performance.now();yield this.downloadIndividualFile(e,t.sourceLocation,t.targetPath);if(a.isDebug()){a.debug(`File: ${++n}/${A.length}. ${t.targetPath} took ${(Q.performance.now()-i).toFixed(3)} milliseconds to finish downloading`)}this.statusReporter.incrementProcessedCount()}}))))).catch((A=>{throw new Error(`Unable to download the artifact: ${A}`)})).finally((()=>{this.statusReporter.stop();this.downloadHttpManager.disposeAndReplaceAllClients()}))}))}downloadIndividualFile(A,e,t){return s(this,void 0,void 0,(function*(){let r=0;const n=(0,h.getRetryLimit)();let i=o.createWriteStream(t);const c=(0,g.getDownloadHeaders)("application/json",true,true);const makeDownloadRequest=()=>s(this,void 0,void 0,(function*(){const t=this.downloadHttpManager.getClient(A);return yield t.get(e,c)}));const isGzip=A=>"content-encoding"in A&&A["content-encoding"]==="gzip";const backOff=t=>s(this,void 0,void 0,(function*(){r++;if(r>n){return Promise.reject(new Error(`Retry limit has been reached. Unable to download ${e}`))}else{this.downloadHttpManager.disposeAndReplaceClient(A);if(t){a.info(`Backoff due to too many requests, retry #${r}. Waiting for ${t} milliseconds before continuing the download`);yield(0,g.sleep)(t)}else{const A=(0,g.getExponentialRetryTimeInMilliseconds)(r);a.info(`Exponential backoff for retry #${r}. Waiting for ${A} milliseconds before continuing the download`);yield(0,g.sleep)(A)}a.info(`Finished backoff for retry #${r}, continuing with download`)}}));const isAllBytesReceived=(A,e)=>{if(!A||!e||process.env["ACTIONS_ARTIFACT_SKIP_DOWNLOAD_VALIDATION"]){a.info("Skipping download validation.");return true}return parseInt(A)===e};const resetDestinationStream=A=>s(this,void 0,void 0,(function*(){i.close();yield new Promise((A=>{i.on("close",A);if(i.writableFinished){A()}}));yield(0,g.rmFile)(A);i=o.createWriteStream(A)}));while(r<=n){let A;try{A=yield makeDownloadRequest()}catch(A){a.info("An error occurred while attempting to download a file");console.log(A);yield backOff();continue}let r=false;if((0,g.isSuccessStatusCode)(A.message.statusCode)){try{const e=isGzip(A.message.headers);yield this.pipeResponseToFile(A,i,e);if(e||isAllBytesReceived(A.message.headers["content-length"],yield(0,g.getFileSize)(t))){return}else{r=true}}catch(A){r=true}}if(r||(0,g.isRetryableStatusCode)(A.message.statusCode)){a.info(`A ${A.message.statusCode} response code has been received while attempting |
