From 94471ca8fa1ef98afb15eb829a1dc002c3646bf9 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Mon, 10 Apr 2023 10:58:41 +0200 Subject: [PATCH 01/44] Make function for executing script --- src/index.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index fefdfd4..4995d97 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,16 +5,13 @@ import * as exec from "@actions/exec"; const run = async () => { try { - const currentFile = url.fileURLToPath(import.meta.url); - const currentDir = path.dirname(currentFile); - const parentDir = path.resolve(currentDir, ".."); // Get action inputs process.env.INPUT_UNSET_PREVIOUS = core.getInput("unset-previous"); process.env.INPUT_EXPORT_ENV = core.getInput("export-env"); // Execute bash script - await exec.exec(`sh -c "` + parentDir + `/entrypoint.sh"`); + await executeScript(); } catch (error) { // It's possible for the Error constructor to be modified to be anything // in JavaScript, so the following code accounts for this possibility. @@ -29,4 +26,13 @@ const run = async () => { } }; +const executeScript = async (): Promise => { + const currentFile = url.fileURLToPath(import.meta.url); + const currentDir = path.dirname(currentFile); + const parentDir = path.resolve(currentDir, ".."); + + // Execute bash script + await exec.exec(`sh -c "` + parentDir + `/entrypoint.sh"`); +} + void run(); From c7236d58f75e9a56d1de8adb0111c2863cdc3398 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Mon, 10 Apr 2023 11:05:44 +0200 Subject: [PATCH 02/44] Migrate auth validation --- entrypoint.sh | 19 ------------------- src/index.ts | 32 +++++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index d0464ad..26ded2e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -7,17 +7,9 @@ export OP_INTEGRATION_NAME="1Password GitHub Action" export OP_INTEGRATION_ID="GHA" export OP_INTEGRATION_BUILDNUMBER="1010001" -readonly CONNECT="CONNECT" -readonly SERVICE_ACCOUNT="SERVICE_ACCOUNT" - -auth_type=$CONNECT managed_variables_var="OP_MANAGED_VARIABLES" IFS=',' -if [[ "$OP_CONNECT_HOST" != "http://"* ]] && [[ "$OP_CONNECT_HOST" != "https://"* ]]; then - export OP_CONNECT_HOST="http://"$OP_CONNECT_HOST -fi - # Unset all secrets managed by 1Password if `unset-previous` is set. unset_prev_secrets() { if [ "$INPUT_UNSET_PREVIOUS" == "true" ]; then @@ -123,17 +115,6 @@ extract_secrets() { read -r -a managed_variables <<< "$(printenv $managed_variables_var)" -if [ -z "$OP_CONNECT_TOKEN" ] || [ -z "$OP_CONNECT_HOST" ]; then - if [ -z "$OP_SERVICE_ACCOUNT_TOKEN" ]; then - echo "(\$OP_CONNECT_TOKEN and \$OP_CONNECT_HOST) or \$OP_SERVICE_ACCOUNT_TOKEN must be set" - exit 1 - fi - - auth_type=$SERVICE_ACCOUNT -fi - -printf "Authenticated with %s \n" $auth_type - unset_prev_secrets install_op_cli extract_secrets diff --git a/src/index.ts b/src/index.ts index 4995d97..9b73533 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,8 +3,14 @@ import url from "url"; import * as core from "@actions/core"; import * as exec from "@actions/exec"; +const envConnectHost = "OP_CONNECT_HOST"; +const envConnectToken = "OP_CONNECT_TOKEN"; +const envServiceAccountToken = "OP_SERVICE_ACCOUNT_TOKEN"; + const run = async () => { try { + // Validate that a proper authentication configuration is set for the CLI + validateAuth(); // Get action inputs process.env.INPUT_UNSET_PREVIOUS = core.getInput("unset-previous"); @@ -26,6 +32,30 @@ const run = async () => { } }; +const validateAuth = () => { + let authType = "Connect"; + if (!process.env[envConnectHost] || !process.env[envConnectToken]) { + if (!process.env[envServiceAccountToken]) { + throw new Error( + `(${envConnectHost} and ${envConnectToken}) or ${envServiceAccountToken} must be set`, + ); + } + authType = "Service account"; + } + + // Adjust Connect host to have a protocol + if ( + process.env[envConnectHost] && + /* eslint-disable no-restricted-syntax */ + (!process.env[envConnectHost]?.startsWith("http://") || + !process.env[envConnectHost].startsWith("https://")) + ) { + process.env[envConnectHost] = `http://${process.env[envConnectHost]}`; + } + + core.debug(`Authenticated with ${authType}.`); +}; + const executeScript = async (): Promise => { const currentFile = url.fileURLToPath(import.meta.url); const currentDir = path.dirname(currentFile); @@ -33,6 +63,6 @@ const executeScript = async (): Promise => { // Execute bash script await exec.exec(`sh -c "` + parentDir + `/entrypoint.sh"`); -} +}; void run(); From 6c9a28c6b2e4fc30bb9c9302a7878a89bf8bbd47 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Mon, 10 Apr 2023 12:26:18 +0200 Subject: [PATCH 03/44] Migrate load secret functionality MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We make use of the following in the migration: - `op-js` package (make direct calls to the CLI and nicely get the output of the commands) - `core.exportVariable` to nicely export a secret as an environment variable - `core.setOutput` to nicely export a secret a the step’s output. - `core.setSecret` to mask the value of the secret if logged on the action’s output. Note: `core.exportVariable` and `core.setOutput` work with multiline secrets without any additional work on our side. Also, we export the temporary path where the CLI is installed to make sure the `op-js` package can find it. --- entrypoint.sh | 97 +---------------------------------------------- package-lock.json | 45 ++++++++++++++++++---- package.json | 1 + src/index.ts | 57 +++++++++++++++++++++++++--- 4 files changed, 91 insertions(+), 109 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 26ded2e..b72e9c2 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,34 +1,6 @@ #!/bin/bash -# shellcheck disable=SC2046,SC2001,SC2086 set -e -# Pass User-Agent Inforomation to the 1Password CLI -export OP_INTEGRATION_NAME="1Password GitHub Action" -export OP_INTEGRATION_ID="GHA" -export OP_INTEGRATION_BUILDNUMBER="1010001" - -managed_variables_var="OP_MANAGED_VARIABLES" -IFS=',' - -# Unset all secrets managed by 1Password if `unset-previous` is set. -unset_prev_secrets() { - if [ "$INPUT_UNSET_PREVIOUS" == "true" ]; then - echo "Unsetting previous values..." - - # Find environment variables that are managed by 1Password. - for env_var in "${managed_variables[@]}"; do - echo "Unsetting $env_var" - unset $env_var - - echo "$env_var=" >> $GITHUB_ENV - - # Keep the masks, just in case. - done - - managed_variables=() - fi -} - # Install op-cli install_op_cli() { OP_INSTALL_DIR="$(mktemp -d)" @@ -47,6 +19,7 @@ install_op_cli() { tar -xvf temp-pkg/op.pkg/Payload -C "$OP_INSTALL_DIR" rm -rf temp-pkg && rm op.pkg fi + echo "$OP_INSTALL_DIR" >> "$GITHUB_PATH" } # Uninstall op-cli @@ -56,72 +29,4 @@ uninstall_op_cli() { fi } -populating_secret() { - ref=$(printenv $1) - - echo "Populating variable: $1" - secret_value=$("${OP_INSTALL_DIR}/op" read "$ref") - - if [ -z "$secret_value" ]; then - echo "Could not find or access secret $ref" - exit 1 - fi - - # Register a mask for the secret to prevent accidental log exposure. - # To support multiline secrets, escape percent signs and add a mask per line. - escaped_mask_value=$(echo "$secret_value" | sed -e 's/%/%25/g') - IFS=$'\n' - for line in $escaped_mask_value; do - if [ "${#line}" -lt 3 ]; then - # To avoid false positives and unreadable logs, omit mask for lines that are too short. - continue - fi - echo "::add-mask::$line" - done - unset IFS - - if [ "$INPUT_EXPORT_ENV" == "true" ]; then - # To support multiline secrets, we'll use the heredoc syntax to populate the environment variables. - # As the heredoc identifier, we'll use a randomly generated 64-character string, - # so that collisions are practically impossible. - random_heredoc_identifier=$(openssl rand -hex 32) - - { - # Populate env var, using heredoc syntax with generated identifier - echo "$env_var<<${random_heredoc_identifier}" - echo "$secret_value" - echo "${random_heredoc_identifier}" - } >> $GITHUB_ENV - echo "GITHUB_ENV: $(cat $GITHUB_ENV)" - - else - # Prepare the secret_value to be outputed properly (especially multiline secrets) - secret_value=$(echo "$secret_value" | awk -v ORS='%0A' '1') - - echo "::set-output name=$env_var::$secret_value" - fi - - managed_variables+=("$env_var") -} - -# Load environment variables using op cli. Iterate over them to find 1Password references, load the secret values, -# and make them available as environment variables in the next steps. -extract_secrets() { - IFS=$'\n' - for env_var in $("${OP_INSTALL_DIR}/op" env ls); do - populating_secret $env_var - done -} - -read -r -a managed_variables <<< "$(printenv $managed_variables_var)" - -unset_prev_secrets install_op_cli -extract_secrets -uninstall_op_cli - -unset IFS -# Add extra env var that lists which secrets are managed by 1Password so that in a later step -# these can be unset again. -managed_variables_str=$(IFS=','; echo "${managed_variables[*]}") -echo "$managed_variables_var=$managed_variables_str" >> $GITHUB_ENV diff --git a/package-lock.json b/package-lock.json index 81250af..077d222 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.2.0", "license": "MIT", "dependencies": { + "@1password/op-js": "^0.1.8", "@actions/core": "^1.10.0", "@actions/exec": "^1.1.1" }, @@ -57,6 +58,15 @@ "typescript": ">=4.0.3" } }, + "node_modules/@1password/op-js": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/@1password/op-js/-/op-js-0.1.8.tgz", + "integrity": "sha512-36Y4TXI0tBwDe6672CHhHvZErf1mgH0/AVt0woCZByOBM5PPUq/CSxAHKilKZrK8vpsTBA68MxV8q2RUExzfsg==", + "dependencies": { + "lookpath": "^1.2.2", + "semver": "^7.3.6" + } + }, "node_modules/@actions/core": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", @@ -5598,6 +5608,17 @@ "node": ">=8" } }, + "node_modules/lookpath": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/lookpath/-/lookpath-1.2.2.tgz", + "integrity": "sha512-k2Gmn8iV6qdME3ztZC2spubmQISimFOPLuQKiPaLcVdRz0IpdxrNClVepMlyTJlhodm/zG/VfbkWERm3kUIh+Q==", + "bin": { + "lookpath": "bin/lookpath.js" + }, + "engines": { + "npm": ">=6.13.4" + } + }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -6790,7 +6811,6 @@ "version": "7.3.8", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", - "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -6805,7 +6825,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -6816,8 +6835,7 @@ "node_modules/semver/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/shebang-command": { "version": "2.0.0", @@ -7839,6 +7857,15 @@ "stylelint-scss": "^4.0.0" } }, + "@1password/op-js": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/@1password/op-js/-/op-js-0.1.8.tgz", + "integrity": "sha512-36Y4TXI0tBwDe6672CHhHvZErf1mgH0/AVt0woCZByOBM5PPUq/CSxAHKilKZrK8vpsTBA68MxV8q2RUExzfsg==", + "requires": { + "lookpath": "^1.2.2", + "semver": "^7.3.6" + } + }, "@actions/core": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", @@ -11943,6 +11970,11 @@ } } }, + "lookpath": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/lookpath/-/lookpath-1.2.2.tgz", + "integrity": "sha512-k2Gmn8iV6qdME3ztZC2spubmQISimFOPLuQKiPaLcVdRz0IpdxrNClVepMlyTJlhodm/zG/VfbkWERm3kUIh+Q==" + }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -12784,7 +12816,6 @@ "version": "7.3.8", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", - "dev": true, "requires": { "lru-cache": "^6.0.0" }, @@ -12793,7 +12824,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "requires": { "yallist": "^4.0.0" } @@ -12801,8 +12831,7 @@ "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" } } }, diff --git a/package.json b/package.json index 07fc9fc..4cc2596 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ }, "homepage": "https://github.com/1Password/load-secrets-action#readme", "dependencies": { + "@1password/op-js": "^0.1.8", "@actions/core": "^1.10.0", "@actions/exec": "^1.1.1" }, diff --git a/src/index.ts b/src/index.ts index 9b73533..9bb8347 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,6 +2,7 @@ import path from "path"; import url from "url"; import * as core from "@actions/core"; import * as exec from "@actions/exec"; +import { read, setClientInfo } from "@1password/op-js"; const envConnectHost = "OP_CONNECT_HOST"; const envConnectToken = "OP_CONNECT_TOKEN"; @@ -12,12 +13,24 @@ const run = async () => { // Validate that a proper authentication configuration is set for the CLI validateAuth(); + // Download and install the CLI + await installCLI(); + // Get action inputs - process.env.INPUT_UNSET_PREVIOUS = core.getInput("unset-previous"); - process.env.INPUT_EXPORT_ENV = core.getInput("export-env"); + const unsetPrevious = core.getBooleanInput("unset-previous"); + const exportEnv = core.getBooleanInput("export-env"); + + // Unset all secrets managed by 1Password if `unset-previous` is set. + if (unsetPrevious && process.env.OP_MANAGED_VARIABLES) { + core.debug(`Unsetting previous values ...`); + const managedEnvs = process.env.OP_MANAGED_VARIABLES.split(","); + for (const envName of managedEnvs) { + core.debug(`Unsetting ${envName}`); + core.exportVariable(envName, ""); + } + } - // Execute bash script - await executeScript(); + await extractSecrets(exportEnv); } catch (error) { // It's possible for the Error constructor to be modified to be anything // in JavaScript, so the following code accounts for this possibility. @@ -56,7 +69,8 @@ const validateAuth = () => { core.debug(`Authenticated with ${authType}.`); }; -const executeScript = async (): Promise => { +/* eslint-disable @typescript-eslint/naming-convention */ +const installCLI = async (): Promise => { const currentFile = url.fileURLToPath(import.meta.url); const currentDir = path.dirname(currentFile); const parentDir = path.resolve(currentDir, ".."); @@ -65,4 +79,37 @@ const executeScript = async (): Promise => { await exec.exec(`sh -c "` + parentDir + `/entrypoint.sh"`); }; +const extractSecrets = async (exportEnv: boolean) => { + // Pass User-Agent Inforomation to the 1Password CLI + setClientInfo({ + name: "1Password GitHub Action", + id: "GHA", + build: "1020000", + }); + + // Load environment variables using 1Password CLI. Iterate over them to find 1Password references, + // load the secret values, and make them available either as step output or as environment variables + // in the next steps. + const res = await exec.getExecOutput(`sh -c "op env ls"`); + const envs = res.stdout.replace(/\n+$/g, "").split(/\r?\n/); + for (const envName of envs) { + core.debug(`Populating variable: ${envName}`); + const ref = process.env[envName]; + if (ref) { + const secretValue = read.parse(ref); + if (secretValue) { + if (exportEnv) { + core.exportVariable(envName, secretValue); + } else { + core.setOutput(envName, secretValue); + } + core.setSecret(secretValue); + } + } + } + if (exportEnv) { + core.exportVariable("OP_MANAGED_VARIABLES", envs.join()); + } +}; + void run(); From c8ce875eb1975dc43baf7d9ef73ebe0b9c2f2c07 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Mon, 10 Apr 2023 14:11:10 +0200 Subject: [PATCH 04/44] Fix CLI installation process --- dist/index.js | 100 ++++++++++++++++++++++++++++++++++++++++++++++---- entrypoint.sh | 2 - src/index.ts | 11 +++++- 3 files changed, 103 insertions(+), 10 deletions(-) diff --git a/dist/index.js b/dist/index.js index 132e37a..949cd58 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,6 +1,14 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; /******/ var __webpack_modules__ = ({ +/***/ 91: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var Pt=Object.create;var Y=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var jt=Object.getOwnPropertyNames;var Ut=Object.getPrototypeOf,Vt=Object.prototype.hasOwnProperty;var Mt=(t,e,r)=>e in t?Y(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),qt=(t,e)=>{for(var r in e)Y(t,r,{get:e[r],enumerable:!0})},xe=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of jt(e))!Vt.call(t,n)&&n!==r&&Y(t,n,{get:()=>e[n],enumerable:!(s=Gt(e,n))||s.enumerable});return t};var W=(t,e,r)=>(r=t!=null?Pt(Ut(t)):{},xe(e||!t||!t.__esModule?Y(r,"default",{value:t,enumerable:!0}):r,t)),Xt=t=>xe(Y({},"__esModule",{value:!0}),t);var oe=(t,e,r)=>(Mt(t,typeof e!="symbol"?e+"":e,r),r);var K=m((Fs,Te)=>{var Bt=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Te.exports=Bt});var ee=m((bs,Ne)=>{var Ht="2.0.0",Yt=Number.MAX_SAFE_INTEGER||9007199254740991,Wt=16;Ne.exports={SEMVER_SPEC_VERSION:Ht,MAX_LENGTH:256,MAX_SAFE_INTEGER:Yt,MAX_SAFE_COMPONENT_LENGTH:Wt}});var j=m((C,Oe)=>{var{MAX_SAFE_COMPONENT_LENGTH:le}=ee(),Kt=K();C=Oe.exports={};var zt=C.re=[],l=C.src=[],u=C.t={},Jt=0,p=(t,e,r)=>{let s=Jt++;Kt(t,s,e),u[t]=s,l[s]=e,zt[s]=new RegExp(e,r?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*");p("NUMERICIDENTIFIERLOOSE","[0-9]+");p("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*");p("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`);p("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`);p("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`);p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`);p("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`);p("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`);p("BUILDIDENTIFIER","[0-9A-Za-z-]+");p("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`);p("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`);p("FULL",`^${l[u.FULLPLAIN]}$`);p("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`);p("LOOSE",`^${l[u.LOOSEPLAIN]}$`);p("GTLT","((?:<|>)?=?)");p("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);p("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`);p("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`);p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`);p("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`);p("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`);p("COERCE",`(^|[^\\d])(\\d{1,${le}})(?:\\.(\\d{1,${le}}))?(?:\\.(\\d{1,${le}}))?(?:$|[^\\d])`);p("COERCERTL",l[u.COERCE],!0);p("LONETILDE","(?:~>?)");p("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0);C.tildeTrimReplace="$1~";p("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`);p("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`);p("LONECARET","(?:\\^)");p("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0);C.caretTrimReplace="$1^";p("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`);p("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`);p("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`);p("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`);p("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0);C.comparatorTrimReplace="$1$2$3";p("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`);p("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`);p("STAR","(<|>)?=?\\s*\\*");p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var z=m((Ls,Se)=>{var Zt=["includePrerelease","loose","rtl"],kt=t=>t?typeof t!="object"?{loose:!0}:Zt.filter(e=>t[e]).reduce((e,r)=>(e[r]=!0,e),{}):{};Se.exports=kt});var be=m((Ds,Fe)=>{var $e=/^[0-9]+$/,Ce=(t,e)=>{let r=$e.test(t),s=$e.test(e);return r&&s&&(t=+t,e=+e),t===e?0:r&&!s?-1:s&&!r?1:tCe(e,t);Fe.exports={compareIdentifiers:Ce,rcompareIdentifiers:Qt}});var V=m((ws,_e)=>{var te=K(),{MAX_LENGTH:Le,MAX_SAFE_INTEGER:re}=ee(),{re:De,t:we}=j(),er=z(),{compareIdentifiers:U}=be(),T=class{constructor(e,r){if(r=er(r),e instanceof T){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>Le)throw new TypeError(`version is longer than ${Le} characters`);te("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let s=e.trim().match(r.loose?De[we.LOOSE]:De[we.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>re||this.major<0)throw new TypeError("Invalid major version");if(this.minor>re||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>re||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);s===-1&&this.prerelease.push(0)}r&&(U(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=[r,0]):this.prerelease=[r,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}};_e.exports=T});var Ve=m((_s,Ue)=>{var{MAX_LENGTH:tr}=ee(),{re:Pe,t:Ge}=j(),je=V(),rr=z(),sr=(t,e)=>{if(e=rr(e),t instanceof je)return t;if(typeof t!="string"||t.length>tr||!(e.loose?Pe[Ge.LOOSE]:Pe[Ge.FULL]).test(t))return null;try{return new je(t,e)}catch{return null}};Ue.exports=sr});var ue=m((Ps,Me)=>{var nr=V(),ir=Ve(),{re:se,t:ne}=j(),ar=(t,e)=>{if(t instanceof nr)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(se[ne.COERCE]);else{let s;for(;(s=se[ne.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||s.index+s[0].length!==r.index+r[0].length)&&(r=s),se[ne.COERCERTL].lastIndex=s.index+s[1].length+s[2].length;se[ne.COERCERTL].lastIndex=-1}return r===null?null:ir(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,e)};Me.exports=ar});var Xe=m((Gs,qe)=>{"use strict";qe.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var He=m((js,Be)=>{"use strict";Be.exports=f;f.Node=L;f.create=f;function f(t){var e=this;if(e instanceof f||(e=new f),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(n){e.push(n)});else if(arguments.length>0)for(var r=0,s=arguments.length;r1)r=e;else if(this.head)s=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;s!==null;n++)r=t(r,s.value,n),s=s.next;return r};f.prototype.reduceReverse=function(t,e){var r,s=this.tail;if(arguments.length>1)r=e;else if(this.tail)s=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=this.length-1;s!==null;n--)r=t(r,s.value,n),s=s.prev;return r};f.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};f.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};f.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new f;if(ethis.length&&(e=this.length);for(var s=0,n=this.head;n!==null&&sthis.length&&(e=this.length);for(var s=this.length,n=this.tail;n!==null&&s>e;s--)n=n.prev;for(;n!==null&&s>t;s--,n=n.prev)r.push(n.value);return r};f.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var s=0,n=this.head;n!==null&&s{"use strict";var cr=He(),D=Symbol("max"),S=Symbol("length"),M=Symbol("lengthCalculator"),Z=Symbol("allowStale"),w=Symbol("maxAge"),O=Symbol("dispose"),Ye=Symbol("noDisposeOnSet"),I=Symbol("lruList"),N=Symbol("cache"),Ke=Symbol("updateAgeOnGet"),ce=()=>1,he=class{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");let r=this[D]=e.max||1/0,s=e.length||ce;if(this[M]=typeof s!="function"?ce:s,this[Z]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[w]=e.maxAge||0,this[O]=e.dispose,this[Ye]=e.noDisposeOnSet||!1,this[Ke]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[D]=e||1/0,J(this)}get max(){return this[D]}set allowStale(e){this[Z]=!!e}get allowStale(){return this[Z]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[w]=e,J(this)}get maxAge(){return this[w]}set lengthCalculator(e){typeof e!="function"&&(e=ce),e!==this[M]&&(this[M]=e,this[S]=0,this[I].forEach(r=>{r.length=this[M](r.value,r.key),this[S]+=r.length})),J(this)}get lengthCalculator(){return this[M]}get length(){return this[S]}get itemCount(){return this[I].length}rforEach(e,r){r=r||this;for(let s=this[I].tail;s!==null;){let n=s.prev;We(this,e,s,r),s=n}}forEach(e,r){r=r||this;for(let s=this[I].head;s!==null;){let n=s.next;We(this,e,s,r),s=n}}keys(){return this[I].toArray().map(e=>e.key)}values(){return this[I].toArray().map(e=>e.value)}reset(){this[O]&&this[I]&&this[I].length&&this[I].forEach(e=>this[O](e.key,e.value)),this[N]=new Map,this[I]=new cr,this[S]=0}dump(){return this[I].map(e=>ie(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[I]}set(e,r,s){if(s=s||this[w],s&&typeof s!="number")throw new TypeError("maxAge must be a number");let n=s?Date.now():0,i=this[M](r,e);if(this[N].has(e)){if(i>this[D])return q(this,this[N].get(e)),!1;let g=this[N].get(e).value;return this[O]&&(this[Ye]||this[O](e,g.value)),g.now=n,g.maxAge=s,g.value=r,this[S]+=i-g.length,g.length=i,this.get(e),J(this),!0}let a=new pe(e,r,i,n,s);return a.length>this[D]?(this[O]&&this[O](e,r),!1):(this[S]+=a.length,this[I].unshift(a),this[N].set(e,this[I].head),J(this),!0)}has(e){if(!this[N].has(e))return!1;let r=this[N].get(e).value;return!ie(this,r)}get(e){return ge(this,e,!0)}peek(e){return ge(this,e,!1)}pop(){let e=this[I].tail;return e?(q(this,e),e.value):null}del(e){q(this,this[N].get(e))}load(e){this.reset();let r=Date.now();for(let s=e.length-1;s>=0;s--){let n=e[s],i=n.e||0;if(i===0)this.set(n.k,n.v);else{let a=i-r;a>0&&this.set(n.k,n.v,a)}}}prune(){this[N].forEach((e,r)=>ge(this,r,!1))}},ge=(t,e,r)=>{let s=t[N].get(e);if(s){let n=s.value;if(ie(t,n)){if(q(t,s),!t[Z])return}else r&&(t[Ke]&&(s.value.now=Date.now()),t[I].unshiftNode(s));return n.value}},ie=(t,e)=>{if(!e||!e.maxAge&&!t[w])return!1;let r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[w]&&r>t[w]},J=t=>{if(t[S]>t[D])for(let e=t[I].tail;t[S]>t[D]&&e!==null;){let r=e.prev;q(t,e),e=r}},q=(t,e)=>{if(e){let r=e.value;t[O]&&t[O](r.key,r.value),t[S]-=r.length,t[N].delete(r.key),t[I].removeNode(e)}},pe=class{constructor(e,r,s,n,i){this.key=e,this.value=r,this.length=s,this.now=n,this.maxAge=i||0}},We=(t,e,r,s)=>{let n=r.value;ie(t,n)&&(q(t,r),t[Z]||(n=void 0)),n&&e.call(s,n.value,n.key,t)};ze.exports=he});var _=m((Vs,ke)=>{var Ze=V(),gr=(t,e,r)=>new Ze(t,r).compare(new Ze(e,r));ke.exports=gr});var et=m((Ms,Qe)=>{var hr=_(),pr=(t,e,r)=>hr(t,e,r)===0;Qe.exports=pr});var rt=m((qs,tt)=>{var fr=_(),dr=(t,e,r)=>fr(t,e,r)!==0;tt.exports=dr});var nt=m((Xs,st)=>{var Er=_(),mr=(t,e,r)=>Er(t,e,r)>0;st.exports=mr});var at=m((Bs,it)=>{var vr=_(),Ir=(t,e,r)=>vr(t,e,r)>=0;it.exports=Ir});var lt=m((Hs,ot)=>{var Rr=_(),Ar=(t,e,r)=>Rr(t,e,r)<0;ot.exports=Ar});var ct=m((Ys,ut)=>{var yr=_(),xr=(t,e,r)=>yr(t,e,r)<=0;ut.exports=xr});var ht=m((Ws,gt)=>{var Tr=et(),Nr=rt(),Or=nt(),Sr=at(),$r=lt(),Cr=ct(),Fr=(t,e,r,s)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return Tr(t,r,s);case"!=":return Nr(t,r,s);case">":return Or(t,r,s);case">=":return Sr(t,r,s);case"<":return $r(t,r,s);case"<=":return Cr(t,r,s);default:throw new TypeError(`Invalid operator: ${e}`)}};gt.exports=Fr});var vt=m((Ks,mt)=>{var k=Symbol("SemVer ANY"),X=class{static get ANY(){return k}constructor(e,r){if(r=br(r),e instanceof X){if(e.loose===!!r.loose)return e;e=e.value}de("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===k?this.value="":this.value=this.operator+this.semver.version,de("comp",this)}parse(e){let r=this.options.loose?pt[ft.COMPARATORLOOSE]:pt[ft.COMPARATOR],s=e.match(r);if(!s)throw new TypeError(`Invalid comparator: ${e}`);this.operator=s[1]!==void 0?s[1]:"",this.operator==="="&&(this.operator=""),s[2]?this.semver=new dt(s[2],this.options.loose):this.semver=k}toString(){return this.value}test(e){if(de("Comparator.test",e,this.options.loose),this.semver===k||e===k)return!0;if(typeof e=="string")try{e=new dt(e,this.options)}catch{return!1}return fe(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof X))throw new TypeError("a Comparator is required");if((!r||typeof r!="object")&&(r={loose:!!r,includePrerelease:!1}),this.operator==="")return this.value===""?!0:new Et(e.value,r).test(this.value);if(e.operator==="")return e.value===""?!0:new Et(this.value,r).test(e.semver);let s=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">"),n=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<"),i=this.semver.version===e.semver.version,a=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<="),h=fe(this.semver,"<",e.semver,r)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),g=fe(this.semver,">",e.semver,r)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return s||n||i&&a||h||g}};mt.exports=X;var br=z(),{re:pt,t:ft}=j(),fe=ht(),de=K(),dt=V(),Et=Ee()});var Ee=m((zs,yt)=>{var P=class{constructor(e,r){if(r=Dr(r),e instanceof P)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new P(e.raw,r);if(e instanceof me)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e,this.set=e.split("||").map(s=>this.parseRange(s.trim())).filter(s=>s.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);if(this.set.length>1){let s=this.set[0];if(this.set=this.set.filter(n=>!Rt(n[0])),this.set.length===0)this.set=[s];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&jr(n[0])){this.set=[n];break}}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();let s=`parseRange:${Object.keys(this.options).join(",")}:${e}`,n=It.get(s);if(n)return n;let i=this.options.loose,a=i?y[R.HYPHENRANGELOOSE]:y[R.HYPHENRANGE];e=e.replace(a,Kr(this.options.includePrerelease)),v("hyphen replace",e),e=e.replace(y[R.COMPARATORTRIM],_r),v("comparator trim",e),e=e.replace(y[R.TILDETRIM],Pr),e=e.replace(y[R.CARETTRIM],Gr),e=e.split(/\s+/).join(" ");let h=e.split(" ").map(E=>Ur(E,this.options)).join(" ").split(/\s+/).map(E=>Wr(E,this.options));i&&(h=h.filter(E=>(v("loose invalid filter",E,this.options),!!E.match(y[R.COMPARATORLOOSE])))),v("range list",h);let g=new Map,c=h.map(E=>new me(E,this.options));for(let E of c){if(Rt(E))return[E];g.set(E.value,E)}g.size>1&&g.has("")&&g.delete("");let d=[...g.values()];return It.set(s,d),d}intersects(e,r){if(!(e instanceof P))throw new TypeError("a Range is required");return this.set.some(s=>At(s,r)&&e.set.some(n=>At(n,r)&&s.every(i=>n.every(a=>i.intersects(a,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new wr(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0",jr=t=>t.value==="",At=(t,e)=>{let r=!0,s=t.slice(),n=s.pop();for(;r&&s.length;)r=s.every(i=>n.intersects(i,e)),n=s.pop();return r},Ur=(t,e)=>(v("comp",t,e),t=qr(t,e),v("caret",t),t=Vr(t,e),v("tildes",t),t=Br(t,e),v("xrange",t),t=Yr(t,e),v("stars",t),t),A=t=>!t||t.toLowerCase()==="x"||t==="*",Vr=(t,e)=>t.trim().split(/\s+/).map(r=>Mr(r,e)).join(" "),Mr=(t,e)=>{let r=e.loose?y[R.TILDELOOSE]:y[R.TILDE];return t.replace(r,(s,n,i,a,h)=>{v("tilde",t,s,n,i,a,h);let g;return A(n)?g="":A(i)?g=`>=${n}.0.0 <${+n+1}.0.0-0`:A(a)?g=`>=${n}.${i}.0 <${n}.${+i+1}.0-0`:h?(v("replaceTilde pr",h),g=`>=${n}.${i}.${a}-${h} <${n}.${+i+1}.0-0`):g=`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`,v("tilde return",g),g})},qr=(t,e)=>t.trim().split(/\s+/).map(r=>Xr(r,e)).join(" "),Xr=(t,e)=>{v("caret",t,e);let r=e.loose?y[R.CARETLOOSE]:y[R.CARET],s=e.includePrerelease?"-0":"";return t.replace(r,(n,i,a,h,g)=>{v("caret",t,n,i,a,h,g);let c;return A(i)?c="":A(a)?c=`>=${i}.0.0${s} <${+i+1}.0.0-0`:A(h)?i==="0"?c=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`:c=`>=${i}.${a}.0${s} <${+i+1}.0.0-0`:g?(v("replaceCaret pr",g),i==="0"?a==="0"?c=`>=${i}.${a}.${h}-${g} <${i}.${a}.${+h+1}-0`:c=`>=${i}.${a}.${h}-${g} <${i}.${+a+1}.0-0`:c=`>=${i}.${a}.${h}-${g} <${+i+1}.0.0-0`):(v("no pr"),i==="0"?a==="0"?c=`>=${i}.${a}.${h}${s} <${i}.${a}.${+h+1}-0`:c=`>=${i}.${a}.${h}${s} <${i}.${+a+1}.0-0`:c=`>=${i}.${a}.${h} <${+i+1}.0.0-0`),v("caret return",c),c})},Br=(t,e)=>(v("replaceXRanges",t,e),t.split(/\s+/).map(r=>Hr(r,e)).join(" ")),Hr=(t,e)=>{t=t.trim();let r=e.loose?y[R.XRANGELOOSE]:y[R.XRANGE];return t.replace(r,(s,n,i,a,h,g)=>{v("xRange",t,s,n,i,a,h,g);let c=A(i),d=c||A(a),E=d||A(h),$=E;return n==="="&&$&&(n=""),g=e.includePrerelease?"-0":"",c?n===">"||n==="<"?s="<0.0.0-0":s="*":n&&$?(d&&(a=0),h=0,n===">"?(n=">=",d?(i=+i+1,a=0,h=0):(a=+a+1,h=0)):n==="<="&&(n="<",d?i=+i+1:a=+a+1),n==="<"&&(g="-0"),s=`${n+i}.${a}.${h}${g}`):d?s=`>=${i}.0.0${g} <${+i+1}.0.0-0`:E&&(s=`>=${i}.${a}.0${g} <${i}.${+a+1}.0-0`),v("xRange return",s),s})},Yr=(t,e)=>(v("replaceStars",t,e),t.trim().replace(y[R.STAR],"")),Wr=(t,e)=>(v("replaceGTE0",t,e),t.trim().replace(y[e.includePrerelease?R.GTE0PRE:R.GTE0],"")),Kr=t=>(e,r,s,n,i,a,h,g,c,d,E,$,H)=>(A(s)?r="":A(n)?r=`>=${s}.0.0${t?"-0":""}`:A(i)?r=`>=${s}.${n}.0${t?"-0":""}`:a?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,A(c)?g="":A(d)?g=`<${+c+1}.0.0-0`:A(E)?g=`<${c}.${+d+1}.0-0`:$?g=`<=${c}.${d}.${E}-${$}`:t?g=`<${c}.${d}.${+E+1}-0`:g=`<=${g}`,`${r} ${g}`.trim()),zr=(t,e,r)=>{for(let s=0;s0){let n=t[s].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0}});var ve=m((Js,xt)=>{var Jr=Ee(),Zr=(t,e,r)=>{try{e=new Jr(e,r)}catch{return!1}return e.test(t)};xt.exports=Zr});var Ct=m(x=>{"use strict";var kr=x&&x.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),Qr=x&&x.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Ot=x&&x.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&kr(e,t,r);return Qr(e,t),e},St=x&&x.__awaiter||function(t,e,r,s){function n(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function h(d){try{c(s.next(d))}catch(E){a(E)}}function g(d){try{c(s.throw(d))}catch(E){a(E)}}function c(d){d.done?i(d.value):n(d.value).then(h,g)}c((s=s.apply(t,e||[])).next())})},$t=x&&x.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},s,n,i,a;return a={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function h(c){return function(d){return g([c,d])}}function g(c){if(s)throw new TypeError("Generator is already executing.");for(;r;)try{if(s=1,n&&(i=c[0]&2?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]F,ExecutionError:()=>G,ValidationError:()=>B,account:()=>Is,connect:()=>xs,document:()=>As,eventsApi:()=>ys,group:()=>Ss,inject:()=>ms,item:()=>Ts,read:()=>vs,setClientInfo:()=>ps,setGlobalFlags:()=>fs,user:()=>Os,validateCli:()=>ds,vault:()=>Ns,version:()=>Es,whoami:()=>Rs});module.exports=Xt($s);var Dt=W(ue()),wt=W(ve());var bt=__nccwpck_require__(81),Lt=W(Ct()),Ie=W(ue()),Re=W(ve());var Ft="0.1.8";var B=class extends Error{constructor(r,s,n){let i;switch(r){case"not-found":i="Could not find `op` executable";break;case"version":i=`CLI version ${n} does not satisfy required version ${s}`;break}super(i);this.type=r;this.requiredVersion=s;this.currentVersion=n;this.name="ValidationError"}},G=class extends Error{constructor(r,s){super(r);this.status=s;this.name="ExecutionError"}},Ae=class extends G{constructor(r,s){let n=r.match(Ae.errorRegex),i,a;n?(i=n[2],a=new Date(n[1])):i="Unknown error";super(i,s);this.originalMessage=r;this.name="CLIError",this.timestamp=a}timestamp},F=Ae;oe(F,"errorRegex",/\[ERROR] (\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}) (.+)/);var as=t=>t.split(".").map(e=>e.padStart(2,"0")).join(""),os=t=>t.replace(/([A-Za-z])(?=[A-Z])/g,"$1-").toLowerCase(),b=t=>t.replace(/(["$'\\`])/g,"\\$1"),ls=(t,e)=>t.length===e.length&&t.every((r,s)=>r===e[s]),us=t=>{if(typeof t=="string")return`=${b(t)}`;if(Array.isArray(t))return`=${t.join(",")}`;if(typeof t=="object"){let e="";if("label"in t&&(e+=(t.label||[]).map(r=>`label=${r}`).join(",")),"type"in t&&(e+=(t.type||[]).map(r=>`type=${r}`).join(",")),e.length>0)return`=${b(e)}`}return""},cs=t=>Object.entries(t).filter(([e,r])=>Boolean(r)).map(([e,r])=>`--${os(b(e))}${us(r)}`),gs=([t,e,r])=>`${b(t)}[${b(e)}]=${b(r)}`,hs={name:"1Password for JavaScript",id:"JS",build:as(Ft)},ye=class{clientInfo=hs;globalFlags={};setClientInfo(e){this.clientInfo=e}getVersion(){return this.execute([],{flags:{version:!0},json:!1})}async validate(e=ye.recommendedVersion){if(!!!await(0,Lt.lookpath)("op"))throw new B("not-found");let s=this.getVersion(),n=(0,Ie.default)(s);if(!(0,Re.default)(n,e))throw new B("version",e,s)}createParts(e,r,s,n){let i=e.map(a=>b(a));for(let a of r)if(typeof a=="string")i.push(b(a));else if(Array.isArray(a))i.push(gs(a));else throw new TypeError("Invalid argument");if(n&&(s={...s,format:"json"}),ls(e,["inject"])){let a=(0,Ie.default)(o.getVersion());if((0,Re.default)(a,">=2.6.2")){if(process.platform==="win32")throw new G("Inject is not supported on Windows for version >=2.6.2 of the CLI",1);s={...s,inFile:"/dev/stdin"}}}return[...i,...cs({...this.globalFlags,...s})]}execute(e,{args:r=[],flags:s={},stdin:n,json:i=!0}={}){let a,h=this.createParts(e,r,s,i);n&&(a=Buffer.from(typeof n=="string"?n:JSON.stringify(n)));let{status:g,error:c,stdout:d,stderr:E}=(0,bt.spawnSync)("op",h,{stdio:"pipe",input:a,env:{...process.env,OP_INTEGRATION_NAME:this.clientInfo.name,OP_INTEGRATION_ID:this.clientInfo.id,OP_INTEGRATION_BUILDNUMBER:this.clientInfo.build}});if(c)throw new G(c.message,g);let $=E.toString();if($.length>0)throw new F($,g);let H=d.toString().trim();if(H.length!==0){if(!i)return H;try{return JSON.parse(H)}catch(_t){throw console.log(H),_t}}}},ae=ye;oe(ae,"recommendedVersion",">=2.4.0");var o=new ae;var ps=t=>o.setClientInfo(t),fs=t=>{o.globalFlags=t},ds=async t=>await o.validate(t),Es=()=>o.getVersion(),ms={data:(t,e={})=>o.execute(["inject"],{flags:e,json:!1,stdin:t}),toFile:(t,e,r={})=>o.execute(["inject"],{flags:{outFile:e,...r},json:!1,stdin:t})},vs={parse:(t,e={})=>o.execute(["read"],{args:[t],flags:e,json:!1}),toFile:(t,e,r={})=>o.execute(["read"],{args:[t],flags:{outFile:e,...r},json:!1})},Is={forget:(t,e={})=>o.execute(["account","forget"],{args:[t],flags:e,json:!1}),get:(t={})=>o.execute(["account","get"],{flags:t}),list:(t={})=>o.execute(["account","list"],{flags:t})},Rs=()=>{try{return o.execute(["whoami"])}catch(t){if(t instanceof F&&t.message.includes("signed in"))return null;throw t}},As={create:(t,e={},r=!1)=>o.execute(["document","create"],{args:[r?t:""],flags:e,stdin:r?void 0:t}),delete:(t,e={})=>o.execute(["document","delete"],{args:[t],flags:e}),edit:(t,e,r={},s=!1)=>o.execute(["document","edit"],{args:[t,s?e:""],flags:r,stdin:s?void 0:e}),get:(t,e={})=>o.execute(["document","get"],{args:[t],flags:e,json:!1}),toFile:(t,e,r={})=>o.execute(["document","get"],{args:[t],flags:{output:e,...r},json:!1}),list:(t={})=>o.execute(["document","list"],{flags:t})},ys={create:(t,e={})=>o.execute(["events-api","create"],{args:[t],flags:e,json:!1})},xs={group:{grant:(t,e={})=>o.execute(["connect","group","grant"],{flags:{group:t,...e},json:!1}),revoke:(t,e={})=>o.execute(["connect","group","revoke"],{flags:{group:t,...e},json:!1})},server:{create:(t,e={})=>o.execute(["connect","server","create"],{args:[t],flags:e,json:!1}),delete:(t,e={})=>o.execute(["connect","server","delete"],{args:[t],flags:e}),edit:(t,e,r={})=>o.execute(["connect","server","edit"],{args:[t],flags:{name:e,...r},json:!1}),get:(t,e={})=>o.execute(["connect","server","get"],{args:[t],flags:e}),list:(t={})=>o.execute(["connect","server","list"],{flags:t})},token:{create:(t,e,r={})=>o.execute(["connect","token","create"],{args:[t],flags:{server:e,...r},json:!1}),delete:(t,e={})=>o.execute(["connect","token","delete"],{args:[t],flags:e,json:!1}),edit:(t,e,r={})=>o.execute(["connect","token","edit"],{args:[t],flags:{name:e,...r},json:!1}),list:(t={})=>o.execute(["connect","token","list"],{flags:t})},vault:{grant:(t,e,r={})=>o.execute(["connect","vault","grant"],{flags:{server:t,vault:e,...r},json:!1}),revoke:(t,e,r={})=>o.execute(["connect","vault","revoke"],{flags:{server:t,vault:e,...r},json:!1})}},Ts={create:(t,e={})=>{let r={flags:e},s=(0,Dt.default)(o.getVersion());return(0,wt.default)(s,">=2.6.2")?r.args=t:r.stdin={fields:t.map(([n,i,a,h])=>{let g={label:n,type:i,value:a};return h&&Object.assign(g,{purpose:h}),g})},o.execute(["item","create"],r)},delete:(t,e={})=>o.execute(["item","delete"],{args:[t],flags:e,json:!1}),edit:(t,e,r={})=>o.execute(["item","edit"],{args:[t,...e],flags:r}),get:(t,e={})=>o.execute(["item","get"],{args:[t],flags:e}),otp:(t,e={})=>o.execute(["item","get"],{args:[t],flags:{otp:!0,...e},json:!1}),shareLink:(t,e={})=>o.execute(["item","get"],{args:[t],flags:{shareLink:!0,...e},json:!1}),list:(t={})=>o.execute(["item","list"],{flags:t}),share:(t,e={})=>o.execute(["item","share"],{args:[t],flags:e,json:!1}),template:{get:(t,e={})=>o.execute(["item","template","get"],{args:[t],flags:e}),list:(t={})=>o.execute(["item","template","list"],{flags:t})}},Ns={create:(t,e={})=>o.execute(["vault","create"],{args:[t],flags:e}),delete:(t,e={})=>o.execute(["vault","delete"],{args:[t],flags:e,json:!1}),edit:(t,e={})=>o.execute(["vault","edit"],{args:[t],flags:e,json:!1}),get:(t,e={})=>o.execute(["vault","get"],{args:[t],flags:e}),list:(t={})=>o.execute(["vault","list"],{flags:t}),group:{grant:(t={})=>o.execute(["vault","group","grant"],{flags:{noInput:!0,...t}}),revoke:(t={})=>o.execute(["vault","group","revoke"],{flags:{noInput:!0,...t}}),list:(t,e={})=>o.execute(["vault","group","list"],{args:[t],flags:e})},user:{grant:(t={})=>o.execute(["vault","user","grant"],{flags:{noInput:!0,...t}}),revoke:(t={})=>o.execute(["vault","user","revoke"],{flags:{noInput:!0,...t}}),list:(t,e={})=>o.execute(["vault","user","list"],{args:[t],flags:e})}},Os={confirm:(t,e={})=>o.execute(["user","confirm"],{args:[t],flags:e,json:!1}),confirmAll:(t={})=>o.execute(["user","confirm"],{flags:{all:!0,...t},json:!1}),delete:(t,e={})=>o.execute(["user","delete"],{args:[t],flags:e,json:!1}),edit:(t,e={})=>o.execute(["user","edit"],{args:[t],flags:e,json:!1}),get:(t,e={})=>o.execute(["user","get"],{args:[t],flags:e}),me:(t={})=>o.execute(["user","get"],{flags:{me:!0,...t}}),fingerprint:(t,e={})=>o.execute(["user","get"],{args:[t],flags:{fingerprint:!0,...e},json:!1}),publicKey:(t,e={})=>o.execute(["user","get"],{args:[t],flags:{publicKey:!0,...e},json:!1}),list:(t={})=>o.execute(["user","list"],{flags:t}),provision:(t,e,r)=>o.execute(["user","provision"],{flags:{email:t,name:e,...r}}),reactivate:(t,e={})=>o.execute(["user","reactivate"],{args:[t],flags:e,json:!1}),suspend:(t,e={})=>o.execute(["user","suspend"],{args:[t],flags:e,json:!1})},Ss={create:(t,e={})=>o.execute(["group","create"],{args:[t],flags:e}),delete:(t,e={})=>o.execute(["group","delete"],{args:[t],flags:e,json:!1}),edit:(t,e={})=>o.execute(["group","edit"],{args:[t],flags:e,json:!1}),get:(t,e={})=>o.execute(["group","get"],{args:[t],flags:e}),list:(t={})=>o.execute(["group","list"],{flags:t}),user:{grant:(t={})=>o.execute(["group","user","grant"],{flags:t,json:!1}),list:(t,e={})=>o.execute(["group","user","list"],{args:[t],flags:e}),revoke:(t={})=>o.execute(["group","user","grant"],{flags:t,json:!1})}};0&&(0); + + +/***/ }), + /***/ 351: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -4104,21 +4112,36 @@ var external_url_default = /*#__PURE__*/__nccwpck_require__.n(external_url_names var core = __nccwpck_require__(186); // EXTERNAL MODULE: ./node_modules/@actions/exec/lib/exec.js var exec = __nccwpck_require__(514); +// EXTERNAL MODULE: ./node_modules/@1password/op-js/dist/index.js +var dist = __nccwpck_require__(91); ;// CONCATENATED MODULE: ./src/index.ts + +const envConnectHost = "OP_CONNECT_HOST"; +const envConnectToken = "OP_CONNECT_TOKEN"; +const envServiceAccountToken = "OP_SERVICE_ACCOUNT_TOKEN"; const run = async () => { try { - const currentFile = external_url_default().fileURLToPath(import.meta.url); - const currentDir = external_path_default().dirname(currentFile); - const parentDir = external_path_default().resolve(currentDir, ".."); + // Validate that a proper authentication configuration is set for the CLI + validateAuth(); + // Download and install the CLI + await installCLI(); // Get action inputs - process.env.INPUT_UNSET_PREVIOUS = core.getInput("unset-previous"); - process.env.INPUT_EXPORT_ENV = core.getInput("export-env"); - // Execute bash script - await exec.exec(`sh -c "` + parentDir + `/entrypoint.sh"`); + const unsetPrevious = core.getBooleanInput("unset-previous"); + const exportEnv = core.getBooleanInput("export-env"); + // Unset all secrets managed by 1Password if `unset-previous` is set. + if (unsetPrevious && process.env.OP_MANAGED_VARIABLES) { + core.debug(`Unsetting previous values ...`); + const managedEnvs = process.env.OP_MANAGED_VARIABLES.split(","); + for (const envName of managedEnvs) { + core.debug(`Unsetting ${envName}`); + core.exportVariable(envName, ""); + } + } + await extractSecrets(exportEnv); } catch (error) { // It's possible for the Error constructor to be modified to be anything @@ -4134,6 +4157,69 @@ const run = async () => { core.setFailed(message); } }; +const validateAuth = () => { + let authType = "Connect"; + if (!process.env[envConnectHost] || !process.env[envConnectToken]) { + if (!process.env[envServiceAccountToken]) { + throw new Error(`(${envConnectHost} and ${envConnectToken}) or ${envServiceAccountToken} must be set`); + } + authType = "Service account"; + } + // Adjust Connect host to have a protocol + if (process.env[envConnectHost] && + /* eslint-disable no-restricted-syntax */ + (!process.env[envConnectHost]?.startsWith("http://") || + !process.env[envConnectHost].startsWith("https://"))) { + process.env[envConnectHost] = `http://${process.env[envConnectHost]}`; + } + core.debug(`Authenticated with ${authType}.`); +}; +/* eslint-disable @typescript-eslint/naming-convention */ +const installCLI = async () => { + const currentFile = external_url_default().fileURLToPath(import.meta.url); + const currentDir = external_path_default().dirname(currentFile); + const parentDir = external_path_default().resolve(currentDir, ".."); + // Execute bash script + const cmdOut = await exec.getExecOutput(`sh -c "` + parentDir + `/entrypoint.sh"`); + // Add path to 1Password CLI to $PATH + const outArr = cmdOut.stdout.split("\n"); + if (outArr[0] && process.env.PATH) { + const cliPath = outArr[0]?.replace(/^(::debug::OP_INSTALL_DIR: )/, ""); + process.env.PATH = `${cliPath}:${process.env.PATH}`; + } +}; +const extractSecrets = async (exportEnv) => { + // Pass User-Agent Inforomation to the 1Password CLI + (0,dist.setClientInfo)({ + name: "1Password GitHub Action", + id: "GHA", + build: "1020000", + }); + // Load environment variables using 1Password CLI. Iterate over them to find 1Password references, + // load the secret values, and make them available either as step output or as environment variables + // in the next steps. + const res = await exec.getExecOutput(`sh -c "op env ls"`); + const envs = res.stdout.replace(/\n+$/g, "").split(/\r?\n/); + for (const envName of envs) { + core.debug(`Populating variable: ${envName}`); + const ref = process.env[envName]; + if (ref) { + const secretValue = dist.read.parse(ref); + if (secretValue) { + if (exportEnv) { + core.exportVariable(envName, secretValue); + } + else { + core.setOutput(envName, secretValue); + } + core.setSecret(secretValue); + } + } + } + if (exportEnv) { + core.exportVariable("OP_MANAGED_VARIABLES", envs.join()); + } +}; void run(); })(); diff --git a/entrypoint.sh b/entrypoint.sh index b72e9c2..2d7f25b 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -8,7 +8,6 @@ install_op_cli() { echo "Install dir $OP_INSTALL_DIR not found" exit 1 fi - export OP_INSTALL_DIR echo "::debug::OP_INSTALL_DIR: ${OP_INSTALL_DIR}" if [[ "$OSTYPE" == "linux-gnu"* ]]; then curl -sSfLo op.zip "https://cache.agilebits.com/dist/1P/op2/pkg/v2.10.0-beta.02/op_linux_amd64_v2.10.0-beta.02.zip" @@ -19,7 +18,6 @@ install_op_cli() { tar -xvf temp-pkg/op.pkg/Payload -C "$OP_INSTALL_DIR" rm -rf temp-pkg && rm op.pkg fi - echo "$OP_INSTALL_DIR" >> "$GITHUB_PATH" } # Uninstall op-cli diff --git a/src/index.ts b/src/index.ts index 9bb8347..93bbf72 100644 --- a/src/index.ts +++ b/src/index.ts @@ -76,7 +76,16 @@ const installCLI = async (): Promise => { const parentDir = path.resolve(currentDir, ".."); // Execute bash script - await exec.exec(`sh -c "` + parentDir + `/entrypoint.sh"`); + const cmdOut = await exec.getExecOutput( + `sh -c "` + parentDir + `/entrypoint.sh"`, + ); + + // Add path to 1Password CLI to $PATH + const outArr = cmdOut.stdout.split("\n"); + if (outArr[0] && process.env.PATH) { + const cliPath = outArr[0]?.replace(/^(::debug::OP_INSTALL_DIR: )/, ""); + process.env.PATH = `${cliPath}:${process.env.PATH}`; + } }; const extractSecrets = async (exportEnv: boolean) => { From 1cf524194fbe10d43b503e5ee233a84849059584 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Mon, 10 Apr 2023 14:15:43 +0200 Subject: [PATCH 05/44] Fix conditional of appending protocol Fix conditional of appending `http://` to the Connect host. --- dist/index.js | 4 ++-- src/index.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 949cd58..c49aaaf 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4168,8 +4168,8 @@ const validateAuth = () => { // Adjust Connect host to have a protocol if (process.env[envConnectHost] && /* eslint-disable no-restricted-syntax */ - (!process.env[envConnectHost]?.startsWith("http://") || - !process.env[envConnectHost].startsWith("https://"))) { + !process.env[envConnectHost].startsWith("http://") && + !process.env[envConnectHost].startsWith("https://")) { process.env[envConnectHost] = `http://${process.env[envConnectHost]}`; } core.debug(`Authenticated with ${authType}.`); diff --git a/src/index.ts b/src/index.ts index 93bbf72..c02d65b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -60,8 +60,8 @@ const validateAuth = () => { if ( process.env[envConnectHost] && /* eslint-disable no-restricted-syntax */ - (!process.env[envConnectHost]?.startsWith("http://") || - !process.env[envConnectHost].startsWith("https://")) + !process.env[envConnectHost].startsWith("http://") && + !process.env[envConnectHost].startsWith("https://") ) { process.env[envConnectHost] = `http://${process.env[envConnectHost]}`; } From 98fac4ebd3628bd7f59efed07c07077935fd8117 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Mon, 10 Apr 2023 14:56:21 +0200 Subject: [PATCH 06/44] Improve code --- dist/index.js | 45 +++++++++++++++++++++++++-------------------- src/index.ts | 50 ++++++++++++++++++++++++++++---------------------- 2 files changed, 53 insertions(+), 42 deletions(-) diff --git a/dist/index.js b/dist/index.js index c49aaaf..ccdea0a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4123,25 +4123,20 @@ var dist = __nccwpck_require__(91); const envConnectHost = "OP_CONNECT_HOST"; const envConnectToken = "OP_CONNECT_TOKEN"; const envServiceAccountToken = "OP_SERVICE_ACCOUNT_TOKEN"; +const envManagedVariables = "OP_MANAGED_VARIABLES"; const run = async () => { try { + // Get action inputs + const shouldUnsetPrevious = core.getBooleanInput("unset-previous"); + const shouldExportEnv = core.getBooleanInput("export-env"); + // Unset all secrets managed by 1Password if `unset-previous` is set. + unsetPrevious(shouldUnsetPrevious); // Validate that a proper authentication configuration is set for the CLI validateAuth(); // Download and install the CLI await installCLI(); - // Get action inputs - const unsetPrevious = core.getBooleanInput("unset-previous"); - const exportEnv = core.getBooleanInput("export-env"); - // Unset all secrets managed by 1Password if `unset-previous` is set. - if (unsetPrevious && process.env.OP_MANAGED_VARIABLES) { - core.debug(`Unsetting previous values ...`); - const managedEnvs = process.env.OP_MANAGED_VARIABLES.split(","); - for (const envName of managedEnvs) { - core.debug(`Unsetting ${envName}`); - core.exportVariable(envName, ""); - } - } - await extractSecrets(exportEnv); + // Load secrets + await loadSecrets(shouldExportEnv); } catch (error) { // It's possible for the Error constructor to be modified to be anything @@ -4157,6 +4152,16 @@ const run = async () => { core.setFailed(message); } }; +const unsetPrevious = (shouldUnsetPrevious) => { + if (shouldUnsetPrevious && process.env[envManagedVariables]) { + core.debug(`Unsetting previous values ...`); + const managedEnvs = process.env[envManagedVariables].split(","); + for (const envName of managedEnvs) { + core.debug(`Unsetting ${envName}`); + core.exportVariable(envName, ""); + } + } +}; const validateAuth = () => { let authType = "Connect"; if (!process.env[envConnectHost] || !process.env[envConnectToken]) { @@ -4188,16 +4193,16 @@ const installCLI = async () => { process.env.PATH = `${cliPath}:${process.env.PATH}`; } }; -const extractSecrets = async (exportEnv) => { +const loadSecrets = async (shouldExportEnv) => { // Pass User-Agent Inforomation to the 1Password CLI (0,dist.setClientInfo)({ name: "1Password GitHub Action", id: "GHA", build: "1020000", }); - // Load environment variables using 1Password CLI. Iterate over them to find 1Password references, - // load the secret values, and make them available either as step output or as environment variables - // in the next steps. + // Load secrets from environment variables using 1Password CLI. + // Iterate over them to find 1Password references, extract the secret values, + // and make them available in the next steps either as step outputs or as environment variables. const res = await exec.getExecOutput(`sh -c "op env ls"`); const envs = res.stdout.replace(/\n+$/g, "").split(/\r?\n/); for (const envName of envs) { @@ -4206,7 +4211,7 @@ const extractSecrets = async (exportEnv) => { if (ref) { const secretValue = dist.read.parse(ref); if (secretValue) { - if (exportEnv) { + if (shouldExportEnv) { core.exportVariable(envName, secretValue); } else { @@ -4216,8 +4221,8 @@ const extractSecrets = async (exportEnv) => { } } } - if (exportEnv) { - core.exportVariable("OP_MANAGED_VARIABLES", envs.join()); + if (shouldExportEnv) { + core.exportVariable(envManagedVariables, envs.join()); } }; void run(); diff --git a/src/index.ts b/src/index.ts index c02d65b..0bc08b2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,30 +7,25 @@ import { read, setClientInfo } from "@1password/op-js"; const envConnectHost = "OP_CONNECT_HOST"; const envConnectToken = "OP_CONNECT_TOKEN"; const envServiceAccountToken = "OP_SERVICE_ACCOUNT_TOKEN"; +const envManagedVariables = "OP_MANAGED_VARIABLES"; const run = async () => { try { + // Get action inputs + const shouldUnsetPrevious = core.getBooleanInput("unset-previous"); + const shouldExportEnv = core.getBooleanInput("export-env"); + + // Unset all secrets managed by 1Password if `unset-previous` is set. + unsetPrevious(shouldUnsetPrevious); + // Validate that a proper authentication configuration is set for the CLI validateAuth(); // Download and install the CLI await installCLI(); - // Get action inputs - const unsetPrevious = core.getBooleanInput("unset-previous"); - const exportEnv = core.getBooleanInput("export-env"); - - // Unset all secrets managed by 1Password if `unset-previous` is set. - if (unsetPrevious && process.env.OP_MANAGED_VARIABLES) { - core.debug(`Unsetting previous values ...`); - const managedEnvs = process.env.OP_MANAGED_VARIABLES.split(","); - for (const envName of managedEnvs) { - core.debug(`Unsetting ${envName}`); - core.exportVariable(envName, ""); - } - } - - await extractSecrets(exportEnv); + // Load secrets + await loadSecrets(shouldExportEnv); } catch (error) { // It's possible for the Error constructor to be modified to be anything // in JavaScript, so the following code accounts for this possibility. @@ -45,6 +40,17 @@ const run = async () => { } }; +const unsetPrevious = (shouldUnsetPrevious: boolean) => { + if (shouldUnsetPrevious && process.env[envManagedVariables]) { + core.debug(`Unsetting previous values ...`); + const managedEnvs = process.env[envManagedVariables].split(","); + for (const envName of managedEnvs) { + core.debug(`Unsetting ${envName}`); + core.exportVariable(envName, ""); + } + } +}; + const validateAuth = () => { let authType = "Connect"; if (!process.env[envConnectHost] || !process.env[envConnectToken]) { @@ -88,7 +94,7 @@ const installCLI = async (): Promise => { } }; -const extractSecrets = async (exportEnv: boolean) => { +const loadSecrets = async (shouldExportEnv: boolean) => { // Pass User-Agent Inforomation to the 1Password CLI setClientInfo({ name: "1Password GitHub Action", @@ -96,9 +102,9 @@ const extractSecrets = async (exportEnv: boolean) => { build: "1020000", }); - // Load environment variables using 1Password CLI. Iterate over them to find 1Password references, - // load the secret values, and make them available either as step output or as environment variables - // in the next steps. + // Load secrets from environment variables using 1Password CLI. + // Iterate over them to find 1Password references, extract the secret values, + // and make them available in the next steps either as step outputs or as environment variables. const res = await exec.getExecOutput(`sh -c "op env ls"`); const envs = res.stdout.replace(/\n+$/g, "").split(/\r?\n/); for (const envName of envs) { @@ -107,7 +113,7 @@ const extractSecrets = async (exportEnv: boolean) => { if (ref) { const secretValue = read.parse(ref); if (secretValue) { - if (exportEnv) { + if (shouldExportEnv) { core.exportVariable(envName, secretValue); } else { core.setOutput(envName, secretValue); @@ -116,8 +122,8 @@ const extractSecrets = async (exportEnv: boolean) => { } } } - if (exportEnv) { - core.exportVariable("OP_MANAGED_VARIABLES", envs.join()); + if (shouldExportEnv) { + core.exportVariable(envManagedVariables, envs.join()); } }; From 4d1bf78c40cc1be23ce2f64fc0e7b1f8abad7918 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Mon, 10 Apr 2023 14:56:36 +0200 Subject: [PATCH 07/44] Update CLI version and improve script --- entrypoint.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 2d7f25b..8dd06e2 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,6 +3,7 @@ set -e # Install op-cli install_op_cli() { + CLI_VERSION="v2.16.0-beta.01" OP_INSTALL_DIR="$(mktemp -d)" if [[ ! -d "$OP_INSTALL_DIR" ]]; then echo "Install dir $OP_INSTALL_DIR not found" @@ -10,10 +11,10 @@ install_op_cli() { fi echo "::debug::OP_INSTALL_DIR: ${OP_INSTALL_DIR}" if [[ "$OSTYPE" == "linux-gnu"* ]]; then - curl -sSfLo op.zip "https://cache.agilebits.com/dist/1P/op2/pkg/v2.10.0-beta.02/op_linux_amd64_v2.10.0-beta.02.zip" + curl -sSfLo op.zip "https://cache.agilebits.com/dist/1P/op2/pkg/$CLI_VERSION/op_linux_amd64_$CLI_VERSION.zip" unzip -od "$OP_INSTALL_DIR" op.zip && rm op.zip elif [[ "$OSTYPE" == "darwin"* ]]; then - curl -sSfLo op.pkg "https://cache.agilebits.com/dist/1P/op2/pkg/v2.10.0-beta.02/op_apple_universal_v2.10.0-beta.02.pkg" + curl -sSfLo op.pkg "https://cache.agilebits.com/dist/1P/op2/pkg/$CLI_VERSION/op_apple_universal_$CLI_VERSION.pkg" pkgutil --expand op.pkg temp-pkg tar -xvf temp-pkg/op.pkg/Payload -C "$OP_INSTALL_DIR" rm -rf temp-pkg && rm op.pkg From ade7b48a572b82692c9d274a9fd3e8bb4bf3c9e8 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Mon, 10 Apr 2023 14:57:53 +0200 Subject: [PATCH 08/44] Use core.addPath This is a safer and nicer way to ensure the path to the CLI is included later in the pipeline (including this GitHub action). --- dist/index.js | 2 +- src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index ccdea0a..8643120 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4190,7 +4190,7 @@ const installCLI = async () => { const outArr = cmdOut.stdout.split("\n"); if (outArr[0] && process.env.PATH) { const cliPath = outArr[0]?.replace(/^(::debug::OP_INSTALL_DIR: )/, ""); - process.env.PATH = `${cliPath}:${process.env.PATH}`; + core.addPath(cliPath); } }; const loadSecrets = async (shouldExportEnv) => { diff --git a/src/index.ts b/src/index.ts index 0bc08b2..578dcaf 100644 --- a/src/index.ts +++ b/src/index.ts @@ -90,7 +90,7 @@ const installCLI = async (): Promise => { const outArr = cmdOut.stdout.split("\n"); if (outArr[0] && process.env.PATH) { const cliPath = outArr[0]?.replace(/^(::debug::OP_INSTALL_DIR: )/, ""); - process.env.PATH = `${cliPath}:${process.env.PATH}`; + core.addPath(cliPath); } }; From cdeff7c49e560e9d2d54076b468492f496f39a57 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Mon, 10 Apr 2023 18:49:17 +0200 Subject: [PATCH 09/44] Use version from package.json This eliminates the duplication of version in the code --- dist/index.js | 12 +++++++++++- src/index.ts | 4 +++- src/utils.test.ts | 10 ++++++++++ src/utils.ts | 5 +++++ tsconfig.json | 3 +-- 5 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 src/utils.test.ts create mode 100644 src/utils.ts diff --git a/dist/index.js b/dist/index.js index 8643120..0ea11dd 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4114,12 +4114,22 @@ var core = __nccwpck_require__(186); var exec = __nccwpck_require__(514); // EXTERNAL MODULE: ./node_modules/@1password/op-js/dist/index.js var dist = __nccwpck_require__(91); +;// CONCATENATED MODULE: ./package.json +const package_namespaceObject = {"i8":"1.2.0"}; +;// CONCATENATED MODULE: ./src/utils.ts +const semverToInt = (input) => input + .split(".") + .map((n) => n.padStart(2, "0")) + .join(""); + ;// CONCATENATED MODULE: ./src/index.ts + + const envConnectHost = "OP_CONNECT_HOST"; const envConnectToken = "OP_CONNECT_TOKEN"; const envServiceAccountToken = "OP_SERVICE_ACCOUNT_TOKEN"; @@ -4198,7 +4208,7 @@ const loadSecrets = async (shouldExportEnv) => { (0,dist.setClientInfo)({ name: "1Password GitHub Action", id: "GHA", - build: "1020000", + build: semverToInt(package_namespaceObject.i8), }); // Load secrets from environment variables using 1Password CLI. // Iterate over them to find 1Password references, extract the secret values, diff --git a/src/index.ts b/src/index.ts index 578dcaf..8431895 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,6 +3,8 @@ import url from "url"; import * as core from "@actions/core"; import * as exec from "@actions/exec"; import { read, setClientInfo } from "@1password/op-js"; +import { version } from "../package.json"; +import { semverToInt } from "./utils"; const envConnectHost = "OP_CONNECT_HOST"; const envConnectToken = "OP_CONNECT_TOKEN"; @@ -99,7 +101,7 @@ const loadSecrets = async (shouldExportEnv: boolean) => { setClientInfo({ name: "1Password GitHub Action", id: "GHA", - build: "1020000", + build: semverToInt(version), }); // Load secrets from environment variables using 1Password CLI. diff --git a/src/utils.test.ts b/src/utils.test.ts new file mode 100644 index 0000000..8d205b1 --- /dev/null +++ b/src/utils.test.ts @@ -0,0 +1,10 @@ +import { semverToInt } from "./utils"; + +describe("semverToInt", () => { + it("converts a semver string to build number", () => { + expect(semverToInt("0.1.2")).toBe("000102"); + expect(semverToInt("1.2.3")).toBe("010203"); + expect(semverToInt("12.2.39")).toBe("120239"); + expect(semverToInt("2.1.284")).toBe("0201284"); + }); +}); diff --git a/src/utils.ts b/src/utils.ts new file mode 100644 index 0000000..dee29e4 --- /dev/null +++ b/src/utils.ts @@ -0,0 +1,5 @@ +export const semverToInt = (input: string): string => + input + .split(".") + .map((n) => n.padStart(2, "0")) + .join(""); diff --git a/tsconfig.json b/tsconfig.json index caccb29..f42604b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,8 +17,7 @@ "noUncheckedIndexedAccess": true, "noUnusedLocals": true, "noUnusedParameters": true, - "outDir": "./dist/", - "rootDir": "./src/", + "resolveJsonModule": true, "strict": true, "target": "es2022" } From 01b497095633ef5bf75063bac7cfa39bdd40892d Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Mon, 10 Apr 2023 18:55:08 +0200 Subject: [PATCH 10/44] Update dependencies --- package-lock.json | 226 +++++++++++++++++++++------------------------- package.json | 6 +- 2 files changed, 104 insertions(+), 128 deletions(-) diff --git a/package-lock.json b/package-lock.json index 077d222..0fdaf33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,12 +16,12 @@ "devDependencies": { "@1password/front-end-style": "^6.0.1", "@types/jest": "^29.5.0", - "@types/node": "^18.15.10", + "@types/node": "^18.15.11", "@vercel/ncc": "^0.36.1", "husky": "^8.0.3", "jest": "^29.5.0", - "lint-staged": "^13.2.0", - "ts-jest": "^29.0.5", + "lint-staged": "^13.2.1", + "ts-jest": "^29.1.0", "typescript": "^4.9.5" } }, @@ -781,9 +781,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.3.0.tgz", - "integrity": "sha512-v3oplH6FYCULtFuCeqyuTd9D2WKO937Dxdq+GmHOLL72TTRriLxz2VLlNfkZRsvj6PKnOPAtuT6dwrs/pA5DvA==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", "dev": true, "dependencies": { "eslint-visitor-keys": "^3.3.0" @@ -796,12 +796,15 @@ } }, "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz", + "integrity": "sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/@eslint/eslintrc": { @@ -1404,9 +1407,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.15.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.10.tgz", - "integrity": "sha512-9avDaQJczATcXgfmMAW3MIWArOO7A+m90vuCFLr8AotWf8igO/mRoYukrk2cqZVtv38tHs33retzHEilM7FpeQ==", + "version": "18.15.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", + "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==", "dev": true }, "node_modules/@types/normalize-package-data": { @@ -1611,17 +1614,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.56.0.tgz", - "integrity": "sha512-XhZDVdLnUJNtbzaJeDSCIYaM+Tgr59gZGbFuELgF7m0IY03PlciidS7UQNKLE0+WpUTn1GlycEr6Ivb/afjbhA==", + "version": "5.57.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.57.1.tgz", + "integrity": "sha512-kN6vzzf9NkEtawECqze6v99LtmDiUJCVpvieTFA1uL7/jDghiJGubGZ5csicYHU1Xoqb3oH/R5cN5df6W41Nfg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.56.0", - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/typescript-estree": "5.56.0", + "@typescript-eslint/scope-manager": "5.57.1", + "@typescript-eslint/types": "5.57.1", + "@typescript-eslint/typescript-estree": "5.57.1", "eslint-scope": "^5.1.1", "semver": "^7.3.7" }, @@ -1637,13 +1640,13 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/scope-manager": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.56.0.tgz", - "integrity": "sha512-jGYKyt+iBakD0SA5Ww8vFqGpoV2asSjwt60Gl6YcO8ksQ8s2HlUEyHBMSa38bdLopYqGf7EYQMUIGdT/Luw+sw==", + "version": "5.57.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.57.1.tgz", + "integrity": "sha512-N/RrBwEUKMIYxSKl0oDK5sFVHd6VI7p9K5MyUlVYAY6dyNb/wHUqndkTd3XhpGlXgnQsBkRZuu4f9kAHghvgPw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/visitor-keys": "5.56.0" + "@typescript-eslint/types": "5.57.1", + "@typescript-eslint/visitor-keys": "5.57.1" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1654,9 +1657,9 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.56.0.tgz", - "integrity": "sha512-JyAzbTJcIyhuUhogmiu+t79AkdnqgPUEsxMTMc/dCZczGMJQh1MK2wgrju++yMN6AWroVAy2jxyPcPr3SWCq5w==", + "version": "5.57.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.57.1.tgz", + "integrity": "sha512-bSs4LOgyV3bJ08F5RDqO2KXqg3WAdwHCu06zOqcQ6vqbTJizyBhuh1o1ImC69X4bV2g1OJxbH71PJqiO7Y1RuA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1667,13 +1670,13 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.56.0.tgz", - "integrity": "sha512-41CH/GncsLXOJi0jb74SnC7jVPWeVJ0pxQj8bOjH1h2O26jXN3YHKDT1ejkVz5YeTEQPeLCCRY0U2r68tfNOcg==", + "version": "5.57.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.57.1.tgz", + "integrity": "sha512-A2MZqD8gNT0qHKbk2wRspg7cHbCDCk2tcqt6ScCFLr5Ru8cn+TCfM786DjPhqwseiS+PrYwcXht5ztpEQ6TFTw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/visitor-keys": "5.56.0", + "@typescript-eslint/types": "5.57.1", + "@typescript-eslint/visitor-keys": "5.57.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1694,12 +1697,12 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.56.0.tgz", - "integrity": "sha512-1mFdED7u5bZpX6Xxf5N9U2c18sb+8EvU3tyOIj6LQZ5OOvnmj8BVeNNP603OFPm5KkS1a7IvCIcwrdHXaEMG/Q==", + "version": "5.57.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.57.1.tgz", + "integrity": "sha512-RjQrAniDU0CEk5r7iphkm731zKlFiUjvcBS2yHAg8WWqFMCaCrD0rKEVOMUyMMcbGPZ0bPp56srkGWrgfZqLRA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.56.0", + "@typescript-eslint/types": "5.57.1", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -1711,12 +1714,15 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz", + "integrity": "sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/@typescript-eslint/visitor-keys": { @@ -2983,37 +2989,18 @@ } }, "node_modules/eslint-plugin-deprecation": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-deprecation/-/eslint-plugin-deprecation-1.3.3.tgz", - "integrity": "sha512-Bbkv6ZN2cCthVXz/oZKPwsSY5S/CbgTLRG4Q2s2gpPpgNsT0uJ0dB5oLNiWzFYY8AgKX4ULxXFG1l/rDav9QFA==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-deprecation/-/eslint-plugin-deprecation-1.4.1.tgz", + "integrity": "sha512-4vxTghWzxsBukPJVQupi6xlTuDc8Pyi1QlRCrFiLgwLPMJQW3cJCNaehJUKQqQFvuue5m4W27e179Y3Qjzeghg==", "dev": true, "dependencies": { - "@typescript-eslint/experimental-utils": "^5.0.0", + "@typescript-eslint/utils": "^5.57.0", "tslib": "^2.3.1", "tsutils": "^3.21.0" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0", - "typescript": "^3.7.5 || ^4.0.0" - } - }, - "node_modules/eslint-plugin-deprecation/node_modules/@typescript-eslint/experimental-utils": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.56.0.tgz", - "integrity": "sha512-sxWuj0eO5nItmKgZmsBbChVt90EhfkuncDCPbLAVeEJ+SCjXMcZN3AhhNbxed7IeGJ4XwsdL3/FMvD4r+FLqqA==", - "dev": true, - "dependencies": { - "@typescript-eslint/utils": "5.56.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "typescript": "^3.7.5 || ^4.0.0 || ^5.0.0" } }, "node_modules/eslint-plugin-import": { @@ -5311,9 +5298,9 @@ "dev": true }, "node_modules/lint-staged": { - "version": "13.2.0", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.2.0.tgz", - "integrity": "sha512-GbyK5iWinax5Dfw5obm2g2ccUiZXNGtAS4mCbJ0Lv4rq6iEtfBSjOYdcbOtAIFtM114t0vdpViDDetjVTSd8Vw==", + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.2.1.tgz", + "integrity": "sha512-8gfzinVXoPfga5Dz/ZOn8I2GOhf81Wvs+KwbEXQn/oWZAvCVS2PivrXfVbFJc93zD16uC0neS47RXHIjXKYZQw==", "dev": true, "dependencies": { "chalk": "5.2.0", @@ -7388,9 +7375,9 @@ } }, "node_modules/ts-jest": { - "version": "29.0.5", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.0.5.tgz", - "integrity": "sha512-PL3UciSgIpQ7f6XjVOmbi96vmDHUqAyqDr8YxzopDqX3kfgYtX1cuNeBjP+L9sFXi6nzsGGA6R3fP3DDDJyrxA==", + "version": "29.1.0", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.0.tgz", + "integrity": "sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA==", "dev": true, "dependencies": { "bs-logger": "0.x", @@ -7413,7 +7400,7 @@ "@jest/types": "^29.0.0", "babel-jest": "^29.0.0", "jest": "^29.0.0", - "typescript": ">=4.3" + "typescript": ">=4.3 <6" }, "peerDependenciesMeta": { "@babel/core": { @@ -8412,18 +8399,18 @@ "requires": {} }, "@eslint-community/eslint-utils": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.3.0.tgz", - "integrity": "sha512-v3oplH6FYCULtFuCeqyuTd9D2WKO937Dxdq+GmHOLL72TTRriLxz2VLlNfkZRsvj6PKnOPAtuT6dwrs/pA5DvA==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", "dev": true, "requires": { "eslint-visitor-keys": "^3.3.0" }, "dependencies": { "eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz", + "integrity": "sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ==", "dev": true } } @@ -8933,9 +8920,9 @@ "dev": true }, "@types/node": { - "version": "18.15.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.10.tgz", - "integrity": "sha512-9avDaQJczATcXgfmMAW3MIWArOO7A+m90vuCFLr8AotWf8igO/mRoYukrk2cqZVtv38tHs33retzHEilM7FpeQ==", + "version": "18.15.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", + "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==", "dev": true }, "@types/normalize-package-data": { @@ -9073,45 +9060,45 @@ } }, "@typescript-eslint/utils": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.56.0.tgz", - "integrity": "sha512-XhZDVdLnUJNtbzaJeDSCIYaM+Tgr59gZGbFuELgF7m0IY03PlciidS7UQNKLE0+WpUTn1GlycEr6Ivb/afjbhA==", + "version": "5.57.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.57.1.tgz", + "integrity": "sha512-kN6vzzf9NkEtawECqze6v99LtmDiUJCVpvieTFA1uL7/jDghiJGubGZ5csicYHU1Xoqb3oH/R5cN5df6W41Nfg==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.56.0", - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/typescript-estree": "5.56.0", + "@typescript-eslint/scope-manager": "5.57.1", + "@typescript-eslint/types": "5.57.1", + "@typescript-eslint/typescript-estree": "5.57.1", "eslint-scope": "^5.1.1", "semver": "^7.3.7" }, "dependencies": { "@typescript-eslint/scope-manager": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.56.0.tgz", - "integrity": "sha512-jGYKyt+iBakD0SA5Ww8vFqGpoV2asSjwt60Gl6YcO8ksQ8s2HlUEyHBMSa38bdLopYqGf7EYQMUIGdT/Luw+sw==", + "version": "5.57.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.57.1.tgz", + "integrity": "sha512-N/RrBwEUKMIYxSKl0oDK5sFVHd6VI7p9K5MyUlVYAY6dyNb/wHUqndkTd3XhpGlXgnQsBkRZuu4f9kAHghvgPw==", "dev": true, "requires": { - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/visitor-keys": "5.56.0" + "@typescript-eslint/types": "5.57.1", + "@typescript-eslint/visitor-keys": "5.57.1" } }, "@typescript-eslint/types": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.56.0.tgz", - "integrity": "sha512-JyAzbTJcIyhuUhogmiu+t79AkdnqgPUEsxMTMc/dCZczGMJQh1MK2wgrju++yMN6AWroVAy2jxyPcPr3SWCq5w==", + "version": "5.57.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.57.1.tgz", + "integrity": "sha512-bSs4LOgyV3bJ08F5RDqO2KXqg3WAdwHCu06zOqcQ6vqbTJizyBhuh1o1ImC69X4bV2g1OJxbH71PJqiO7Y1RuA==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.56.0.tgz", - "integrity": "sha512-41CH/GncsLXOJi0jb74SnC7jVPWeVJ0pxQj8bOjH1h2O26jXN3YHKDT1ejkVz5YeTEQPeLCCRY0U2r68tfNOcg==", + "version": "5.57.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.57.1.tgz", + "integrity": "sha512-A2MZqD8gNT0qHKbk2wRspg7cHbCDCk2tcqt6ScCFLr5Ru8cn+TCfM786DjPhqwseiS+PrYwcXht5ztpEQ6TFTw==", "dev": true, "requires": { - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/visitor-keys": "5.56.0", + "@typescript-eslint/types": "5.57.1", + "@typescript-eslint/visitor-keys": "5.57.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -9120,19 +9107,19 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.56.0.tgz", - "integrity": "sha512-1mFdED7u5bZpX6Xxf5N9U2c18sb+8EvU3tyOIj6LQZ5OOvnmj8BVeNNP603OFPm5KkS1a7IvCIcwrdHXaEMG/Q==", + "version": "5.57.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.57.1.tgz", + "integrity": "sha512-RjQrAniDU0CEk5r7iphkm731zKlFiUjvcBS2yHAg8WWqFMCaCrD0rKEVOMUyMMcbGPZ0bPp56srkGWrgfZqLRA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.56.0", + "@typescript-eslint/types": "5.57.1", "eslint-visitor-keys": "^3.3.0" } }, "eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz", + "integrity": "sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ==", "dev": true } } @@ -10088,25 +10075,14 @@ } }, "eslint-plugin-deprecation": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-deprecation/-/eslint-plugin-deprecation-1.3.3.tgz", - "integrity": "sha512-Bbkv6ZN2cCthVXz/oZKPwsSY5S/CbgTLRG4Q2s2gpPpgNsT0uJ0dB5oLNiWzFYY8AgKX4ULxXFG1l/rDav9QFA==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-deprecation/-/eslint-plugin-deprecation-1.4.1.tgz", + "integrity": "sha512-4vxTghWzxsBukPJVQupi6xlTuDc8Pyi1QlRCrFiLgwLPMJQW3cJCNaehJUKQqQFvuue5m4W27e179Y3Qjzeghg==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "^5.0.0", + "@typescript-eslint/utils": "^5.57.0", "tslib": "^2.3.1", "tsutils": "^3.21.0" - }, - "dependencies": { - "@typescript-eslint/experimental-utils": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.56.0.tgz", - "integrity": "sha512-sxWuj0eO5nItmKgZmsBbChVt90EhfkuncDCPbLAVeEJ+SCjXMcZN3AhhNbxed7IeGJ4XwsdL3/FMvD4r+FLqqA==", - "dev": true, - "requires": { - "@typescript-eslint/utils": "5.56.0" - } - } } }, "eslint-plugin-import": { @@ -11762,9 +11738,9 @@ "dev": true }, "lint-staged": { - "version": "13.2.0", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.2.0.tgz", - "integrity": "sha512-GbyK5iWinax5Dfw5obm2g2ccUiZXNGtAS4mCbJ0Lv4rq6iEtfBSjOYdcbOtAIFtM114t0vdpViDDetjVTSd8Vw==", + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.2.1.tgz", + "integrity": "sha512-8gfzinVXoPfga5Dz/ZOn8I2GOhf81Wvs+KwbEXQn/oWZAvCVS2PivrXfVbFJc93zD16uC0neS47RXHIjXKYZQw==", "dev": true, "requires": { "chalk": "5.2.0", @@ -13273,9 +13249,9 @@ "dev": true }, "ts-jest": { - "version": "29.0.5", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.0.5.tgz", - "integrity": "sha512-PL3UciSgIpQ7f6XjVOmbi96vmDHUqAyqDr8YxzopDqX3kfgYtX1cuNeBjP+L9sFXi6nzsGGA6R3fP3DDDJyrxA==", + "version": "29.1.0", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.0.tgz", + "integrity": "sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA==", "dev": true, "requires": { "bs-logger": "0.x", diff --git a/package.json b/package.json index 4cc2596..42ac39c 100644 --- a/package.json +++ b/package.json @@ -46,12 +46,12 @@ "devDependencies": { "@1password/front-end-style": "^6.0.1", "@types/jest": "^29.5.0", - "@types/node": "^18.15.10", + "@types/node": "^18.15.11", "@vercel/ncc": "^0.36.1", "husky": "^8.0.3", "jest": "^29.5.0", - "lint-staged": "^13.2.0", - "ts-jest": "^29.0.5", + "lint-staged": "^13.2.1", + "ts-jest": "^29.1.0", "typescript": "^4.9.5" }, "eslintConfig": { From e25f48a775e4c1ce0c24ac228d4f802703226fbc Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Tue, 11 Apr 2023 11:52:18 +0200 Subject: [PATCH 11/44] Upgrade to Typescript 5 --- config/jest.config.js | 8 +++++++- package-lock.json | 16 ++++++++-------- package.json | 2 +- tsconfig.json | 5 ++--- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/config/jest.config.js b/config/jest.config.js index efa2309..9322ab2 100644 --- a/config/jest.config.js +++ b/config/jest.config.js @@ -11,7 +11,13 @@ const jestConfig = { testEnvironment: "node", testRegex: "(/__tests__/.*|(\\.|/)test)\\.ts", transform: { - ".ts": ["ts-jest"], + ".ts": [ + "ts-jest", + { + isolatedModules: true, + useESM: true, + }, + ], }, verbose: true, }; diff --git a/package-lock.json b/package-lock.json index 0fdaf33..6fcf11f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "jest": "^29.5.0", "lint-staged": "^13.2.1", "ts-jest": "^29.1.0", - "typescript": "^4.9.5" + "typescript": "^5.0.4" } }, "node_modules/@1password/front-end-style": { @@ -7533,16 +7533,16 @@ } }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=12.20" } }, "node_modules/unbox-primitive": { @@ -13356,9 +13356,9 @@ } }, "typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", "dev": true }, "unbox-primitive": { diff --git a/package.json b/package.json index 42ac39c..71367b0 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "jest": "^29.5.0", "lint-staged": "^13.2.1", "ts-jest": "^29.1.0", - "typescript": "^4.9.5" + "typescript": "^5.0.4" }, "eslintConfig": { "extends": "./node_modules/@1password/front-end-style/eslintrc.yml", diff --git a/tsconfig.json b/tsconfig.json index f42604b..6008ded 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,8 +6,6 @@ "esModuleInterop": true, "exactOptionalPropertyTypes": true, "forceConsistentCasingInFileNames": true, - "importsNotUsedAsValues": "error", - "isolatedModules": true, "module": "esnext", "moduleResolution": "node", "noEmit": true, @@ -19,6 +17,7 @@ "noUnusedParameters": true, "resolveJsonModule": true, "strict": true, - "target": "es2022" + "target": "es2022", + "verbatimModuleSyntax": true } } From e6d1e6df41a4101d868a749ff02c9c99e344c794 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Tue, 11 Apr 2023 11:56:28 +0200 Subject: [PATCH 12/44] Prettify test.yml --- .github/workflows/test.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a92e835..283fc0c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,8 +5,8 @@ jobs: test-with-output-secrets: strategy: matrix: - os: [ ubuntu-latest, macos-latest ] - auth: [ connect, service-account ] + os: [ubuntu-latest, macos-latest] + auth: [connect, service-account] exclude: - os: macos-latest auth: connect @@ -49,8 +49,8 @@ jobs: test-with-export-env: strategy: matrix: - os: [ ubuntu-latest, macos-latest ] - auth: [ connect, service-account ] + os: [ubuntu-latest, macos-latest] + auth: [connect, service-account] exclude: - os: macos-latest auth: connect @@ -93,8 +93,8 @@ jobs: test-references-with-ids: strategy: matrix: - os: [ ubuntu-latest, macos-latest ] - auth: [ connect, service-account ] + os: [ubuntu-latest, macos-latest] + auth: [connect, service-account] exclude: - os: macos-latest auth: connect From e57ec50d9c80d591d142120f6fc0fdde4bd0c09d Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Tue, 11 Apr 2023 20:13:42 +0200 Subject: [PATCH 13/44] Move constants to constants.ts This shows better what constants we use and they will be later used in both code and tests. --- dist/index.js | 14 +++++++++----- src/constants.ts | 6 ++++++ src/index.ts | 16 ++++++++-------- 3 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 src/constants.ts diff --git a/dist/index.js b/dist/index.js index 0ea11dd..e1768b3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4122,6 +4122,13 @@ const semverToInt = (input) => input .map((n) => n.padStart(2, "0")) .join(""); +;// CONCATENATED MODULE: ./src/constants.ts +const envConnectHost = "OP_CONNECT_HOST"; +const envConnectToken = "OP_CONNECT_TOKEN"; +const envServiceAccountToken = "OP_SERVICE_ACCOUNT_TOKEN"; +const envManagedVariables = "OP_MANAGED_VARIABLES"; +const authErr = `(${envConnectHost} and ${envConnectToken}) or ${envServiceAccountToken} must be set`; + ;// CONCATENATED MODULE: ./src/index.ts @@ -4130,10 +4137,7 @@ const semverToInt = (input) => input -const envConnectHost = "OP_CONNECT_HOST"; -const envConnectToken = "OP_CONNECT_TOKEN"; -const envServiceAccountToken = "OP_SERVICE_ACCOUNT_TOKEN"; -const envManagedVariables = "OP_MANAGED_VARIABLES"; + const run = async () => { try { // Get action inputs @@ -4176,7 +4180,7 @@ const validateAuth = () => { let authType = "Connect"; if (!process.env[envConnectHost] || !process.env[envConnectToken]) { if (!process.env[envServiceAccountToken]) { - throw new Error(`(${envConnectHost} and ${envConnectToken}) or ${envServiceAccountToken} must be set`); + throw new Error(authErr); } authType = "Service account"; } diff --git a/src/constants.ts b/src/constants.ts new file mode 100644 index 0000000..fa34c7b --- /dev/null +++ b/src/constants.ts @@ -0,0 +1,6 @@ +export const envConnectHost = "OP_CONNECT_HOST"; +export const envConnectToken = "OP_CONNECT_TOKEN"; +export const envServiceAccountToken = "OP_SERVICE_ACCOUNT_TOKEN"; +export const envManagedVariables = "OP_MANAGED_VARIABLES"; + +export const authErr = `(${envConnectHost} and ${envConnectToken}) or ${envServiceAccountToken} must be set`; diff --git a/src/index.ts b/src/index.ts index 8431895..8762a94 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,11 +5,13 @@ import * as exec from "@actions/exec"; import { read, setClientInfo } from "@1password/op-js"; import { version } from "../package.json"; import { semverToInt } from "./utils"; - -const envConnectHost = "OP_CONNECT_HOST"; -const envConnectToken = "OP_CONNECT_TOKEN"; -const envServiceAccountToken = "OP_SERVICE_ACCOUNT_TOKEN"; -const envManagedVariables = "OP_MANAGED_VARIABLES"; +import { + envConnectHost, + envConnectToken, + envServiceAccountToken, + envManagedVariables, + authErr, +} from "./constants"; const run = async () => { try { @@ -57,9 +59,7 @@ const validateAuth = () => { let authType = "Connect"; if (!process.env[envConnectHost] || !process.env[envConnectToken]) { if (!process.env[envServiceAccountToken]) { - throw new Error( - `(${envConnectHost} and ${envConnectToken}) or ${envServiceAccountToken} must be set`, - ); + throw new Error(authErr); } authType = "Service account"; } From 06d0dba988c21282a4794649ff22c8acf109c46e Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Tue, 11 Apr 2023 20:27:18 +0200 Subject: [PATCH 14/44] Move 'validateAuth' to 'utils.ts' --- dist/index.js | 48 +++++++++++++++++++++++++----------------------- src/index.ts | 32 ++------------------------------ src/utils.ts | 30 ++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 53 deletions(-) diff --git a/dist/index.js b/dist/index.js index e1768b3..68408fc 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4116,12 +4116,6 @@ var exec = __nccwpck_require__(514); var dist = __nccwpck_require__(91); ;// CONCATENATED MODULE: ./package.json const package_namespaceObject = {"i8":"1.2.0"}; -;// CONCATENATED MODULE: ./src/utils.ts -const semverToInt = (input) => input - .split(".") - .map((n) => n.padStart(2, "0")) - .join(""); - ;// CONCATENATED MODULE: ./src/constants.ts const envConnectHost = "OP_CONNECT_HOST"; const envConnectToken = "OP_CONNECT_TOKEN"; @@ -4129,6 +4123,31 @@ const envServiceAccountToken = "OP_SERVICE_ACCOUNT_TOKEN"; const envManagedVariables = "OP_MANAGED_VARIABLES"; const authErr = `(${envConnectHost} and ${envConnectToken}) or ${envServiceAccountToken} must be set`; +;// CONCATENATED MODULE: ./src/utils.ts + + +const semverToInt = (input) => input + .split(".") + .map((n) => n.padStart(2, "0")) + .join(""); +const validateAuth = () => { + let authType = "Connect"; + if (!process.env[envConnectHost] || !process.env[envConnectToken]) { + if (!process.env[envServiceAccountToken]) { + throw new Error(authErr); + } + authType = "Service account"; + } + // Adjust Connect host to have a protocol + if (process.env[envConnectHost] && + /* eslint-disable no-restricted-syntax */ + !process.env[envConnectHost].startsWith("http://") && + !process.env[envConnectHost].startsWith("https://")) { + process.env[envConnectHost] = `http://${process.env[envConnectHost]}`; + } + core.debug(`Authenticated with ${authType}.`); +}; + ;// CONCATENATED MODULE: ./src/index.ts @@ -4176,23 +4195,6 @@ const unsetPrevious = (shouldUnsetPrevious) => { } } }; -const validateAuth = () => { - let authType = "Connect"; - if (!process.env[envConnectHost] || !process.env[envConnectToken]) { - if (!process.env[envServiceAccountToken]) { - throw new Error(authErr); - } - authType = "Service account"; - } - // Adjust Connect host to have a protocol - if (process.env[envConnectHost] && - /* eslint-disable no-restricted-syntax */ - !process.env[envConnectHost].startsWith("http://") && - !process.env[envConnectHost].startsWith("https://")) { - process.env[envConnectHost] = `http://${process.env[envConnectHost]}`; - } - core.debug(`Authenticated with ${authType}.`); -}; /* eslint-disable @typescript-eslint/naming-convention */ const installCLI = async () => { const currentFile = external_url_default().fileURLToPath(import.meta.url); diff --git a/src/index.ts b/src/index.ts index 8762a94..455ff21 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,14 +4,8 @@ import * as core from "@actions/core"; import * as exec from "@actions/exec"; import { read, setClientInfo } from "@1password/op-js"; import { version } from "../package.json"; -import { semverToInt } from "./utils"; -import { - envConnectHost, - envConnectToken, - envServiceAccountToken, - envManagedVariables, - authErr, -} from "./constants"; +import { semverToInt, validateAuth } from "./utils"; +import { envManagedVariables } from "./constants"; const run = async () => { try { @@ -55,28 +49,6 @@ const unsetPrevious = (shouldUnsetPrevious: boolean) => { } }; -const validateAuth = () => { - let authType = "Connect"; - if (!process.env[envConnectHost] || !process.env[envConnectToken]) { - if (!process.env[envServiceAccountToken]) { - throw new Error(authErr); - } - authType = "Service account"; - } - - // Adjust Connect host to have a protocol - if ( - process.env[envConnectHost] && - /* eslint-disable no-restricted-syntax */ - !process.env[envConnectHost].startsWith("http://") && - !process.env[envConnectHost].startsWith("https://") - ) { - process.env[envConnectHost] = `http://${process.env[envConnectHost]}`; - } - - core.debug(`Authenticated with ${authType}.`); -}; - /* eslint-disable @typescript-eslint/naming-convention */ const installCLI = async (): Promise => { const currentFile = url.fileURLToPath(import.meta.url); diff --git a/src/utils.ts b/src/utils.ts index dee29e4..aab943b 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,35 @@ +import * as core from "@actions/core"; +import { + authErr, + envConnectHost, + envConnectToken, + envServiceAccountToken, +} from "./constants"; + export const semverToInt = (input: string): string => input .split(".") .map((n) => n.padStart(2, "0")) .join(""); + +export const validateAuth = (): void => { + let authType = "Connect"; + if (!process.env[envConnectHost] || !process.env[envConnectToken]) { + if (!process.env[envServiceAccountToken]) { + throw new Error(authErr); + } + authType = "Service account"; + } + + // Adjust Connect host to have a protocol + if ( + process.env[envConnectHost] && + /* eslint-disable no-restricted-syntax */ + !process.env[envConnectHost].startsWith("http://") && + !process.env[envConnectHost].startsWith("https://") + ) { + process.env[envConnectHost] = `http://${process.env[envConnectHost]}`; + } + + core.debug(`Authenticated with ${authType}.`); +}; From 6e0c1c631e1e31a4a13263edda0fc75d47a5c51f Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Tue, 11 Apr 2023 20:30:49 +0200 Subject: [PATCH 15/44] Add validate auth tests --- src/utils.test.ts | 58 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/src/utils.test.ts b/src/utils.test.ts index 8d205b1..13160f7 100644 --- a/src/utils.test.ts +++ b/src/utils.test.ts @@ -1,4 +1,11 @@ -import { semverToInt } from "./utils"; +import * as core from "@actions/core"; +import { semverToInt, validateAuth } from "./utils"; +import { + authErr, + envConnectHost, + envConnectToken, + envServiceAccountToken, +} from "./constants"; describe("semverToInt", () => { it("converts a semver string to build number", () => { @@ -8,3 +15,52 @@ describe("semverToInt", () => { expect(semverToInt("2.1.284")).toBe("0201284"); }); }); + +describe("validateAuth", () => { + const testConnectHost = "https://localhost:8000"; + const mockCoreDebug = jest.spyOn(core, "debug"); + + beforeEach(() => { + process.env[envConnectHost] = ""; + process.env[envConnectToken] = ""; + process.env[envServiceAccountToken] = ""; + jest.clearAllMocks(); + }); + + it("should throw an error when no config is provided", () => { + expect(validateAuth).toThrowError(authErr); + }); + + it("should throw an error when partial Connect config is provided", () => { + process.env[envConnectHost] = testConnectHost; + expect(validateAuth).toThrowError(authErr); + }); + + it("should append protocol if Connect host doesn't have it", () => { + process.env[envConnectHost] = "localhost:8080"; + process.env[envConnectToken] = "token"; + expect(validateAuth).not.toThrowError(authErr); + /* eslint-disable no-restricted-syntax */ + expect(process.env[envConnectHost]).toBe("http://localhost:8080"); + }); + + it("should not append protocol if Connect host has one", () => { + process.env[envConnectHost] = testConnectHost; + process.env[envConnectToken] = "token"; + expect(validateAuth).not.toThrowError(authErr); + expect(process.env[envConnectHost]).toBe(testConnectHost); + }); + + it("should be authenticated as a Connect client", () => { + process.env[envConnectHost] = testConnectHost; + process.env[envConnectToken] = "token"; + expect(validateAuth).not.toThrowError(authErr); + expect(mockCoreDebug).toBeCalledWith("Authenticated with Connect."); + }); + + it("should be authenticated as a service account", () => { + process.env[envServiceAccountToken] = "ops_token"; + expect(validateAuth).not.toThrowError(authErr); + expect(mockCoreDebug).toBeCalledWith("Authenticated with Service account."); + }); +}); From 208d260299e7d2de545b784f3301a9a0f1a66f2d Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Tue, 11 Apr 2023 20:34:06 +0200 Subject: [PATCH 16/44] Extract functionality for extracting a secret This will enable us to easily test the functionality of the action regarding the extraction of secret and how it provides it to the rest of the pipeline based on user's input --- dist/index.js | 32 ++++++++++++++++++-------------- src/index.ts | 18 +++--------------- src/utils.ts | 20 ++++++++++++++++++++ 3 files changed, 41 insertions(+), 29 deletions(-) diff --git a/dist/index.js b/dist/index.js index 68408fc..5ebd0d8 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4126,6 +4126,7 @@ const authErr = `(${envConnectHost} and ${envConnectToken}) or ${envServiceAccou ;// CONCATENATED MODULE: ./src/utils.ts + const semverToInt = (input) => input .split(".") .map((n) => n.padStart(2, "0")) @@ -4147,6 +4148,22 @@ const validateAuth = () => { } core.debug(`Authenticated with ${authType}.`); }; +const extractSecret = (envName, shouldExportEnv) => { + core.debug(`Populating variable: ${envName}`); + const ref = process.env[envName]; + if (ref) { + const secretValue = dist.read.parse(ref); + if (secretValue) { + if (shouldExportEnv) { + core.exportVariable(envName, secretValue); + } + else { + core.setOutput(envName, secretValue); + } + core.setSecret(secretValue); + } + } +}; ;// CONCATENATED MODULE: ./src/index.ts @@ -4222,20 +4239,7 @@ const loadSecrets = async (shouldExportEnv) => { const res = await exec.getExecOutput(`sh -c "op env ls"`); const envs = res.stdout.replace(/\n+$/g, "").split(/\r?\n/); for (const envName of envs) { - core.debug(`Populating variable: ${envName}`); - const ref = process.env[envName]; - if (ref) { - const secretValue = dist.read.parse(ref); - if (secretValue) { - if (shouldExportEnv) { - core.exportVariable(envName, secretValue); - } - else { - core.setOutput(envName, secretValue); - } - core.setSecret(secretValue); - } - } + extractSecret(envName, shouldExportEnv); } if (shouldExportEnv) { core.exportVariable(envManagedVariables, envs.join()); diff --git a/src/index.ts b/src/index.ts index 455ff21..7183602 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,9 +2,9 @@ import path from "path"; import url from "url"; import * as core from "@actions/core"; import * as exec from "@actions/exec"; -import { read, setClientInfo } from "@1password/op-js"; +import { setClientInfo } from "@1password/op-js"; import { version } from "../package.json"; -import { semverToInt, validateAuth } from "./utils"; +import { extractSecret, semverToInt, validateAuth } from "./utils"; import { envManagedVariables } from "./constants"; const run = async () => { @@ -82,19 +82,7 @@ const loadSecrets = async (shouldExportEnv: boolean) => { const res = await exec.getExecOutput(`sh -c "op env ls"`); const envs = res.stdout.replace(/\n+$/g, "").split(/\r?\n/); for (const envName of envs) { - core.debug(`Populating variable: ${envName}`); - const ref = process.env[envName]; - if (ref) { - const secretValue = read.parse(ref); - if (secretValue) { - if (shouldExportEnv) { - core.exportVariable(envName, secretValue); - } else { - core.setOutput(envName, secretValue); - } - core.setSecret(secretValue); - } - } + extractSecret(envName, shouldExportEnv); } if (shouldExportEnv) { core.exportVariable(envManagedVariables, envs.join()); diff --git a/src/utils.ts b/src/utils.ts index aab943b..4c9a829 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,4 +1,5 @@ import * as core from "@actions/core"; +import { read } from "@1password/op-js"; import { authErr, envConnectHost, @@ -33,3 +34,22 @@ export const validateAuth = (): void => { core.debug(`Authenticated with ${authType}.`); }; + +export const extractSecret = ( + envName: string, + shouldExportEnv: boolean, +): void => { + core.debug(`Populating variable: ${envName}`); + const ref = process.env[envName]; + if (ref) { + const secretValue = read.parse(ref); + if (secretValue) { + if (shouldExportEnv) { + core.exportVariable(envName, secretValue); + } else { + core.setOutput(envName, secretValue); + } + core.setSecret(secretValue); + } + } +}; From 33c5cc6fa3a6903f87cf6399051d6cb0180fd703 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Tue, 11 Apr 2023 20:35:23 +0200 Subject: [PATCH 17/44] Add tests for extracting secret --- src/utils.test.ts | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/src/utils.test.ts b/src/utils.test.ts index 13160f7..c36b286 100644 --- a/src/utils.test.ts +++ b/src/utils.test.ts @@ -1,5 +1,6 @@ import * as core from "@actions/core"; -import { semverToInt, validateAuth } from "./utils"; +import { read } from "@1password/op-js"; +import { extractSecret, semverToInt, validateAuth } from "./utils"; import { authErr, envConnectHost, @@ -64,3 +65,43 @@ describe("validateAuth", () => { expect(mockCoreDebug).toBeCalledWith("Authenticated with Service account."); }); }); + +describe("extractSecret", () => { + const envTestSecretEnv = "TEST_SECRET"; + const testSecretRef = "op://vault/item/secret"; + const testSecretValue = "Secret1@3$"; + + const mockCoreExportVariable = jest.spyOn(core, "exportVariable"); + const mockCoreSetOutput = jest.spyOn(core, "setOutput"); + const mockCoreSetSecret = jest.spyOn(core, "setSecret"); + read.parse = jest.fn().mockReturnValue(testSecretValue); + + process.env[envTestSecretEnv] = testSecretRef; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + it("should set secret as step output", () => { + extractSecret(envTestSecretEnv, false); + expect(mockCoreExportVariable).not.toBeCalledWith( + envTestSecretEnv, + testSecretValue, + ); + expect(mockCoreSetOutput).toBeCalledWith(envTestSecretEnv, testSecretValue); + expect(mockCoreSetSecret).toBeCalledWith(testSecretValue); + }); + + it("should set secret as environment variable", () => { + extractSecret(envTestSecretEnv, true); + expect(mockCoreExportVariable).toBeCalledWith( + envTestSecretEnv, + testSecretValue, + ); + expect(mockCoreSetOutput).not.toBeCalledWith( + envTestSecretEnv, + testSecretValue, + ); + expect(mockCoreSetSecret).toBeCalledWith(testSecretValue); + }); +}); From aeb83b5e2a188b7313351bcc217eda48154021ea Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Tue, 11 Apr 2023 20:39:39 +0200 Subject: [PATCH 18/44] Move 'unsetPrevious' to 'utils.ts' --- dist/index.js | 20 ++++++++++---------- src/index.ts | 18 ++++++------------ src/utils.ts | 12 ++++++++++++ 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/dist/index.js b/dist/index.js index 5ebd0d8..ef87268 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4164,6 +4164,16 @@ const extractSecret = (envName, shouldExportEnv) => { } } }; +const unsetPrevious = (shouldUnsetPrevious) => { + if (shouldUnsetPrevious && process.env[envManagedVariables]) { + core.debug(`Unsetting previous values ...`); + const managedEnvs = process.env[envManagedVariables].split(","); + for (const envName of managedEnvs) { + core.debug(`Unsetting ${envName}`); + core.exportVariable(envName, ""); + } + } +}; ;// CONCATENATED MODULE: ./src/index.ts @@ -4202,16 +4212,6 @@ const run = async () => { core.setFailed(message); } }; -const unsetPrevious = (shouldUnsetPrevious) => { - if (shouldUnsetPrevious && process.env[envManagedVariables]) { - core.debug(`Unsetting previous values ...`); - const managedEnvs = process.env[envManagedVariables].split(","); - for (const envName of managedEnvs) { - core.debug(`Unsetting ${envName}`); - core.exportVariable(envName, ""); - } - } -}; /* eslint-disable @typescript-eslint/naming-convention */ const installCLI = async () => { const currentFile = external_url_default().fileURLToPath(import.meta.url); diff --git a/src/index.ts b/src/index.ts index 7183602..3196e06 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,12 @@ import * as core from "@actions/core"; import * as exec from "@actions/exec"; import { setClientInfo } from "@1password/op-js"; import { version } from "../package.json"; -import { extractSecret, semverToInt, validateAuth } from "./utils"; +import { + extractSecret, + semverToInt, + unsetPrevious, + validateAuth, +} from "./utils"; import { envManagedVariables } from "./constants"; const run = async () => { @@ -38,17 +43,6 @@ const run = async () => { } }; -const unsetPrevious = (shouldUnsetPrevious: boolean) => { - if (shouldUnsetPrevious && process.env[envManagedVariables]) { - core.debug(`Unsetting previous values ...`); - const managedEnvs = process.env[envManagedVariables].split(","); - for (const envName of managedEnvs) { - core.debug(`Unsetting ${envName}`); - core.exportVariable(envName, ""); - } - } -}; - /* eslint-disable @typescript-eslint/naming-convention */ const installCLI = async (): Promise => { const currentFile = url.fileURLToPath(import.meta.url); diff --git a/src/utils.ts b/src/utils.ts index 4c9a829..5077746 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -5,6 +5,7 @@ import { envConnectHost, envConnectToken, envServiceAccountToken, + envManagedVariables, } from "./constants"; export const semverToInt = (input: string): string => @@ -53,3 +54,14 @@ export const extractSecret = ( } } }; + +export const unsetPrevious = (shouldUnsetPrevious: boolean): void => { + if (shouldUnsetPrevious && process.env[envManagedVariables]) { + core.debug(`Unsetting previous values ...`); + const managedEnvs = process.env[envManagedVariables].split(","); + for (const envName of managedEnvs) { + core.debug(`Unsetting ${envName}`); + core.exportVariable(envName, ""); + } + } +}; From 5d5973b507a94fe199e1c14916b589894bed6d41 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Tue, 11 Apr 2023 20:43:22 +0200 Subject: [PATCH 19/44] Add unit test pipeline --- .github/workflows/test.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 283fc0c..bfd8e40 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,16 @@ on: push name: Run acceptance tests jobs: + unit-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: npm ci + - run: npm test + test-with-output-secrets: strategy: matrix: From 1db0fc1526beeeca61e8d57e31cd5d842daafe8e Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Wed, 12 Apr 2023 14:23:46 +0200 Subject: [PATCH 20/44] Add tests for 'unsetPrevious' --- src/utils.test.ts | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/utils.test.ts b/src/utils.test.ts index c36b286..9060895 100644 --- a/src/utils.test.ts +++ b/src/utils.test.ts @@ -1,10 +1,16 @@ import * as core from "@actions/core"; import { read } from "@1password/op-js"; -import { extractSecret, semverToInt, validateAuth } from "./utils"; +import { + extractSecret, + semverToInt, + unsetPrevious, + validateAuth, +} from "./utils"; import { authErr, envConnectHost, envConnectToken, + envManagedVariables, envServiceAccountToken, } from "./constants"; @@ -105,3 +111,24 @@ describe("extractSecret", () => { expect(mockCoreSetSecret).toBeCalledWith(testSecretValue); }); }); + +describe("unsetPrevious", () => { + const testManagedEnv = "TEST_SECRET"; + const testSecretValue = "MyS3cr#T"; + + beforeEach(() => { + jest.clearAllMocks(); + process.env[testManagedEnv] = testSecretValue; + process.env[envManagedVariables] = testManagedEnv; + }); + + it("should unset the environment variable if user wants it", () => { + unsetPrevious(true); + expect(process.env[testManagedEnv]).toBe(""); + }); + + it("shouldn't unset the environment variable if user doesn't want it", () => { + unsetPrevious(false); + expect(process.env[testManagedEnv]).toBe(testSecretValue); + }); +}); From d16183d989ad9f763a5e6a67735d0347979298b5 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Mon, 22 May 2023 13:45:54 +0200 Subject: [PATCH 21/44] Improve disabling eslint rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Disable the ES Lint rules only for the next line and add a comment explaining why it’s disabled. --- src/index.ts | 4 +++- src/utils.test.ts | 4 +++- src/utils.ts | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 3196e06..526066b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -43,7 +43,9 @@ const run = async () => { } }; -/* eslint-disable @typescript-eslint/naming-convention */ +// This function's name is an exception from the naming convention +// since we refer to the 1Password CLI here. +// eslint-disable-next-line @typescript-eslint/naming-convention const installCLI = async (): Promise => { const currentFile = url.fileURLToPath(import.meta.url); const currentDir = path.dirname(currentFile); diff --git a/src/utils.test.ts b/src/utils.test.ts index 9060895..e753823 100644 --- a/src/utils.test.ts +++ b/src/utils.test.ts @@ -47,7 +47,9 @@ describe("validateAuth", () => { process.env[envConnectHost] = "localhost:8080"; process.env[envConnectToken] = "token"; expect(validateAuth).not.toThrowError(authErr); - /* eslint-disable no-restricted-syntax */ + // The following lint error is not an issue because we are checking for the presence of the `http://` prefix; + // we are not using it as an insecure connection protocol to link out to another resource. + // eslint-disable-next-line no-restricted-syntax expect(process.env[envConnectHost]).toBe("http://localhost:8080"); }); diff --git a/src/utils.ts b/src/utils.ts index 5077746..62d2c26 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -26,7 +26,9 @@ export const validateAuth = (): void => { // Adjust Connect host to have a protocol if ( process.env[envConnectHost] && - /* eslint-disable no-restricted-syntax */ + // The following lint error is not an issue because we are checking for the presence of the `http://` prefix; + // we are not using it as an insecure connection protocol to link out to another resource. + // eslint-disable-next-line no-restricted-syntax !process.env[envConnectHost].startsWith("http://") && !process.env[envConnectHost].startsWith("https://") ) { From 6ecd5ceaf74eb507deb9fb2d36c18b03422431bc Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Mon, 22 May 2023 15:39:26 +0200 Subject: [PATCH 22/44] Improve code based on PR review feedback This contains code improvements that were easy to address based on PR review feedback. --- config/jest.config.js | 3 +++ src/index.ts | 6 ++++-- src/utils.test.ts | 7 +------ src/utils.ts | 19 ++++++++++--------- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/config/jest.config.js b/config/jest.config.js index 9322ab2..5b00a18 100644 --- a/config/jest.config.js +++ b/config/jest.config.js @@ -14,6 +14,9 @@ const jestConfig = { ".ts": [ "ts-jest", { + // Note: We shouldn't need to include `isolatedModules` here because it's a deprecated config option in TS 5, + // but setting it to `true` fixes the `ESM syntax is not allowed in a CommonJS module when + // 'verbatimModuleSyntax' is enabled` error that we're seeing when running our Jest tests. isolatedModules: true, useESM: true, }, diff --git a/src/index.ts b/src/index.ts index 526066b..15f0609 100644 --- a/src/index.ts +++ b/src/index.ts @@ -19,7 +19,9 @@ const run = async () => { const shouldExportEnv = core.getBooleanInput("export-env"); // Unset all secrets managed by 1Password if `unset-previous` is set. - unsetPrevious(shouldUnsetPrevious); + if (shouldUnsetPrevious) { + unsetPrevious(); + } // Validate that a proper authentication configuration is set for the CLI validateAuth(); @@ -65,7 +67,7 @@ const installCLI = async (): Promise => { }; const loadSecrets = async (shouldExportEnv: boolean) => { - // Pass User-Agent Inforomation to the 1Password CLI + // Pass User-Agent Information to the 1Password CLI setClientInfo({ name: "1Password GitHub Action", id: "GHA", diff --git a/src/utils.test.ts b/src/utils.test.ts index e753823..8d925ae 100644 --- a/src/utils.test.ts +++ b/src/utils.test.ts @@ -125,12 +125,7 @@ describe("unsetPrevious", () => { }); it("should unset the environment variable if user wants it", () => { - unsetPrevious(true); + unsetPrevious(); expect(process.env[testManagedEnv]).toBe(""); }); - - it("shouldn't unset the environment variable if user doesn't want it", () => { - unsetPrevious(false); - expect(process.env[testManagedEnv]).toBe(testSecretValue); - }); }); diff --git a/src/utils.ts b/src/utils.ts index 62d2c26..e731519 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -15,14 +15,15 @@ export const semverToInt = (input: string): string => .join(""); export const validateAuth = (): void => { - let authType = "Connect"; - if (!process.env[envConnectHost] || !process.env[envConnectToken]) { - if (!process.env[envServiceAccountToken]) { - throw new Error(authErr); - } - authType = "Service account"; + const isConnect = process.env[envConnectHost] && process.env[envConnectToken]; + const isServiceAccount = process.env[envServiceAccountToken]; + + if (!isConnect && !isServiceAccount) { + throw new Error(authErr); } + const authType = isConnect ? "Connect" : "Service account"; + // Adjust Connect host to have a protocol if ( process.env[envConnectHost] && @@ -57,9 +58,9 @@ export const extractSecret = ( } }; -export const unsetPrevious = (shouldUnsetPrevious: boolean): void => { - if (shouldUnsetPrevious && process.env[envManagedVariables]) { - core.debug(`Unsetting previous values ...`); +export const unsetPrevious = (): void => { + if (process.env[envManagedVariables]) { + core.debug("Unsetting previous values ..."); const managedEnvs = process.env[envManagedVariables].split(","); for (const envName of managedEnvs) { core.debug(`Unsetting ${envName}`); From 17a2a72e87dddbb35f43825ef9f56a930693f654 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Mon, 22 May 2023 17:19:56 +0200 Subject: [PATCH 23/44] Improve CLI installation functionality MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two key elements are improved: - The action will now automatically fetch the latest stable version of the CLI. There’s no longer the need to hardcode the version and manually update it. - The action will now perform a check if the CLI exists in the pipeline and install it if it’s not available. --- entrypoint.sh => install_cli.sh | 9 +-------- src/index.ts | 30 ++++++++++++++++-------------- 2 files changed, 17 insertions(+), 22 deletions(-) rename entrypoint.sh => install_cli.sh (83%) diff --git a/entrypoint.sh b/install_cli.sh similarity index 83% rename from entrypoint.sh rename to install_cli.sh index 8dd06e2..0eddc64 100755 --- a/entrypoint.sh +++ b/install_cli.sh @@ -3,7 +3,7 @@ set -e # Install op-cli install_op_cli() { - CLI_VERSION="v2.16.0-beta.01" + CLI_VERSION="$(curl https://app-updates.agilebits.com/check/1/0/CLI2/en/2.0.0/N -s | jq -r .version)" OP_INSTALL_DIR="$(mktemp -d)" if [[ ! -d "$OP_INSTALL_DIR" ]]; then echo "Install dir $OP_INSTALL_DIR not found" @@ -21,11 +21,4 @@ install_op_cli() { fi } -# Uninstall op-cli -uninstall_op_cli() { - if [[ -d "$OP_INSTALL_DIR" ]]; then - rm -fr "$OP_INSTALL_DIR" - fi -} - install_op_cli diff --git a/src/index.ts b/src/index.ts index 15f0609..c4caa41 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,7 +2,7 @@ import path from "path"; import url from "url"; import * as core from "@actions/core"; import * as exec from "@actions/exec"; -import { setClientInfo } from "@1password/op-js"; +import { setClientInfo, validateCli } from "@1password/op-js"; import { version } from "../package.json"; import { extractSecret, @@ -49,21 +49,23 @@ const run = async () => { // since we refer to the 1Password CLI here. // eslint-disable-next-line @typescript-eslint/naming-convention const installCLI = async (): Promise => { - const currentFile = url.fileURLToPath(import.meta.url); - const currentDir = path.dirname(currentFile); - const parentDir = path.resolve(currentDir, ".."); + await validateCli().catch(async () => { + const currentFile = url.fileURLToPath(import.meta.url); + const currentDir = path.dirname(currentFile); + const parentDir = path.resolve(currentDir, ".."); - // Execute bash script - const cmdOut = await exec.getExecOutput( - `sh -c "` + parentDir + `/entrypoint.sh"`, - ); + // Execute bash script + const cmdOut = await exec.getExecOutput( + `sh -c "` + parentDir + `/install_cli.sh"`, + ); - // Add path to 1Password CLI to $PATH - const outArr = cmdOut.stdout.split("\n"); - if (outArr[0] && process.env.PATH) { - const cliPath = outArr[0]?.replace(/^(::debug::OP_INSTALL_DIR: )/, ""); - core.addPath(cliPath); - } + // Add path to 1Password CLI to $PATH + const outArr = cmdOut.stdout.split("\n"); + if (outArr[0] && process.env.PATH) { + const cliPath = outArr[0]?.replace(/^(::debug::OP_INSTALL_DIR: )/, ""); + core.addPath(cliPath); + } + }); }; const loadSecrets = async (shouldExportEnv: boolean) => { From 7c957c570233d0664f9b7e566485c77163b11108 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Mon, 22 May 2023 18:45:41 +0200 Subject: [PATCH 24/44] Simplify extractSecret functionality Eliminate the nested conditionals to have a cleaner and more readable code. --- src/utils.ts | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index e731519..67a3989 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -44,18 +44,23 @@ export const extractSecret = ( shouldExportEnv: boolean, ): void => { core.debug(`Populating variable: ${envName}`); + const ref = process.env[envName]; - if (ref) { - const secretValue = read.parse(ref); - if (secretValue) { - if (shouldExportEnv) { - core.exportVariable(envName, secretValue); - } else { - core.setOutput(envName, secretValue); - } - core.setSecret(secretValue); - } + if (!ref) { + return; + } + + const secretValue = read.parse(ref); + if (!secretValue) { + return; + } + + if (shouldExportEnv) { + core.exportVariable(envName, secretValue); + } else { + core.setOutput(envName, secretValue); } + core.setSecret(secretValue); }; export const unsetPrevious = (): void => { From 1b4d2311eb3f5254f85e77c56c93a61e18585dd6 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Mon, 22 May 2023 19:19:57 +0200 Subject: [PATCH 25/44] Update dist/index.js --- dist/index.js | 79 ++++++++++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 35 deletions(-) diff --git a/dist/index.js b/dist/index.js index ef87268..b54bdf4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4132,16 +4132,17 @@ const semverToInt = (input) => input .map((n) => n.padStart(2, "0")) .join(""); const validateAuth = () => { - let authType = "Connect"; - if (!process.env[envConnectHost] || !process.env[envConnectToken]) { - if (!process.env[envServiceAccountToken]) { - throw new Error(authErr); - } - authType = "Service account"; + const isConnect = process.env[envConnectHost] && process.env[envConnectToken]; + const isServiceAccount = process.env[envServiceAccountToken]; + if (!isConnect && !isServiceAccount) { + throw new Error(authErr); } + const authType = isConnect ? "Connect" : "Service account"; // Adjust Connect host to have a protocol if (process.env[envConnectHost] && - /* eslint-disable no-restricted-syntax */ + // The following lint error is not an issue because we are checking for the presence of the `http://` prefix; + // we are not using it as an insecure connection protocol to link out to another resource. + // eslint-disable-next-line no-restricted-syntax !process.env[envConnectHost].startsWith("http://") && !process.env[envConnectHost].startsWith("https://")) { process.env[envConnectHost] = `http://${process.env[envConnectHost]}`; @@ -4151,22 +4152,24 @@ const validateAuth = () => { const extractSecret = (envName, shouldExportEnv) => { core.debug(`Populating variable: ${envName}`); const ref = process.env[envName]; - if (ref) { - const secretValue = dist.read.parse(ref); - if (secretValue) { - if (shouldExportEnv) { - core.exportVariable(envName, secretValue); - } - else { - core.setOutput(envName, secretValue); - } - core.setSecret(secretValue); - } + if (!ref) { + return; + } + const secretValue = dist.read.parse(ref); + if (!secretValue) { + return; } + if (shouldExportEnv) { + core.exportVariable(envName, secretValue); + } + else { + core.setOutput(envName, secretValue); + } + core.setSecret(secretValue); }; -const unsetPrevious = (shouldUnsetPrevious) => { - if (shouldUnsetPrevious && process.env[envManagedVariables]) { - core.debug(`Unsetting previous values ...`); +const unsetPrevious = () => { + if (process.env[envManagedVariables]) { + core.debug("Unsetting previous values ..."); const managedEnvs = process.env[envManagedVariables].split(","); for (const envName of managedEnvs) { core.debug(`Unsetting ${envName}`); @@ -4190,7 +4193,9 @@ const run = async () => { const shouldUnsetPrevious = core.getBooleanInput("unset-previous"); const shouldExportEnv = core.getBooleanInput("export-env"); // Unset all secrets managed by 1Password if `unset-previous` is set. - unsetPrevious(shouldUnsetPrevious); + if (shouldUnsetPrevious) { + unsetPrevious(); + } // Validate that a proper authentication configuration is set for the CLI validateAuth(); // Download and install the CLI @@ -4212,22 +4217,26 @@ const run = async () => { core.setFailed(message); } }; -/* eslint-disable @typescript-eslint/naming-convention */ +// This function's name is an exception from the naming convention +// since we refer to the 1Password CLI here. +// eslint-disable-next-line @typescript-eslint/naming-convention const installCLI = async () => { - const currentFile = external_url_default().fileURLToPath(import.meta.url); - const currentDir = external_path_default().dirname(currentFile); - const parentDir = external_path_default().resolve(currentDir, ".."); - // Execute bash script - const cmdOut = await exec.getExecOutput(`sh -c "` + parentDir + `/entrypoint.sh"`); - // Add path to 1Password CLI to $PATH - const outArr = cmdOut.stdout.split("\n"); - if (outArr[0] && process.env.PATH) { - const cliPath = outArr[0]?.replace(/^(::debug::OP_INSTALL_DIR: )/, ""); - core.addPath(cliPath); - } + await (0,dist.validateCli)().catch(async () => { + const currentFile = external_url_default().fileURLToPath(import.meta.url); + const currentDir = external_path_default().dirname(currentFile); + const parentDir = external_path_default().resolve(currentDir, ".."); + // Execute bash script + const cmdOut = await exec.getExecOutput(`sh -c "` + parentDir + `/install_cli.sh"`); + // Add path to 1Password CLI to $PATH + const outArr = cmdOut.stdout.split("\n"); + if (outArr[0] && process.env.PATH) { + const cliPath = outArr[0]?.replace(/^(::debug::OP_INSTALL_DIR: )/, ""); + core.addPath(cliPath); + } + }); }; const loadSecrets = async (shouldExportEnv) => { - // Pass User-Agent Inforomation to the 1Password CLI + // Pass User-Agent Information to the 1Password CLI (0,dist.setClientInfo)({ name: "1Password GitHub Action", id: "GHA", From 1cbdee38f1f648833035f5f4b4cd3fe145bddb2f Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Mon, 22 May 2023 19:25:56 +0200 Subject: [PATCH 26/44] Fix CLI version The curl would return the version number, but we forgot to append the `v` in the version (i.e. from 2.18.0 to v2.18.0). Now it should be fixed. --- install_cli.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_cli.sh b/install_cli.sh index 0eddc64..f22f6d8 100755 --- a/install_cli.sh +++ b/install_cli.sh @@ -3,7 +3,7 @@ set -e # Install op-cli install_op_cli() { - CLI_VERSION="$(curl https://app-updates.agilebits.com/check/1/0/CLI2/en/2.0.0/N -s | jq -r .version)" + CLI_VERSION="v$(curl https://app-updates.agilebits.com/check/1/0/CLI2/en/2.0.0/N -s | jq -r .version)" OP_INSTALL_DIR="$(mktemp -d)" if [[ ! -d "$OP_INSTALL_DIR" ]]; then echo "Install dir $OP_INSTALL_DIR not found" From e46d4d64c9b72620d5beaa045823d41b175749cc Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Wed, 24 May 2023 12:43:47 +0200 Subject: [PATCH 27/44] Update packages --- package-lock.json | 61 ++++++++++++++++++++++++----------------------- package.json | 6 ++--- 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6fcf11f..53222f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,12 +15,12 @@ }, "devDependencies": { "@1password/front-end-style": "^6.0.1", - "@types/jest": "^29.5.0", - "@types/node": "^18.15.11", + "@types/jest": "^29.5.1", + "@types/node": "^20.2.3", "@vercel/ncc": "^0.36.1", "husky": "^8.0.3", "jest": "^29.5.0", - "lint-staged": "^13.2.1", + "lint-staged": "^13.2.2", "ts-jest": "^29.1.0", "typescript": "^5.0.4" } @@ -1379,9 +1379,9 @@ } }, "node_modules/@types/jest": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.0.tgz", - "integrity": "sha512-3Emr5VOl/aoBwnWcH/EFQvlSAmjV+XtV9GGu5mwdYew5vhQh0IUZx/60x0TzHDu09Bi7HMx10t/namdJw5QIcg==", + "version": "29.5.1", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.1.tgz", + "integrity": "sha512-tEuVcHrpaixS36w7hpsfLBLpjtMRJUE09/MHXn923LOVojDwyC14cWcfc0rDs0VEfUyYmt/+iX1kxxp+gZMcaQ==", "dev": true, "dependencies": { "expect": "^29.0.0", @@ -1407,9 +1407,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.15.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", - "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==", + "version": "20.2.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.2.3.tgz", + "integrity": "sha512-pg9d0yC4rVNWQzX8U7xb4olIOFuuVL9za3bzMT2pu2SU0SNEi66i2qrvhE2qt0HvkhuCaWJu7pLNOt/Pj8BIrw==", "dev": true }, "node_modules/@types/normalize-package-data": { @@ -5298,9 +5298,9 @@ "dev": true }, "node_modules/lint-staged": { - "version": "13.2.1", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.2.1.tgz", - "integrity": "sha512-8gfzinVXoPfga5Dz/ZOn8I2GOhf81Wvs+KwbEXQn/oWZAvCVS2PivrXfVbFJc93zD16uC0neS47RXHIjXKYZQw==", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.2.2.tgz", + "integrity": "sha512-71gSwXKy649VrSU09s10uAT0rWCcY3aewhMaHyl2N84oBk4Xs9HgxvUp3AYu+bNsK4NrOYYxvSgg7FyGJ+jGcA==", "dev": true, "dependencies": { "chalk": "5.2.0", @@ -5315,7 +5315,7 @@ "object-inspect": "^1.12.3", "pidtree": "^0.6.0", "string-argv": "^0.3.1", - "yaml": "^2.2.1" + "yaml": "^2.2.2" }, "bin": { "lint-staged": "bin/lint-staged.js" @@ -5450,12 +5450,13 @@ } }, "node_modules/lint-staged/node_modules/yaml": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz", - "integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.0.tgz", + "integrity": "sha512-8/1wgzdKc7bc9E6my5wZjmdavHLvO/QOmLG1FBugblEvY4IXrLjlViIOmL24HthU042lWTDRO90Fz1Yp66UnMw==", "dev": true, "engines": { - "node": ">= 14" + "node": ">= 14", + "npm": ">= 7" } }, "node_modules/listr2": { @@ -8892,9 +8893,9 @@ } }, "@types/jest": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.0.tgz", - "integrity": "sha512-3Emr5VOl/aoBwnWcH/EFQvlSAmjV+XtV9GGu5mwdYew5vhQh0IUZx/60x0TzHDu09Bi7HMx10t/namdJw5QIcg==", + "version": "29.5.1", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.1.tgz", + "integrity": "sha512-tEuVcHrpaixS36w7hpsfLBLpjtMRJUE09/MHXn923LOVojDwyC14cWcfc0rDs0VEfUyYmt/+iX1kxxp+gZMcaQ==", "dev": true, "requires": { "expect": "^29.0.0", @@ -8920,9 +8921,9 @@ "dev": true }, "@types/node": { - "version": "18.15.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", - "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==", + "version": "20.2.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.2.3.tgz", + "integrity": "sha512-pg9d0yC4rVNWQzX8U7xb4olIOFuuVL9za3bzMT2pu2SU0SNEi66i2qrvhE2qt0HvkhuCaWJu7pLNOt/Pj8BIrw==", "dev": true }, "@types/normalize-package-data": { @@ -11738,9 +11739,9 @@ "dev": true }, "lint-staged": { - "version": "13.2.1", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.2.1.tgz", - "integrity": "sha512-8gfzinVXoPfga5Dz/ZOn8I2GOhf81Wvs+KwbEXQn/oWZAvCVS2PivrXfVbFJc93zD16uC0neS47RXHIjXKYZQw==", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.2.2.tgz", + "integrity": "sha512-71gSwXKy649VrSU09s10uAT0rWCcY3aewhMaHyl2N84oBk4Xs9HgxvUp3AYu+bNsK4NrOYYxvSgg7FyGJ+jGcA==", "dev": true, "requires": { "chalk": "5.2.0", @@ -11755,7 +11756,7 @@ "object-inspect": "^1.12.3", "pidtree": "^0.6.0", "string-argv": "^0.3.1", - "yaml": "^2.2.1" + "yaml": "^2.2.2" }, "dependencies": { "chalk": { @@ -11830,9 +11831,9 @@ "dev": true }, "yaml": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz", - "integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.0.tgz", + "integrity": "sha512-8/1wgzdKc7bc9E6my5wZjmdavHLvO/QOmLG1FBugblEvY4IXrLjlViIOmL24HthU042lWTDRO90Fz1Yp66UnMw==", "dev": true } } diff --git a/package.json b/package.json index 71367b0..1829cbc 100644 --- a/package.json +++ b/package.json @@ -45,12 +45,12 @@ }, "devDependencies": { "@1password/front-end-style": "^6.0.1", - "@types/jest": "^29.5.0", - "@types/node": "^18.15.11", + "@types/jest": "^29.5.1", + "@types/node": "^20.2.3", "@vercel/ncc": "^0.36.1", "husky": "^8.0.3", "jest": "^29.5.0", - "lint-staged": "^13.2.1", + "lint-staged": "^13.2.2", "ts-jest": "^29.1.0", "typescript": "^5.0.4" }, From ad89fe719c35a3d4d7d66bac6dcf8320727e35a2 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Thu, 25 May 2023 15:03:05 +0200 Subject: [PATCH 28/44] Move loadSecrets function to utils.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is done to keep things modular and narrow down the scope and complexity of index.ts. `installCLI` will be kept in `index.ts` for the following reasons: - Moving it to utils brings complications (`import.meta.url` doesn’t work) - This code will be removed once the action will make use of the separate install CLI action --- src/index.ts | 32 ++------------------------------ src/utils.ts | 25 ++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 31 deletions(-) diff --git a/src/index.ts b/src/index.ts index c4caa41..ee15d30 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,15 +2,8 @@ import path from "path"; import url from "url"; import * as core from "@actions/core"; import * as exec from "@actions/exec"; -import { setClientInfo, validateCli } from "@1password/op-js"; -import { version } from "../package.json"; -import { - extractSecret, - semverToInt, - unsetPrevious, - validateAuth, -} from "./utils"; -import { envManagedVariables } from "./constants"; +import { validateCli } from "@1password/op-js"; +import { loadSecrets, unsetPrevious, validateAuth } from "./utils"; const run = async () => { try { @@ -68,25 +61,4 @@ const installCLI = async (): Promise => { }); }; -const loadSecrets = async (shouldExportEnv: boolean) => { - // Pass User-Agent Information to the 1Password CLI - setClientInfo({ - name: "1Password GitHub Action", - id: "GHA", - build: semverToInt(version), - }); - - // Load secrets from environment variables using 1Password CLI. - // Iterate over them to find 1Password references, extract the secret values, - // and make them available in the next steps either as step outputs or as environment variables. - const res = await exec.getExecOutput(`sh -c "op env ls"`); - const envs = res.stdout.replace(/\n+$/g, "").split(/\r?\n/); - for (const envName of envs) { - extractSecret(envName, shouldExportEnv); - } - if (shouldExportEnv) { - core.exportVariable(envManagedVariables, envs.join()); - } -}; - void run(); diff --git a/src/utils.ts b/src/utils.ts index 67a3989..7e8544f 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,7 @@ import * as core from "@actions/core"; -import { read } from "@1password/op-js"; +import * as exec from "@actions/exec"; +import { read, setClientInfo } from "@1password/op-js"; +import { version } from "../package.json"; import { authErr, envConnectHost, @@ -63,6 +65,27 @@ export const extractSecret = ( core.setSecret(secretValue); }; +export const loadSecrets = async (shouldExportEnv: boolean): Promise => { + // Pass User-Agent Information to the 1Password CLI + setClientInfo({ + name: "1Password GitHub Action", + id: "GHA", + build: semverToInt(version), + }); + + // Load secrets from environment variables using 1Password CLI. + // Iterate over them to find 1Password references, extract the secret values, + // and make them available in the next steps either as step outputs or as environment variables. + const res = await exec.getExecOutput(`sh -c "op env ls"`); + const envs = res.stdout.replace(/\n+$/g, "").split(/\r?\n/); + for (const envName of envs) { + extractSecret(envName, shouldExportEnv); + } + if (shouldExportEnv) { + core.exportVariable(envManagedVariables, envs.join()); + } +}; + export const unsetPrevious = (): void => { if (process.env[envManagedVariables]) { core.debug("Unsetting previous values ..."); From 3963458d759cfeb5bb9b0a4b711c0c7388b49001 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Thu, 25 May 2023 15:08:24 +0200 Subject: [PATCH 29/44] Improve code --- src/constants.ts | 2 +- src/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index fa34c7b..83d7c06 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -3,4 +3,4 @@ export const envConnectToken = "OP_CONNECT_TOKEN"; export const envServiceAccountToken = "OP_SERVICE_ACCOUNT_TOKEN"; export const envManagedVariables = "OP_MANAGED_VARIABLES"; -export const authErr = `(${envConnectHost} and ${envConnectToken}) or ${envServiceAccountToken} must be set`; +export const authErr = `Authentication error with environment variables: you must set either 1) ${envServiceAccountToken}, or 2) both ${envConnectHost} and ${envConnectToken}.`; diff --git a/src/index.ts b/src/index.ts index ee15d30..2e2cd67 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,7 +5,7 @@ import * as exec from "@actions/exec"; import { validateCli } from "@1password/op-js"; import { loadSecrets, unsetPrevious, validateAuth } from "./utils"; -const run = async () => { +const loadSecretsAction = async () => { try { // Get action inputs const shouldUnsetPrevious = core.getBooleanInput("unset-previous"); @@ -61,4 +61,4 @@ const installCLI = async (): Promise => { }); }; -void run(); +void loadSecretsAction(); From 1dd370e8b6636fb39071c08b924d06dc02a3de25 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Thu, 25 May 2023 15:14:47 +0200 Subject: [PATCH 30/44] Simplify code related to mocking --- src/utils.test.ts | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/src/utils.test.ts b/src/utils.test.ts index 8d925ae..547902b 100644 --- a/src/utils.test.ts +++ b/src/utils.test.ts @@ -14,6 +14,12 @@ import { envServiceAccountToken, } from "./constants"; +jest.mock("@actions/core"); + +beforeEach(() => { + jest.clearAllMocks(); +}); + describe("semverToInt", () => { it("converts a semver string to build number", () => { expect(semverToInt("0.1.2")).toBe("000102"); @@ -25,13 +31,11 @@ describe("semverToInt", () => { describe("validateAuth", () => { const testConnectHost = "https://localhost:8000"; - const mockCoreDebug = jest.spyOn(core, "debug"); beforeEach(() => { process.env[envConnectHost] = ""; process.env[envConnectToken] = ""; process.env[envServiceAccountToken] = ""; - jest.clearAllMocks(); }); it("should throw an error when no config is provided", () => { @@ -64,13 +68,13 @@ describe("validateAuth", () => { process.env[envConnectHost] = testConnectHost; process.env[envConnectToken] = "token"; expect(validateAuth).not.toThrowError(authErr); - expect(mockCoreDebug).toBeCalledWith("Authenticated with Connect."); + expect(core.debug).toBeCalledWith("Authenticated with Connect."); }); it("should be authenticated as a service account", () => { process.env[envServiceAccountToken] = "ops_token"; expect(validateAuth).not.toThrowError(authErr); - expect(mockCoreDebug).toBeCalledWith("Authenticated with Service account."); + expect(core.debug).toBeCalledWith("Authenticated with Service account."); }); }); @@ -79,38 +83,31 @@ describe("extractSecret", () => { const testSecretRef = "op://vault/item/secret"; const testSecretValue = "Secret1@3$"; - const mockCoreExportVariable = jest.spyOn(core, "exportVariable"); - const mockCoreSetOutput = jest.spyOn(core, "setOutput"); - const mockCoreSetSecret = jest.spyOn(core, "setSecret"); read.parse = jest.fn().mockReturnValue(testSecretValue); process.env[envTestSecretEnv] = testSecretRef; - beforeEach(() => { - jest.clearAllMocks(); - }); - it("should set secret as step output", () => { extractSecret(envTestSecretEnv, false); - expect(mockCoreExportVariable).not.toBeCalledWith( + expect(core.exportVariable).not.toBeCalledWith( envTestSecretEnv, testSecretValue, ); - expect(mockCoreSetOutput).toBeCalledWith(envTestSecretEnv, testSecretValue); - expect(mockCoreSetSecret).toBeCalledWith(testSecretValue); + expect(core.setOutput).toBeCalledWith(envTestSecretEnv, testSecretValue); + expect(core.setSecret).toBeCalledWith(testSecretValue); }); it("should set secret as environment variable", () => { extractSecret(envTestSecretEnv, true); - expect(mockCoreExportVariable).toBeCalledWith( + expect(core.exportVariable).toBeCalledWith( envTestSecretEnv, testSecretValue, ); - expect(mockCoreSetOutput).not.toBeCalledWith( + expect(core.setOutput).not.toBeCalledWith( envTestSecretEnv, testSecretValue, ); - expect(mockCoreSetSecret).toBeCalledWith(testSecretValue); + expect(core.setSecret).toBeCalledWith(testSecretValue); }); }); @@ -119,13 +116,14 @@ describe("unsetPrevious", () => { const testSecretValue = "MyS3cr#T"; beforeEach(() => { - jest.clearAllMocks(); process.env[testManagedEnv] = testSecretValue; process.env[envManagedVariables] = testManagedEnv; }); it("should unset the environment variable if user wants it", () => { unsetPrevious(); - expect(process.env[testManagedEnv]).toBe(""); + expect(core.debug).toHaveBeenCalledWith("Unsetting previous values ..."); + expect(core.debug).toHaveBeenCalledWith("Unsetting TEST_SECRET"); + expect(core.exportVariable).toHaveBeenCalledWith("TEST_SECRET", ""); }); }); From 57ddba0a994c9e199fa23491b9239fe3005e695a Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Tue, 4 Jul 2023 12:31:13 +0100 Subject: [PATCH 31/44] Update packages --- package-lock.json | 102 +++++++++++++++++++++++----------------------- package.json | 12 +++--- 2 files changed, 57 insertions(+), 57 deletions(-) diff --git a/package-lock.json b/package-lock.json index 53222f6..d231ff3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,20 +9,20 @@ "version": "1.2.0", "license": "MIT", "dependencies": { - "@1password/op-js": "^0.1.8", + "@1password/op-js": "^0.1.9", "@actions/core": "^1.10.0", "@actions/exec": "^1.1.1" }, "devDependencies": { "@1password/front-end-style": "^6.0.1", - "@types/jest": "^29.5.1", - "@types/node": "^20.2.3", + "@types/jest": "^29.5.2", + "@types/node": "^20.3.3", "@vercel/ncc": "^0.36.1", "husky": "^8.0.3", "jest": "^29.5.0", - "lint-staged": "^13.2.2", - "ts-jest": "^29.1.0", - "typescript": "^5.0.4" + "lint-staged": "^13.2.3", + "ts-jest": "^29.1.1", + "typescript": "^5.1.6" } }, "node_modules/@1password/front-end-style": { @@ -59,9 +59,9 @@ } }, "node_modules/@1password/op-js": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/@1password/op-js/-/op-js-0.1.8.tgz", - "integrity": "sha512-36Y4TXI0tBwDe6672CHhHvZErf1mgH0/AVt0woCZByOBM5PPUq/CSxAHKilKZrK8vpsTBA68MxV8q2RUExzfsg==", + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/@1password/op-js/-/op-js-0.1.9.tgz", + "integrity": "sha512-nDi6JOwfzn7SNhf2v9ldF/61C+eKSukUxKHlS3wOtO2hyMDEDiAnrkVPXQogcrucczLTgI3z26FKliYitTCR5Q==", "dependencies": { "lookpath": "^1.2.2", "semver": "^7.3.6" @@ -1379,9 +1379,9 @@ } }, "node_modules/@types/jest": { - "version": "29.5.1", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.1.tgz", - "integrity": "sha512-tEuVcHrpaixS36w7hpsfLBLpjtMRJUE09/MHXn923LOVojDwyC14cWcfc0rDs0VEfUyYmt/+iX1kxxp+gZMcaQ==", + "version": "29.5.2", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.2.tgz", + "integrity": "sha512-mSoZVJF5YzGVCk+FsDxzDuH7s+SCkzrgKZzf0Z0T2WudhBUPoF6ktoTPC4R0ZoCPCV5xUvuU6ias5NvxcBcMMg==", "dev": true, "dependencies": { "expect": "^29.0.0", @@ -1407,9 +1407,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.2.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.2.3.tgz", - "integrity": "sha512-pg9d0yC4rVNWQzX8U7xb4olIOFuuVL9za3bzMT2pu2SU0SNEi66i2qrvhE2qt0HvkhuCaWJu7pLNOt/Pj8BIrw==", + "version": "20.3.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.3.tgz", + "integrity": "sha512-wheIYdr4NYML61AjC8MKj/2jrR/kDQri/CIpVoZwldwhnIrD/j9jIU5bJ8yBKuB2VhpFV7Ab6G2XkBjv9r9Zzw==", "dev": true }, "node_modules/@types/normalize-package-data": { @@ -5298,9 +5298,9 @@ "dev": true }, "node_modules/lint-staged": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.2.2.tgz", - "integrity": "sha512-71gSwXKy649VrSU09s10uAT0rWCcY3aewhMaHyl2N84oBk4Xs9HgxvUp3AYu+bNsK4NrOYYxvSgg7FyGJ+jGcA==", + "version": "13.2.3", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.2.3.tgz", + "integrity": "sha512-zVVEXLuQIhr1Y7R7YAWx4TZLdvuzk7DnmrsTNL0fax6Z3jrpFcas+vKbzxhhvp6TA55m1SQuWkpzI1qbfDZbAg==", "dev": true, "dependencies": { "chalk": "5.2.0", @@ -6796,9 +6796,9 @@ } }, "node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -7376,9 +7376,9 @@ } }, "node_modules/ts-jest": { - "version": "29.1.0", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.0.tgz", - "integrity": "sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA==", + "version": "29.1.1", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.1.tgz", + "integrity": "sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==", "dev": true, "dependencies": { "bs-logger": "0.x", @@ -7387,7 +7387,7 @@ "json5": "^2.2.3", "lodash.memoize": "4.x", "make-error": "1.x", - "semver": "7.x", + "semver": "^7.5.3", "yargs-parser": "^21.0.1" }, "bin": { @@ -7534,16 +7534,16 @@ } }, "node_modules/typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=12.20" + "node": ">=14.17" } }, "node_modules/unbox-primitive": { @@ -7846,9 +7846,9 @@ } }, "@1password/op-js": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/@1password/op-js/-/op-js-0.1.8.tgz", - "integrity": "sha512-36Y4TXI0tBwDe6672CHhHvZErf1mgH0/AVt0woCZByOBM5PPUq/CSxAHKilKZrK8vpsTBA68MxV8q2RUExzfsg==", + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/@1password/op-js/-/op-js-0.1.9.tgz", + "integrity": "sha512-nDi6JOwfzn7SNhf2v9ldF/61C+eKSukUxKHlS3wOtO2hyMDEDiAnrkVPXQogcrucczLTgI3z26FKliYitTCR5Q==", "requires": { "lookpath": "^1.2.2", "semver": "^7.3.6" @@ -8893,9 +8893,9 @@ } }, "@types/jest": { - "version": "29.5.1", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.1.tgz", - "integrity": "sha512-tEuVcHrpaixS36w7hpsfLBLpjtMRJUE09/MHXn923LOVojDwyC14cWcfc0rDs0VEfUyYmt/+iX1kxxp+gZMcaQ==", + "version": "29.5.2", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.2.tgz", + "integrity": "sha512-mSoZVJF5YzGVCk+FsDxzDuH7s+SCkzrgKZzf0Z0T2WudhBUPoF6ktoTPC4R0ZoCPCV5xUvuU6ias5NvxcBcMMg==", "dev": true, "requires": { "expect": "^29.0.0", @@ -8921,9 +8921,9 @@ "dev": true }, "@types/node": { - "version": "20.2.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.2.3.tgz", - "integrity": "sha512-pg9d0yC4rVNWQzX8U7xb4olIOFuuVL9za3bzMT2pu2SU0SNEi66i2qrvhE2qt0HvkhuCaWJu7pLNOt/Pj8BIrw==", + "version": "20.3.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.3.tgz", + "integrity": "sha512-wheIYdr4NYML61AjC8MKj/2jrR/kDQri/CIpVoZwldwhnIrD/j9jIU5bJ8yBKuB2VhpFV7Ab6G2XkBjv9r9Zzw==", "dev": true }, "@types/normalize-package-data": { @@ -11739,9 +11739,9 @@ "dev": true }, "lint-staged": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.2.2.tgz", - "integrity": "sha512-71gSwXKy649VrSU09s10uAT0rWCcY3aewhMaHyl2N84oBk4Xs9HgxvUp3AYu+bNsK4NrOYYxvSgg7FyGJ+jGcA==", + "version": "13.2.3", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.2.3.tgz", + "integrity": "sha512-zVVEXLuQIhr1Y7R7YAWx4TZLdvuzk7DnmrsTNL0fax6Z3jrpFcas+vKbzxhhvp6TA55m1SQuWkpzI1qbfDZbAg==", "dev": true, "requires": { "chalk": "5.2.0", @@ -12790,9 +12790,9 @@ } }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", "requires": { "lru-cache": "^6.0.0" }, @@ -13250,9 +13250,9 @@ "dev": true }, "ts-jest": { - "version": "29.1.0", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.0.tgz", - "integrity": "sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA==", + "version": "29.1.1", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.1.tgz", + "integrity": "sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==", "dev": true, "requires": { "bs-logger": "0.x", @@ -13261,7 +13261,7 @@ "json5": "^2.2.3", "lodash.memoize": "4.x", "make-error": "1.x", - "semver": "7.x", + "semver": "^7.5.3", "yargs-parser": "^21.0.1" }, "dependencies": { @@ -13357,9 +13357,9 @@ } }, "typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true }, "unbox-primitive": { diff --git a/package.json b/package.json index 1829cbc..3d8161c 100644 --- a/package.json +++ b/package.json @@ -39,20 +39,20 @@ }, "homepage": "https://github.com/1Password/load-secrets-action#readme", "dependencies": { - "@1password/op-js": "^0.1.8", + "@1password/op-js": "^0.1.9", "@actions/core": "^1.10.0", "@actions/exec": "^1.1.1" }, "devDependencies": { "@1password/front-end-style": "^6.0.1", - "@types/jest": "^29.5.1", - "@types/node": "^20.2.3", + "@types/jest": "^29.5.2", + "@types/node": "^20.3.3", "@vercel/ncc": "^0.36.1", "husky": "^8.0.3", "jest": "^29.5.0", - "lint-staged": "^13.2.2", - "ts-jest": "^29.1.0", - "typescript": "^5.0.4" + "lint-staged": "^13.2.3", + "ts-jest": "^29.1.1", + "typescript": "^5.1.6" }, "eslintConfig": { "extends": "./node_modules/@1password/front-end-style/eslintrc.yml", From 35650f8988cd23393a4e01663ccc6cd677368432 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Tue, 4 Jul 2023 12:46:05 +0100 Subject: [PATCH 32/44] Use semverToInt from op-js Verion `0.1.9` of the `op-js` exports function `semverToInt`, therefore we no longer need to duplicate it in our code. --- src/utils.test.ts | 16 +--------------- src/utils.ts | 8 +------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/utils.test.ts b/src/utils.test.ts index 547902b..84c7cf8 100644 --- a/src/utils.test.ts +++ b/src/utils.test.ts @@ -1,11 +1,6 @@ import * as core from "@actions/core"; import { read } from "@1password/op-js"; -import { - extractSecret, - semverToInt, - unsetPrevious, - validateAuth, -} from "./utils"; +import { extractSecret, unsetPrevious, validateAuth } from "./utils"; import { authErr, envConnectHost, @@ -20,15 +15,6 @@ beforeEach(() => { jest.clearAllMocks(); }); -describe("semverToInt", () => { - it("converts a semver string to build number", () => { - expect(semverToInt("0.1.2")).toBe("000102"); - expect(semverToInt("1.2.3")).toBe("010203"); - expect(semverToInt("12.2.39")).toBe("120239"); - expect(semverToInt("2.1.284")).toBe("0201284"); - }); -}); - describe("validateAuth", () => { const testConnectHost = "https://localhost:8000"; diff --git a/src/utils.ts b/src/utils.ts index 7e8544f..8eb2252 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,6 +1,6 @@ import * as core from "@actions/core"; import * as exec from "@actions/exec"; -import { read, setClientInfo } from "@1password/op-js"; +import { read, setClientInfo, semverToInt } from "@1password/op-js"; import { version } from "../package.json"; import { authErr, @@ -10,12 +10,6 @@ import { envManagedVariables, } from "./constants"; -export const semverToInt = (input: string): string => - input - .split(".") - .map((n) => n.padStart(2, "0")) - .join(""); - export const validateAuth = (): void => { const isConnect = process.env[envConnectHost] && process.env[envConnectToken]; const isServiceAccount = process.env[envServiceAccountToken]; From 1b79bb167190c009d29d9622d4a6e2a3844e3e39 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Tue, 4 Jul 2023 12:47:03 +0100 Subject: [PATCH 33/44] Imporve CLI installation script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add architectures for Linux runners. Fail if the architecture is not supported. - Fail if the runner’s operating system is not supported. --- install_cli.sh | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/install_cli.sh b/install_cli.sh index f22f6d8..2230b91 100755 --- a/install_cli.sh +++ b/install_cli.sh @@ -3,21 +3,42 @@ set -e # Install op-cli install_op_cli() { - CLI_VERSION="v$(curl https://app-updates.agilebits.com/check/1/0/CLI2/en/2.0.0/N -s | jq -r .version)" + # Create a temporary directory where the CLI is installed OP_INSTALL_DIR="$(mktemp -d)" if [[ ! -d "$OP_INSTALL_DIR" ]]; then echo "Install dir $OP_INSTALL_DIR not found" exit 1 fi echo "::debug::OP_INSTALL_DIR: ${OP_INSTALL_DIR}" + + # Get the latest stable version of the CLI + CLI_VERSION="v$(curl https://app-updates.agilebits.com/check/1/0/CLI2/en/2.0.0/N -s | jq -r .version)" + if [[ "$OSTYPE" == "linux-gnu"* ]]; then - curl -sSfLo op.zip "https://cache.agilebits.com/dist/1P/op2/pkg/$CLI_VERSION/op_linux_amd64_$CLI_VERSION.zip" + ARCH=$(uname -m) + if [[ "$(getconf LONG_BIT)" = 32 ]]; then + ARCH="386" + elif [[ "$ARCH" == "x86_64" ]]; then + ARCH="amd64" + elif [[ "$ARCH" == "aarch64" ]]; then + ARCH="arm64" + fi + + if [[ "$ARCH" != "386" ]] && [[ "$ARCH" != "amd64" ]] && [[ "$ARCH" != "arm" ]] && [[ "$ARCH" != "arm64" ]]; then + echo "Unsupported architecture for the 1Password CLI: $ARCH." + exit 1 + fi + + curl -sSfLo op.zip "https://cache.agilebits.com/dist/1P/op2/pkg/${CLI_VERSION}/op_linux_${ARCH}_${CLI_VERSION}.zip" unzip -od "$OP_INSTALL_DIR" op.zip && rm op.zip elif [[ "$OSTYPE" == "darwin"* ]]; then - curl -sSfLo op.pkg "https://cache.agilebits.com/dist/1P/op2/pkg/$CLI_VERSION/op_apple_universal_$CLI_VERSION.pkg" + curl -sSfLo op.pkg "https://cache.agilebits.com/dist/1P/op2/pkg/${CLI_VERSION}/op_apple_universal_${CLI_VERSION}.pkg" pkgutil --expand op.pkg temp-pkg tar -xvf temp-pkg/op.pkg/Payload -C "$OP_INSTALL_DIR" rm -rf temp-pkg && rm op.pkg + else + echo "Operating system not supported yet for this GitHub Action: $OSTYPE." + exit 1 fi } From 3daee42ccd25e8cf8f5b93b3ffd50fd286f3de56 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Thu, 6 Jul 2023 10:51:53 +0100 Subject: [PATCH 34/44] Change from debug messages to info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In pre-TS GitHub Action, we’d print some messages to the output as info (e.g. authenticated as, populating variable, unsetting previous values). Therefore, we apply the same principle here since there’s useful info. --- src/utils.test.ts | 18 ++++++++++-------- src/utils.ts | 8 ++++---- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/utils.test.ts b/src/utils.test.ts index 84c7cf8..671ceb1 100644 --- a/src/utils.test.ts +++ b/src/utils.test.ts @@ -17,6 +17,8 @@ beforeEach(() => { describe("validateAuth", () => { const testConnectHost = "https://localhost:8000"; + const testConnectToken = "token"; + const testServiceAccountToken = "ops_token"; beforeEach(() => { process.env[envConnectHost] = ""; @@ -35,7 +37,7 @@ describe("validateAuth", () => { it("should append protocol if Connect host doesn't have it", () => { process.env[envConnectHost] = "localhost:8080"; - process.env[envConnectToken] = "token"; + process.env[envConnectToken] = testConnectToken; expect(validateAuth).not.toThrowError(authErr); // The following lint error is not an issue because we are checking for the presence of the `http://` prefix; // we are not using it as an insecure connection protocol to link out to another resource. @@ -45,22 +47,22 @@ describe("validateAuth", () => { it("should not append protocol if Connect host has one", () => { process.env[envConnectHost] = testConnectHost; - process.env[envConnectToken] = "token"; + process.env[envConnectToken] = testConnectToken; expect(validateAuth).not.toThrowError(authErr); expect(process.env[envConnectHost]).toBe(testConnectHost); }); it("should be authenticated as a Connect client", () => { process.env[envConnectHost] = testConnectHost; - process.env[envConnectToken] = "token"; + process.env[envConnectToken] = testConnectToken; expect(validateAuth).not.toThrowError(authErr); - expect(core.debug).toBeCalledWith("Authenticated with Connect."); + expect(core.info).toBeCalledWith("Authenticated with Connect."); }); it("should be authenticated as a service account", () => { - process.env[envServiceAccountToken] = "ops_token"; + process.env[envServiceAccountToken] = testServiceAccountToken; expect(validateAuth).not.toThrowError(authErr); - expect(core.debug).toBeCalledWith("Authenticated with Service account."); + expect(core.info).toBeCalledWith("Authenticated with Service account."); }); }); @@ -108,8 +110,8 @@ describe("unsetPrevious", () => { it("should unset the environment variable if user wants it", () => { unsetPrevious(); - expect(core.debug).toHaveBeenCalledWith("Unsetting previous values ..."); - expect(core.debug).toHaveBeenCalledWith("Unsetting TEST_SECRET"); + expect(core.info).toHaveBeenCalledWith("Unsetting previous values ..."); + expect(core.info).toHaveBeenCalledWith("Unsetting TEST_SECRET"); expect(core.exportVariable).toHaveBeenCalledWith("TEST_SECRET", ""); }); }); diff --git a/src/utils.ts b/src/utils.ts index 8eb2252..0a338eb 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -32,14 +32,14 @@ export const validateAuth = (): void => { process.env[envConnectHost] = `http://${process.env[envConnectHost]}`; } - core.debug(`Authenticated with ${authType}.`); + core.info(`Authenticated with ${authType}.`); }; export const extractSecret = ( envName: string, shouldExportEnv: boolean, ): void => { - core.debug(`Populating variable: ${envName}`); + core.info(`Populating variable: ${envName}`); const ref = process.env[envName]; if (!ref) { @@ -82,10 +82,10 @@ export const loadSecrets = async (shouldExportEnv: boolean): Promise => { export const unsetPrevious = (): void => { if (process.env[envManagedVariables]) { - core.debug("Unsetting previous values ..."); + core.info("Unsetting previous values ..."); const managedEnvs = process.env[envManagedVariables].split(","); for (const envName of managedEnvs) { - core.debug(`Unsetting ${envName}`); + core.info(`Unsetting ${envName}`); core.exportVariable(envName, ""); } } From 8c1801e482270f75545df50021015d660014253e Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Thu, 6 Jul 2023 10:59:01 +0100 Subject: [PATCH 35/44] use toHaveBeenCalled consistently in tests `toBeCalled` is an alias for `toHaveBeenCalled` and `toBeCalledWith` is an alias for `toHaveBeenCalledWith`. For consistency, we will use `toHaveBeenCalled` and `toHaveBeenCalledWith` consistently across our tests. --- src/utils.test.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/utils.test.ts b/src/utils.test.ts index 671ceb1..26bfa21 100644 --- a/src/utils.test.ts +++ b/src/utils.test.ts @@ -56,13 +56,15 @@ describe("validateAuth", () => { process.env[envConnectHost] = testConnectHost; process.env[envConnectToken] = testConnectToken; expect(validateAuth).not.toThrowError(authErr); - expect(core.info).toBeCalledWith("Authenticated with Connect."); + expect(core.info).toHaveBeenCalledWith("Authenticated with Connect."); }); it("should be authenticated as a service account", () => { process.env[envServiceAccountToken] = testServiceAccountToken; expect(validateAuth).not.toThrowError(authErr); - expect(core.info).toBeCalledWith("Authenticated with Service account."); + expect(core.info).toHaveBeenCalledWith( + "Authenticated with Service account.", + ); }); }); @@ -77,25 +79,28 @@ describe("extractSecret", () => { it("should set secret as step output", () => { extractSecret(envTestSecretEnv, false); - expect(core.exportVariable).not.toBeCalledWith( + expect(core.exportVariable).not.toHaveBeenCalledWith( + envTestSecretEnv, + testSecretValue, + ); + expect(core.setOutput).toHaveBeenCalledWith( envTestSecretEnv, testSecretValue, ); - expect(core.setOutput).toBeCalledWith(envTestSecretEnv, testSecretValue); - expect(core.setSecret).toBeCalledWith(testSecretValue); + expect(core.setSecret).toHaveBeenCalledWith(testSecretValue); }); it("should set secret as environment variable", () => { extractSecret(envTestSecretEnv, true); - expect(core.exportVariable).toBeCalledWith( + expect(core.exportVariable).toHaveBeenCalledWith( envTestSecretEnv, testSecretValue, ); - expect(core.setOutput).not.toBeCalledWith( + expect(core.setOutput).not.toHaveBeenCalledWith( envTestSecretEnv, testSecretValue, ); - expect(core.setSecret).toBeCalledWith(testSecretValue); + expect(core.setSecret).toHaveBeenCalledWith(testSecretValue); }); }); From 27cd56abb03b44c2c565eedae6c42a8446c6cde5 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Thu, 6 Jul 2023 11:01:02 +0100 Subject: [PATCH 36/44] Add warning if both configs are provided MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1Password CLI will prioritize Connect config (with `OP_CONNECT_HOST` and `OP_CONNECT_TOKEN`) over service account one (with `OP_SERVICE_ACCOUNT_TOKEN`). This shouldn’t happen, therefore we print a warning to the user if both are provided. --- src/utils.test.ts | 9 +++++++++ src/utils.ts | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/src/utils.test.ts b/src/utils.test.ts index 26bfa21..9c3cc3d 100644 --- a/src/utils.test.ts +++ b/src/utils.test.ts @@ -66,6 +66,15 @@ describe("validateAuth", () => { "Authenticated with Service account.", ); }); + + it("should prioritize Connect over service account if both are configured", () => { + process.env[envServiceAccountToken] = testServiceAccountToken; + process.env[envConnectHost] = testConnectHost; + process.env[envConnectToken] = testConnectToken; + expect(validateAuth).not.toThrowError(authErr); + expect(core.warning).toHaveBeenCalled(); + expect(core.info).toHaveBeenCalledWith("Authenticated with Connect."); + }); }); describe("extractSecret", () => { diff --git a/src/utils.ts b/src/utils.ts index 0a338eb..a276408 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -14,6 +14,12 @@ export const validateAuth = (): void => { const isConnect = process.env[envConnectHost] && process.env[envConnectToken]; const isServiceAccount = process.env[envServiceAccountToken]; + if (isConnect && isServiceAccount) { + core.warning( + "WARNING: Both service account and Connect credentials are provided. Connect credentials will take priority.", + ); + } + if (!isConnect && !isServiceAccount) { throw new Error(authErr); } From 2c980caffa1fb9062e8ea51dc82f36f0e0150393 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Thu, 6 Jul 2023 11:03:23 +0100 Subject: [PATCH 37/44] Add comment about cli validation process The code itself seems a bit confusing, therefore we add a comment explaining how it works. --- src/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/index.ts b/src/index.ts index 2e2cd67..bfd369b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -42,6 +42,9 @@ const loadSecretsAction = async () => { // since we refer to the 1Password CLI here. // eslint-disable-next-line @typescript-eslint/naming-convention const installCLI = async (): Promise => { + // validateCli checks if there's an existing 1Password CLI installed on the runner. + // If there's no CLI installed, then validateCli will throw an error, which we will use + // as an indicator that we need to execute the installation script. await validateCli().catch(async () => { const currentFile = url.fileURLToPath(import.meta.url); const currentDir = path.dirname(currentFile); From f34a5d1e67344316be953f4418e8d7e56967c9ed Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Thu, 6 Jul 2023 11:12:05 +0100 Subject: [PATCH 38/44] Merge `main` into `eddy/migrate-action-ts` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 10ed0757b74bbb7fb463c76e3c782b8bc88b5e6c Author: Eduard Filip Date: Wed Jul 5 16:50:31 2023 +0100 Improve the shell script (#49) * Improve CLI installation script - Add additional architectures for Linux. - Stop the action if the runner is executed in an unsupported OS. - Fetch automatically the latest stable CLI version. * Switch to new syntax for setting step output. GitHub has deprecated the syntax we were using for setting a step’s output (https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/). Therefore, we’re switching to the new one. * Stop action if arch is unsupported for Linux runners. commit 539eaa66ee81303d53bfa4253acbfcffa318c3ee Author: Eduard Filip Date: Wed Jul 5 11:36:30 2023 +0100 Improve the repo’s README (#48) Use a new template for the README file to better present the content. commit 08315da4b3cd955aa46e25c1204e0714dade8b2e Merge: d8ac5d7 0e91b4a Author: Eduard Filip Date: Mon Jul 3 16:54:07 2023 +0100 Merge pull request #44 from settlemint/main feat: install the right op for arm on linux commit 0e91b4a315e44bb5a2e399027cb61b95011eeed5 Author: roderik.eth Date: Thu May 18 21:48:54 2023 +0200 fix: arm uname commit 9c2d98ed07cde0dc7f3a69ab75072e368900dd60 Author: roderik.eth Date: Thu May 18 20:51:49 2023 +0200 feat: install the right op for arm on linux commit d8ac5d7286e7f7adf084832d3385797b5103a0fd Merge: 8fd274c 15d95ae Author: volodymyrZotov <23267003+volodymyrZotov@users.noreply.github.com> Date: Tue May 16 20:09:59 2023 +0300 Merge pull request #42 from 1Password/ruetz-service-accounts-exiting-beta Remove 'BETA' references from Service Accounts commit 15d95ae8711f00b2afc40a8af4d33cab10a4525e Author: Dustin Ruetz Date: Tue May 9 14:23:45 2023 -0400 style: auto-formatting fixes via Prettier commit a48d1fcd00314d511b5c19929ddb61e8337fdd9f Author: Dustin Ruetz Date: Tue May 9 14:21:13 2023 -0400 docs: remove 'BETA' references from Service Accounts commit 8fd274c5ebcf19317c769eb636915bb065d66a66 Merge: 663ac22 f4303b2 Author: Eduard Filip Date: Mon Apr 24 11:19:45 2023 +0200 Merge pull request #39 from 1Password/eddy/service-account-docs Add documentation related to Service Accounts (currently in beta) commit f4303b27ca64e37e2d2d8c0d26e783b4909f8a7a Author: Eddy Filip Date: Mon Apr 24 11:17:52 2023 +0200 Improve wording commit f4a99d45989a04dec415d6c1a126c7d0d030f2e3 Author: Eddy Filip Date: Thu Apr 20 20:50:59 2023 +0200 Make small edits commit 9c1afd6054a1f8333cbd926ac34ee49aebf436d6 Author: Eddy Filip Date: Thu Apr 20 18:53:49 2023 +0200 Adjust action versions used in examples In this way we keep them relevant with the latest versions commit a02ee663cc57c18a3ffd9a03730f9177a467bd87 Author: Eddy Filip Date: Thu Apr 20 18:50:07 2023 +0200 Add documentation for service accounts --- README.md | 257 +++++-------------------------------------------- install_cli.sh | 1 + 2 files changed, 25 insertions(+), 233 deletions(-) diff --git a/README.md b/README.md index 23bbb85..1caee44 100644 --- a/README.md +++ b/README.md @@ -1,107 +1,27 @@ -# Load Secrets from 1Password - GitHub Action + + -This action loads secrets from 1Password into GitHub Actions using [1Password Connect](https://1password.com/secrets/). +
+

Load Secrets from 1Password - GitHub Action

+

Provide the secrets your GitHub runner needs from 1Password.

+ + Get started + +
-Specify in your workflow YAML file which secrets from 1Password should be loaded into your job, and the action will make them available as environment variables for the next steps. - -Read more on the [1Password Developer Portal](https://developer.1password.com/docs/ci-cd/github-actions). - -## Requirements - -Before you get started, you'll need to: - -- [Deploy 1Password Connect](/docs/connect/get-started#step-2-deploy-1password-connect-server) in your infrastructure. -- Set the `OP_CONNECT_HOST` and `OP_CONNECT_TOKEN` environment variables to your Connect instance's credentials, so it'll be used to load secrets. - -_Supported runners_: You can run the action on Mac and Linux runners. Windows is currently not supported. - -## Usage - -You can configure the action to use your 1Password Connect instance. - -If you provide `OP_CONNECT_HOST` and `OP_CONNECT_TOKEN` variables, the Connect instance will be used to load secrets. Make sure [1Password Connect](https://support.1password.com/secrets-automation/#step-2-deploy-a-1password-connect-server) is deployed in your infrastructure. - -There are two ways that secrets can be loaded: - -- [use the secrets from the action's ouput](#use-secrets-from-the-actions-output) -- [export secrets as environment variables](#export-secrets-as-environment-variables) - -### Use secrets from the action's output - -This method allows for you to use the loaded secrets as an output from the step: `steps.step-id.outputs.secret-name`. You will need to set an id for the step that uses this action to be able to access its outputs. For more details, , see [`outputs.`](https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputsoutput_id). +--- -```yml -on: push -jobs: - hello-world: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Load secret - id: op-load-secret - uses: 1password/load-secrets-action@v1 - with: - export-env: false - env: - OP_CONNECT_HOST: - OP_CONNECT_TOKEN: ${{ secrets.OP_CONNECT_TOKEN }} - SECRET: op://app-cicd/hello-world/secret +`load-secrets-action` loads secrets from 1Password into GitHub Actions using [Service Accounts](https://developer.1password.com/docs/service-accounts) or [1Password Connect](https://developer.1password.com/docs/connect). - - name: Print masked secret - run: echo "Secret: ${{ steps.op-load-secret.outputs.SECRET }}" - # Prints: Secret: *** -``` - -
-Longer usage example - -```yml -on: push -name: Deploy app - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Configure 1Password Connect - uses: 1password/load-secrets-action/configure@v1 - with: - # Persist the 1Password Connect URL for next steps. You can also persist - # the Connect token using input `connect-token`, but keep in mind that - # every single step in the job would then be able to access the token. - connect-host: https://1password.acme.com - - - name: Load Docker credentials - id: load-docker-credentials - uses: 1password/load-secrets-action@v1 - with: - export-env: false - env: - OP_CONNECT_TOKEN: ${{ secrets.OP_CONNECT_TOKEN }} - DOCKERHUB_USERNAME: op://app-cicd/docker/username - DOCKERHUB_TOKEN: op://app-cicd/docker/token - - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ steps.load-docker-credentials.outputs.DOCKERHUB_USERNAME }} - password: ${{ steps.load-docker-credentials.outputs.DOCKERHUB_TOKEN }} +Specify in your workflow YAML file which secrets from 1Password should be loaded into your job, and the action will make them available as environment variables for the next steps. - - name: Build and push Docker image - uses: docker/build-push-action@v2 - with: - push: true - tags: acme/app:latest -``` +Read more on the [1Password Developer Portal](https://developer.1password.com/docs/ci-cd/github-actions). -
+## 🪄 See it in action! -### Export secrets as environment variables +[![Using 1Password Service Accounts with GitHub Actions - showcase](https://img.youtube.com/vi/kVBl5iQYgSA/maxresdefault.jpg)](https://www.youtube.com/watch?v=kVBl5iQYgSA "Using 1Password Service Accounts with GitHub Actions") -This method, allows the action to access the loaded secrets as environment variables. These environment variables are accessible at a job level. +## ✨ Quickstart ```yml on: push @@ -109,7 +29,7 @@ jobs: hello-world: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Load secret uses: 1password/load-secrets-action@v1 @@ -117,8 +37,7 @@ jobs: # Export loaded secrets as environment variables export-env: true env: - OP_CONNECT_HOST: - OP_CONNECT_TOKEN: ${{ secrets.OP_CONNECT_TOKEN }} + OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} SECRET: op://app-cicd/hello-world/secret - name: Print masked secret @@ -126,144 +45,16 @@ jobs: # Prints: Secret: *** ``` -
-Longer usage example - -```yml -on: push -name: Deploy app - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Configure 1Password Connect - uses: 1password/load-secrets-action/configure@v1 - with: - # Persist the 1Password Connect URL for next steps. You can also persist - # the Connect token using input `connect-token`, but keep in mind that - # every single step in the job would then be able to access the token. - connect-host: https://1password.acme.com - - - name: Load Docker credentials - uses: 1password/load-secrets-action@v1 - with: - # Export loaded secrets as environment variables - export-env: true - env: - OP_CONNECT_TOKEN: ${{ secrets.OP_CONNECT_TOKEN }} - DOCKERHUB_USERNAME: op://app-cicd/docker/username - DOCKERHUB_TOKEN: op://app-cicd/docker/token - - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ env.DOCKERHUB_USERNAME }} - password: ${{ env.DOCKERHUB_TOKEN }} - - - name: Print environment variables with masked secrets - run: printenv - - - name: Build and push Docker image - uses: docker/build-push-action@v2 - with: - push: true - tags: acme/app:latest - - - name: Load AWS credentials - uses: 1password/load-secrets-action@v1 - with: - # Export loaded secrets as environment variables - export-env: true - # Remove local copies of the Docker credentials, which are not needed anymore - unset-previous: true - env: - OP_CONNECT_TOKEN: ${{ secrets.OP_CONNECT_TOKEN }} - AWS_ACCESS_KEY_ID: op://app-cicd/aws/access-key-id - AWS_SECRET_ACCESS_KEY: op://app-cicd/aws/secret-access-key - - - name: Deploy app - # This script expects AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to be set, which was - # done automatically by the step above - run: ./deploy.sh -``` - -
- -## Action Inputs - -| Name | Default | Description | -| ---------------- | ------- | ---------------------------------------------------------------------------------- | -| `export-env` | `true` | Export the loaded secrets as environment variables | -| `unset-previous` | `false` | Whether to unset environment variables populated by 1Password in earlier job steps | - -## Secrets Reference Syntax - -To specify which secret should be loaded into which environment variable, the action will look for `op://` reference URIs in environment variables, and replace those with the actual secret values. - -These reference URIs have the following syntax: +## 💙 Community & Support -> `op:///[/
]/` +- File an [issue](https://github.com/1Password/load-secrets-action/issues) for bugs and feature requests. +- Join the [Developer Slack workspace](https://join.slack.com/t/1password-devs/shared_invite/zt-1halo11ps-6o9pEv96xZ3LtX_VE0fJQA). +- Subscribe to the [Developer Newsletter](https://1password.com/dev-subscribe/). -So for example, the reference URI `op://app-cicd/aws/secret-access-key` would be interpreted as: - -- **Vault:** `app-cicd` -- **Item:** `aws` -- **Section:** default section -- **Field:** `secret-access-key` - -## Masking - -Similar to regular GitHub repository secrets, fields from 1Password will automatically be masked from the GitHub Actions logs too. -So if one of these values accidentally gets printed, it'll get replaced with `***`. - -## 1Password Configuration - -To use the action with Connect, you need to have a [1Password Connect](https://support.1password.com/secrets-automation/#step-1-set-up-a-secrets-automation-workflow) instance deployed somewhere. -To configure the action with your Connect host and token, set the `OP_CONNECT_HOST` and `OP_CONNECT_TOKEN` environment variables. - -If you're using the `load-secrets` action more than once in a single job, you can use the `configure` action to avoid duplicate configuration: - -```yml -on: push -jobs: - hello-world: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Configure 1Password Connect - uses: 1password/load-secrets-action/configure@v1 - with: - connect-host: - connect-token: ${{ secrets.OP_CONNECT_TOKEN }} - - name: Load secret - uses: 1password/load-secrets-action@v1 - env: - SECRET: op://app-cicd/hello-world/secret -``` - -### `configure` Action Inputs - -| Name | Environment variable | Description | -| --------------- | -------------------- | -------------------------------------------------------- | -| `connect-host` | `OP_CONNECT_HOST` | Your 1Password Connect instance URL | -| `connect-token` | `OP_CONNECT_TOKEN` | Token to authenticate to your 1Password Connect instance | - -## Supported Runners - -You can run the action on Linux and macOS runners. Windows is currently not supported. - -## Security +## 🔐 Security 1Password requests you practice responsible disclosure if you discover a vulnerability. Please file requests via [**BugCrowd**](https://bugcrowd.com/agilebits). -For information about security practices, please visit our [Security homepage](https://bugcrowd.com/agilebits). - -## Getting help - -If you find yourself stuck, visit our [**Support Page**](https://support.1password.com/) for help. +For information about security practices, please visit the [1Password Bug Bounty Program](https://bugcrowd.com/agilebits). diff --git a/install_cli.sh b/install_cli.sh index 2230b91..b593c61 100755 --- a/install_cli.sh +++ b/install_cli.sh @@ -15,6 +15,7 @@ install_op_cli() { CLI_VERSION="v$(curl https://app-updates.agilebits.com/check/1/0/CLI2/en/2.0.0/N -s | jq -r .version)" if [[ "$OSTYPE" == "linux-gnu"* ]]; then + # Get runner's architecture ARCH=$(uname -m) if [[ "$(getconf LONG_BIT)" = 32 ]]; then ARCH="386" From 22a24ec340b8a67eede5f44b2f2ceea53dced29c Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Thu, 6 Jul 2023 12:27:09 +0100 Subject: [PATCH 39/44] Build index.js --- dist/index.js | 68 ++++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/dist/index.js b/dist/index.js index b54bdf4..029f4e4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4,7 +4,7 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; /***/ 91: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var Pt=Object.create;var Y=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var jt=Object.getOwnPropertyNames;var Ut=Object.getPrototypeOf,Vt=Object.prototype.hasOwnProperty;var Mt=(t,e,r)=>e in t?Y(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),qt=(t,e)=>{for(var r in e)Y(t,r,{get:e[r],enumerable:!0})},xe=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of jt(e))!Vt.call(t,n)&&n!==r&&Y(t,n,{get:()=>e[n],enumerable:!(s=Gt(e,n))||s.enumerable});return t};var W=(t,e,r)=>(r=t!=null?Pt(Ut(t)):{},xe(e||!t||!t.__esModule?Y(r,"default",{value:t,enumerable:!0}):r,t)),Xt=t=>xe(Y({},"__esModule",{value:!0}),t);var oe=(t,e,r)=>(Mt(t,typeof e!="symbol"?e+"":e,r),r);var K=m((Fs,Te)=>{var Bt=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Te.exports=Bt});var ee=m((bs,Ne)=>{var Ht="2.0.0",Yt=Number.MAX_SAFE_INTEGER||9007199254740991,Wt=16;Ne.exports={SEMVER_SPEC_VERSION:Ht,MAX_LENGTH:256,MAX_SAFE_INTEGER:Yt,MAX_SAFE_COMPONENT_LENGTH:Wt}});var j=m((C,Oe)=>{var{MAX_SAFE_COMPONENT_LENGTH:le}=ee(),Kt=K();C=Oe.exports={};var zt=C.re=[],l=C.src=[],u=C.t={},Jt=0,p=(t,e,r)=>{let s=Jt++;Kt(t,s,e),u[t]=s,l[s]=e,zt[s]=new RegExp(e,r?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*");p("NUMERICIDENTIFIERLOOSE","[0-9]+");p("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*");p("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`);p("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`);p("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`);p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`);p("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`);p("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`);p("BUILDIDENTIFIER","[0-9A-Za-z-]+");p("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`);p("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`);p("FULL",`^${l[u.FULLPLAIN]}$`);p("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`);p("LOOSE",`^${l[u.LOOSEPLAIN]}$`);p("GTLT","((?:<|>)?=?)");p("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);p("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`);p("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`);p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`);p("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`);p("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`);p("COERCE",`(^|[^\\d])(\\d{1,${le}})(?:\\.(\\d{1,${le}}))?(?:\\.(\\d{1,${le}}))?(?:$|[^\\d])`);p("COERCERTL",l[u.COERCE],!0);p("LONETILDE","(?:~>?)");p("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0);C.tildeTrimReplace="$1~";p("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`);p("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`);p("LONECARET","(?:\\^)");p("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0);C.caretTrimReplace="$1^";p("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`);p("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`);p("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`);p("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`);p("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0);C.comparatorTrimReplace="$1$2$3";p("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`);p("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`);p("STAR","(<|>)?=?\\s*\\*");p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var z=m((Ls,Se)=>{var Zt=["includePrerelease","loose","rtl"],kt=t=>t?typeof t!="object"?{loose:!0}:Zt.filter(e=>t[e]).reduce((e,r)=>(e[r]=!0,e),{}):{};Se.exports=kt});var be=m((Ds,Fe)=>{var $e=/^[0-9]+$/,Ce=(t,e)=>{let r=$e.test(t),s=$e.test(e);return r&&s&&(t=+t,e=+e),t===e?0:r&&!s?-1:s&&!r?1:tCe(e,t);Fe.exports={compareIdentifiers:Ce,rcompareIdentifiers:Qt}});var V=m((ws,_e)=>{var te=K(),{MAX_LENGTH:Le,MAX_SAFE_INTEGER:re}=ee(),{re:De,t:we}=j(),er=z(),{compareIdentifiers:U}=be(),T=class{constructor(e,r){if(r=er(r),e instanceof T){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>Le)throw new TypeError(`version is longer than ${Le} characters`);te("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let s=e.trim().match(r.loose?De[we.LOOSE]:De[we.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>re||this.major<0)throw new TypeError("Invalid major version");if(this.minor>re||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>re||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);s===-1&&this.prerelease.push(0)}r&&(U(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=[r,0]):this.prerelease=[r,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}};_e.exports=T});var Ve=m((_s,Ue)=>{var{MAX_LENGTH:tr}=ee(),{re:Pe,t:Ge}=j(),je=V(),rr=z(),sr=(t,e)=>{if(e=rr(e),t instanceof je)return t;if(typeof t!="string"||t.length>tr||!(e.loose?Pe[Ge.LOOSE]:Pe[Ge.FULL]).test(t))return null;try{return new je(t,e)}catch{return null}};Ue.exports=sr});var ue=m((Ps,Me)=>{var nr=V(),ir=Ve(),{re:se,t:ne}=j(),ar=(t,e)=>{if(t instanceof nr)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(se[ne.COERCE]);else{let s;for(;(s=se[ne.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||s.index+s[0].length!==r.index+r[0].length)&&(r=s),se[ne.COERCERTL].lastIndex=s.index+s[1].length+s[2].length;se[ne.COERCERTL].lastIndex=-1}return r===null?null:ir(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,e)};Me.exports=ar});var Xe=m((Gs,qe)=>{"use strict";qe.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var He=m((js,Be)=>{"use strict";Be.exports=f;f.Node=L;f.create=f;function f(t){var e=this;if(e instanceof f||(e=new f),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(n){e.push(n)});else if(arguments.length>0)for(var r=0,s=arguments.length;r1)r=e;else if(this.head)s=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;s!==null;n++)r=t(r,s.value,n),s=s.next;return r};f.prototype.reduceReverse=function(t,e){var r,s=this.tail;if(arguments.length>1)r=e;else if(this.tail)s=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=this.length-1;s!==null;n--)r=t(r,s.value,n),s=s.prev;return r};f.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};f.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};f.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new f;if(ethis.length&&(e=this.length);for(var s=0,n=this.head;n!==null&&sthis.length&&(e=this.length);for(var s=this.length,n=this.tail;n!==null&&s>e;s--)n=n.prev;for(;n!==null&&s>t;s--,n=n.prev)r.push(n.value);return r};f.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var s=0,n=this.head;n!==null&&s{"use strict";var cr=He(),D=Symbol("max"),S=Symbol("length"),M=Symbol("lengthCalculator"),Z=Symbol("allowStale"),w=Symbol("maxAge"),O=Symbol("dispose"),Ye=Symbol("noDisposeOnSet"),I=Symbol("lruList"),N=Symbol("cache"),Ke=Symbol("updateAgeOnGet"),ce=()=>1,he=class{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");let r=this[D]=e.max||1/0,s=e.length||ce;if(this[M]=typeof s!="function"?ce:s,this[Z]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[w]=e.maxAge||0,this[O]=e.dispose,this[Ye]=e.noDisposeOnSet||!1,this[Ke]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[D]=e||1/0,J(this)}get max(){return this[D]}set allowStale(e){this[Z]=!!e}get allowStale(){return this[Z]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[w]=e,J(this)}get maxAge(){return this[w]}set lengthCalculator(e){typeof e!="function"&&(e=ce),e!==this[M]&&(this[M]=e,this[S]=0,this[I].forEach(r=>{r.length=this[M](r.value,r.key),this[S]+=r.length})),J(this)}get lengthCalculator(){return this[M]}get length(){return this[S]}get itemCount(){return this[I].length}rforEach(e,r){r=r||this;for(let s=this[I].tail;s!==null;){let n=s.prev;We(this,e,s,r),s=n}}forEach(e,r){r=r||this;for(let s=this[I].head;s!==null;){let n=s.next;We(this,e,s,r),s=n}}keys(){return this[I].toArray().map(e=>e.key)}values(){return this[I].toArray().map(e=>e.value)}reset(){this[O]&&this[I]&&this[I].length&&this[I].forEach(e=>this[O](e.key,e.value)),this[N]=new Map,this[I]=new cr,this[S]=0}dump(){return this[I].map(e=>ie(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[I]}set(e,r,s){if(s=s||this[w],s&&typeof s!="number")throw new TypeError("maxAge must be a number");let n=s?Date.now():0,i=this[M](r,e);if(this[N].has(e)){if(i>this[D])return q(this,this[N].get(e)),!1;let g=this[N].get(e).value;return this[O]&&(this[Ye]||this[O](e,g.value)),g.now=n,g.maxAge=s,g.value=r,this[S]+=i-g.length,g.length=i,this.get(e),J(this),!0}let a=new pe(e,r,i,n,s);return a.length>this[D]?(this[O]&&this[O](e,r),!1):(this[S]+=a.length,this[I].unshift(a),this[N].set(e,this[I].head),J(this),!0)}has(e){if(!this[N].has(e))return!1;let r=this[N].get(e).value;return!ie(this,r)}get(e){return ge(this,e,!0)}peek(e){return ge(this,e,!1)}pop(){let e=this[I].tail;return e?(q(this,e),e.value):null}del(e){q(this,this[N].get(e))}load(e){this.reset();let r=Date.now();for(let s=e.length-1;s>=0;s--){let n=e[s],i=n.e||0;if(i===0)this.set(n.k,n.v);else{let a=i-r;a>0&&this.set(n.k,n.v,a)}}}prune(){this[N].forEach((e,r)=>ge(this,r,!1))}},ge=(t,e,r)=>{let s=t[N].get(e);if(s){let n=s.value;if(ie(t,n)){if(q(t,s),!t[Z])return}else r&&(t[Ke]&&(s.value.now=Date.now()),t[I].unshiftNode(s));return n.value}},ie=(t,e)=>{if(!e||!e.maxAge&&!t[w])return!1;let r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[w]&&r>t[w]},J=t=>{if(t[S]>t[D])for(let e=t[I].tail;t[S]>t[D]&&e!==null;){let r=e.prev;q(t,e),e=r}},q=(t,e)=>{if(e){let r=e.value;t[O]&&t[O](r.key,r.value),t[S]-=r.length,t[N].delete(r.key),t[I].removeNode(e)}},pe=class{constructor(e,r,s,n,i){this.key=e,this.value=r,this.length=s,this.now=n,this.maxAge=i||0}},We=(t,e,r,s)=>{let n=r.value;ie(t,n)&&(q(t,r),t[Z]||(n=void 0)),n&&e.call(s,n.value,n.key,t)};ze.exports=he});var _=m((Vs,ke)=>{var Ze=V(),gr=(t,e,r)=>new Ze(t,r).compare(new Ze(e,r));ke.exports=gr});var et=m((Ms,Qe)=>{var hr=_(),pr=(t,e,r)=>hr(t,e,r)===0;Qe.exports=pr});var rt=m((qs,tt)=>{var fr=_(),dr=(t,e,r)=>fr(t,e,r)!==0;tt.exports=dr});var nt=m((Xs,st)=>{var Er=_(),mr=(t,e,r)=>Er(t,e,r)>0;st.exports=mr});var at=m((Bs,it)=>{var vr=_(),Ir=(t,e,r)=>vr(t,e,r)>=0;it.exports=Ir});var lt=m((Hs,ot)=>{var Rr=_(),Ar=(t,e,r)=>Rr(t,e,r)<0;ot.exports=Ar});var ct=m((Ys,ut)=>{var yr=_(),xr=(t,e,r)=>yr(t,e,r)<=0;ut.exports=xr});var ht=m((Ws,gt)=>{var Tr=et(),Nr=rt(),Or=nt(),Sr=at(),$r=lt(),Cr=ct(),Fr=(t,e,r,s)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return Tr(t,r,s);case"!=":return Nr(t,r,s);case">":return Or(t,r,s);case">=":return Sr(t,r,s);case"<":return $r(t,r,s);case"<=":return Cr(t,r,s);default:throw new TypeError(`Invalid operator: ${e}`)}};gt.exports=Fr});var vt=m((Ks,mt)=>{var k=Symbol("SemVer ANY"),X=class{static get ANY(){return k}constructor(e,r){if(r=br(r),e instanceof X){if(e.loose===!!r.loose)return e;e=e.value}de("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===k?this.value="":this.value=this.operator+this.semver.version,de("comp",this)}parse(e){let r=this.options.loose?pt[ft.COMPARATORLOOSE]:pt[ft.COMPARATOR],s=e.match(r);if(!s)throw new TypeError(`Invalid comparator: ${e}`);this.operator=s[1]!==void 0?s[1]:"",this.operator==="="&&(this.operator=""),s[2]?this.semver=new dt(s[2],this.options.loose):this.semver=k}toString(){return this.value}test(e){if(de("Comparator.test",e,this.options.loose),this.semver===k||e===k)return!0;if(typeof e=="string")try{e=new dt(e,this.options)}catch{return!1}return fe(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof X))throw new TypeError("a Comparator is required");if((!r||typeof r!="object")&&(r={loose:!!r,includePrerelease:!1}),this.operator==="")return this.value===""?!0:new Et(e.value,r).test(this.value);if(e.operator==="")return e.value===""?!0:new Et(this.value,r).test(e.semver);let s=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">"),n=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<"),i=this.semver.version===e.semver.version,a=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<="),h=fe(this.semver,"<",e.semver,r)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),g=fe(this.semver,">",e.semver,r)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return s||n||i&&a||h||g}};mt.exports=X;var br=z(),{re:pt,t:ft}=j(),fe=ht(),de=K(),dt=V(),Et=Ee()});var Ee=m((zs,yt)=>{var P=class{constructor(e,r){if(r=Dr(r),e instanceof P)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new P(e.raw,r);if(e instanceof me)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e,this.set=e.split("||").map(s=>this.parseRange(s.trim())).filter(s=>s.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);if(this.set.length>1){let s=this.set[0];if(this.set=this.set.filter(n=>!Rt(n[0])),this.set.length===0)this.set=[s];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&jr(n[0])){this.set=[n];break}}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();let s=`parseRange:${Object.keys(this.options).join(",")}:${e}`,n=It.get(s);if(n)return n;let i=this.options.loose,a=i?y[R.HYPHENRANGELOOSE]:y[R.HYPHENRANGE];e=e.replace(a,Kr(this.options.includePrerelease)),v("hyphen replace",e),e=e.replace(y[R.COMPARATORTRIM],_r),v("comparator trim",e),e=e.replace(y[R.TILDETRIM],Pr),e=e.replace(y[R.CARETTRIM],Gr),e=e.split(/\s+/).join(" ");let h=e.split(" ").map(E=>Ur(E,this.options)).join(" ").split(/\s+/).map(E=>Wr(E,this.options));i&&(h=h.filter(E=>(v("loose invalid filter",E,this.options),!!E.match(y[R.COMPARATORLOOSE])))),v("range list",h);let g=new Map,c=h.map(E=>new me(E,this.options));for(let E of c){if(Rt(E))return[E];g.set(E.value,E)}g.size>1&&g.has("")&&g.delete("");let d=[...g.values()];return It.set(s,d),d}intersects(e,r){if(!(e instanceof P))throw new TypeError("a Range is required");return this.set.some(s=>At(s,r)&&e.set.some(n=>At(n,r)&&s.every(i=>n.every(a=>i.intersects(a,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new wr(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0",jr=t=>t.value==="",At=(t,e)=>{let r=!0,s=t.slice(),n=s.pop();for(;r&&s.length;)r=s.every(i=>n.intersects(i,e)),n=s.pop();return r},Ur=(t,e)=>(v("comp",t,e),t=qr(t,e),v("caret",t),t=Vr(t,e),v("tildes",t),t=Br(t,e),v("xrange",t),t=Yr(t,e),v("stars",t),t),A=t=>!t||t.toLowerCase()==="x"||t==="*",Vr=(t,e)=>t.trim().split(/\s+/).map(r=>Mr(r,e)).join(" "),Mr=(t,e)=>{let r=e.loose?y[R.TILDELOOSE]:y[R.TILDE];return t.replace(r,(s,n,i,a,h)=>{v("tilde",t,s,n,i,a,h);let g;return A(n)?g="":A(i)?g=`>=${n}.0.0 <${+n+1}.0.0-0`:A(a)?g=`>=${n}.${i}.0 <${n}.${+i+1}.0-0`:h?(v("replaceTilde pr",h),g=`>=${n}.${i}.${a}-${h} <${n}.${+i+1}.0-0`):g=`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`,v("tilde return",g),g})},qr=(t,e)=>t.trim().split(/\s+/).map(r=>Xr(r,e)).join(" "),Xr=(t,e)=>{v("caret",t,e);let r=e.loose?y[R.CARETLOOSE]:y[R.CARET],s=e.includePrerelease?"-0":"";return t.replace(r,(n,i,a,h,g)=>{v("caret",t,n,i,a,h,g);let c;return A(i)?c="":A(a)?c=`>=${i}.0.0${s} <${+i+1}.0.0-0`:A(h)?i==="0"?c=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`:c=`>=${i}.${a}.0${s} <${+i+1}.0.0-0`:g?(v("replaceCaret pr",g),i==="0"?a==="0"?c=`>=${i}.${a}.${h}-${g} <${i}.${a}.${+h+1}-0`:c=`>=${i}.${a}.${h}-${g} <${i}.${+a+1}.0-0`:c=`>=${i}.${a}.${h}-${g} <${+i+1}.0.0-0`):(v("no pr"),i==="0"?a==="0"?c=`>=${i}.${a}.${h}${s} <${i}.${a}.${+h+1}-0`:c=`>=${i}.${a}.${h}${s} <${i}.${+a+1}.0-0`:c=`>=${i}.${a}.${h} <${+i+1}.0.0-0`),v("caret return",c),c})},Br=(t,e)=>(v("replaceXRanges",t,e),t.split(/\s+/).map(r=>Hr(r,e)).join(" ")),Hr=(t,e)=>{t=t.trim();let r=e.loose?y[R.XRANGELOOSE]:y[R.XRANGE];return t.replace(r,(s,n,i,a,h,g)=>{v("xRange",t,s,n,i,a,h,g);let c=A(i),d=c||A(a),E=d||A(h),$=E;return n==="="&&$&&(n=""),g=e.includePrerelease?"-0":"",c?n===">"||n==="<"?s="<0.0.0-0":s="*":n&&$?(d&&(a=0),h=0,n===">"?(n=">=",d?(i=+i+1,a=0,h=0):(a=+a+1,h=0)):n==="<="&&(n="<",d?i=+i+1:a=+a+1),n==="<"&&(g="-0"),s=`${n+i}.${a}.${h}${g}`):d?s=`>=${i}.0.0${g} <${+i+1}.0.0-0`:E&&(s=`>=${i}.${a}.0${g} <${i}.${+a+1}.0-0`),v("xRange return",s),s})},Yr=(t,e)=>(v("replaceStars",t,e),t.trim().replace(y[R.STAR],"")),Wr=(t,e)=>(v("replaceGTE0",t,e),t.trim().replace(y[e.includePrerelease?R.GTE0PRE:R.GTE0],"")),Kr=t=>(e,r,s,n,i,a,h,g,c,d,E,$,H)=>(A(s)?r="":A(n)?r=`>=${s}.0.0${t?"-0":""}`:A(i)?r=`>=${s}.${n}.0${t?"-0":""}`:a?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,A(c)?g="":A(d)?g=`<${+c+1}.0.0-0`:A(E)?g=`<${c}.${+d+1}.0-0`:$?g=`<=${c}.${d}.${E}-${$}`:t?g=`<${c}.${d}.${+E+1}-0`:g=`<=${g}`,`${r} ${g}`.trim()),zr=(t,e,r)=>{for(let s=0;s0){let n=t[s].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0}});var ve=m((Js,xt)=>{var Jr=Ee(),Zr=(t,e,r)=>{try{e=new Jr(e,r)}catch{return!1}return e.test(t)};xt.exports=Zr});var Ct=m(x=>{"use strict";var kr=x&&x.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),Qr=x&&x.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Ot=x&&x.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&kr(e,t,r);return Qr(e,t),e},St=x&&x.__awaiter||function(t,e,r,s){function n(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function h(d){try{c(s.next(d))}catch(E){a(E)}}function g(d){try{c(s.throw(d))}catch(E){a(E)}}function c(d){d.done?i(d.value):n(d.value).then(h,g)}c((s=s.apply(t,e||[])).next())})},$t=x&&x.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},s,n,i,a;return a={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function h(c){return function(d){return g([c,d])}}function g(c){if(s)throw new TypeError("Generator is already executing.");for(;r;)try{if(s=1,n&&(i=c[0]&2?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]F,ExecutionError:()=>G,ValidationError:()=>B,account:()=>Is,connect:()=>xs,document:()=>As,eventsApi:()=>ys,group:()=>Ss,inject:()=>ms,item:()=>Ts,read:()=>vs,setClientInfo:()=>ps,setGlobalFlags:()=>fs,user:()=>Os,validateCli:()=>ds,vault:()=>Ns,version:()=>Es,whoami:()=>Rs});module.exports=Xt($s);var Dt=W(ue()),wt=W(ve());var bt=__nccwpck_require__(81),Lt=W(Ct()),Ie=W(ue()),Re=W(ve());var Ft="0.1.8";var B=class extends Error{constructor(r,s,n){let i;switch(r){case"not-found":i="Could not find `op` executable";break;case"version":i=`CLI version ${n} does not satisfy required version ${s}`;break}super(i);this.type=r;this.requiredVersion=s;this.currentVersion=n;this.name="ValidationError"}},G=class extends Error{constructor(r,s){super(r);this.status=s;this.name="ExecutionError"}},Ae=class extends G{constructor(r,s){let n=r.match(Ae.errorRegex),i,a;n?(i=n[2],a=new Date(n[1])):i="Unknown error";super(i,s);this.originalMessage=r;this.name="CLIError",this.timestamp=a}timestamp},F=Ae;oe(F,"errorRegex",/\[ERROR] (\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}) (.+)/);var as=t=>t.split(".").map(e=>e.padStart(2,"0")).join(""),os=t=>t.replace(/([A-Za-z])(?=[A-Z])/g,"$1-").toLowerCase(),b=t=>t.replace(/(["$'\\`])/g,"\\$1"),ls=(t,e)=>t.length===e.length&&t.every((r,s)=>r===e[s]),us=t=>{if(typeof t=="string")return`=${b(t)}`;if(Array.isArray(t))return`=${t.join(",")}`;if(typeof t=="object"){let e="";if("label"in t&&(e+=(t.label||[]).map(r=>`label=${r}`).join(",")),"type"in t&&(e+=(t.type||[]).map(r=>`type=${r}`).join(",")),e.length>0)return`=${b(e)}`}return""},cs=t=>Object.entries(t).filter(([e,r])=>Boolean(r)).map(([e,r])=>`--${os(b(e))}${us(r)}`),gs=([t,e,r])=>`${b(t)}[${b(e)}]=${b(r)}`,hs={name:"1Password for JavaScript",id:"JS",build:as(Ft)},ye=class{clientInfo=hs;globalFlags={};setClientInfo(e){this.clientInfo=e}getVersion(){return this.execute([],{flags:{version:!0},json:!1})}async validate(e=ye.recommendedVersion){if(!!!await(0,Lt.lookpath)("op"))throw new B("not-found");let s=this.getVersion(),n=(0,Ie.default)(s);if(!(0,Re.default)(n,e))throw new B("version",e,s)}createParts(e,r,s,n){let i=e.map(a=>b(a));for(let a of r)if(typeof a=="string")i.push(b(a));else if(Array.isArray(a))i.push(gs(a));else throw new TypeError("Invalid argument");if(n&&(s={...s,format:"json"}),ls(e,["inject"])){let a=(0,Ie.default)(o.getVersion());if((0,Re.default)(a,">=2.6.2")){if(process.platform==="win32")throw new G("Inject is not supported on Windows for version >=2.6.2 of the CLI",1);s={...s,inFile:"/dev/stdin"}}}return[...i,...cs({...this.globalFlags,...s})]}execute(e,{args:r=[],flags:s={},stdin:n,json:i=!0}={}){let a,h=this.createParts(e,r,s,i);n&&(a=Buffer.from(typeof n=="string"?n:JSON.stringify(n)));let{status:g,error:c,stdout:d,stderr:E}=(0,bt.spawnSync)("op",h,{stdio:"pipe",input:a,env:{...process.env,OP_INTEGRATION_NAME:this.clientInfo.name,OP_INTEGRATION_ID:this.clientInfo.id,OP_INTEGRATION_BUILDNUMBER:this.clientInfo.build}});if(c)throw new G(c.message,g);let $=E.toString();if($.length>0)throw new F($,g);let H=d.toString().trim();if(H.length!==0){if(!i)return H;try{return JSON.parse(H)}catch(_t){throw console.log(H),_t}}}},ae=ye;oe(ae,"recommendedVersion",">=2.4.0");var o=new ae;var ps=t=>o.setClientInfo(t),fs=t=>{o.globalFlags=t},ds=async t=>await o.validate(t),Es=()=>o.getVersion(),ms={data:(t,e={})=>o.execute(["inject"],{flags:e,json:!1,stdin:t}),toFile:(t,e,r={})=>o.execute(["inject"],{flags:{outFile:e,...r},json:!1,stdin:t})},vs={parse:(t,e={})=>o.execute(["read"],{args:[t],flags:e,json:!1}),toFile:(t,e,r={})=>o.execute(["read"],{args:[t],flags:{outFile:e,...r},json:!1})},Is={forget:(t,e={})=>o.execute(["account","forget"],{args:[t],flags:e,json:!1}),get:(t={})=>o.execute(["account","get"],{flags:t}),list:(t={})=>o.execute(["account","list"],{flags:t})},Rs=()=>{try{return o.execute(["whoami"])}catch(t){if(t instanceof F&&t.message.includes("signed in"))return null;throw t}},As={create:(t,e={},r=!1)=>o.execute(["document","create"],{args:[r?t:""],flags:e,stdin:r?void 0:t}),delete:(t,e={})=>o.execute(["document","delete"],{args:[t],flags:e}),edit:(t,e,r={},s=!1)=>o.execute(["document","edit"],{args:[t,s?e:""],flags:r,stdin:s?void 0:e}),get:(t,e={})=>o.execute(["document","get"],{args:[t],flags:e,json:!1}),toFile:(t,e,r={})=>o.execute(["document","get"],{args:[t],flags:{output:e,...r},json:!1}),list:(t={})=>o.execute(["document","list"],{flags:t})},ys={create:(t,e={})=>o.execute(["events-api","create"],{args:[t],flags:e,json:!1})},xs={group:{grant:(t,e={})=>o.execute(["connect","group","grant"],{flags:{group:t,...e},json:!1}),revoke:(t,e={})=>o.execute(["connect","group","revoke"],{flags:{group:t,...e},json:!1})},server:{create:(t,e={})=>o.execute(["connect","server","create"],{args:[t],flags:e,json:!1}),delete:(t,e={})=>o.execute(["connect","server","delete"],{args:[t],flags:e}),edit:(t,e,r={})=>o.execute(["connect","server","edit"],{args:[t],flags:{name:e,...r},json:!1}),get:(t,e={})=>o.execute(["connect","server","get"],{args:[t],flags:e}),list:(t={})=>o.execute(["connect","server","list"],{flags:t})},token:{create:(t,e,r={})=>o.execute(["connect","token","create"],{args:[t],flags:{server:e,...r},json:!1}),delete:(t,e={})=>o.execute(["connect","token","delete"],{args:[t],flags:e,json:!1}),edit:(t,e,r={})=>o.execute(["connect","token","edit"],{args:[t],flags:{name:e,...r},json:!1}),list:(t={})=>o.execute(["connect","token","list"],{flags:t})},vault:{grant:(t,e,r={})=>o.execute(["connect","vault","grant"],{flags:{server:t,vault:e,...r},json:!1}),revoke:(t,e,r={})=>o.execute(["connect","vault","revoke"],{flags:{server:t,vault:e,...r},json:!1})}},Ts={create:(t,e={})=>{let r={flags:e},s=(0,Dt.default)(o.getVersion());return(0,wt.default)(s,">=2.6.2")?r.args=t:r.stdin={fields:t.map(([n,i,a,h])=>{let g={label:n,type:i,value:a};return h&&Object.assign(g,{purpose:h}),g})},o.execute(["item","create"],r)},delete:(t,e={})=>o.execute(["item","delete"],{args:[t],flags:e,json:!1}),edit:(t,e,r={})=>o.execute(["item","edit"],{args:[t,...e],flags:r}),get:(t,e={})=>o.execute(["item","get"],{args:[t],flags:e}),otp:(t,e={})=>o.execute(["item","get"],{args:[t],flags:{otp:!0,...e},json:!1}),shareLink:(t,e={})=>o.execute(["item","get"],{args:[t],flags:{shareLink:!0,...e},json:!1}),list:(t={})=>o.execute(["item","list"],{flags:t}),share:(t,e={})=>o.execute(["item","share"],{args:[t],flags:e,json:!1}),template:{get:(t,e={})=>o.execute(["item","template","get"],{args:[t],flags:e}),list:(t={})=>o.execute(["item","template","list"],{flags:t})}},Ns={create:(t,e={})=>o.execute(["vault","create"],{args:[t],flags:e}),delete:(t,e={})=>o.execute(["vault","delete"],{args:[t],flags:e,json:!1}),edit:(t,e={})=>o.execute(["vault","edit"],{args:[t],flags:e,json:!1}),get:(t,e={})=>o.execute(["vault","get"],{args:[t],flags:e}),list:(t={})=>o.execute(["vault","list"],{flags:t}),group:{grant:(t={})=>o.execute(["vault","group","grant"],{flags:{noInput:!0,...t}}),revoke:(t={})=>o.execute(["vault","group","revoke"],{flags:{noInput:!0,...t}}),list:(t,e={})=>o.execute(["vault","group","list"],{args:[t],flags:e})},user:{grant:(t={})=>o.execute(["vault","user","grant"],{flags:{noInput:!0,...t}}),revoke:(t={})=>o.execute(["vault","user","revoke"],{flags:{noInput:!0,...t}}),list:(t,e={})=>o.execute(["vault","user","list"],{args:[t],flags:e})}},Os={confirm:(t,e={})=>o.execute(["user","confirm"],{args:[t],flags:e,json:!1}),confirmAll:(t={})=>o.execute(["user","confirm"],{flags:{all:!0,...t},json:!1}),delete:(t,e={})=>o.execute(["user","delete"],{args:[t],flags:e,json:!1}),edit:(t,e={})=>o.execute(["user","edit"],{args:[t],flags:e,json:!1}),get:(t,e={})=>o.execute(["user","get"],{args:[t],flags:e}),me:(t={})=>o.execute(["user","get"],{flags:{me:!0,...t}}),fingerprint:(t,e={})=>o.execute(["user","get"],{args:[t],flags:{fingerprint:!0,...e},json:!1}),publicKey:(t,e={})=>o.execute(["user","get"],{args:[t],flags:{publicKey:!0,...e},json:!1}),list:(t={})=>o.execute(["user","list"],{flags:t}),provision:(t,e,r)=>o.execute(["user","provision"],{flags:{email:t,name:e,...r}}),reactivate:(t,e={})=>o.execute(["user","reactivate"],{args:[t],flags:e,json:!1}),suspend:(t,e={})=>o.execute(["user","suspend"],{args:[t],flags:e,json:!1})},Ss={create:(t,e={})=>o.execute(["group","create"],{args:[t],flags:e}),delete:(t,e={})=>o.execute(["group","delete"],{args:[t],flags:e,json:!1}),edit:(t,e={})=>o.execute(["group","edit"],{args:[t],flags:e,json:!1}),get:(t,e={})=>o.execute(["group","get"],{args:[t],flags:e}),list:(t={})=>o.execute(["group","list"],{flags:t}),user:{grant:(t={})=>o.execute(["group","user","grant"],{flags:t,json:!1}),list:(t,e={})=>o.execute(["group","user","list"],{args:[t],flags:e}),revoke:(t={})=>o.execute(["group","user","grant"],{flags:t,json:!1})}};0&&(0); +var Pt=Object.create;var H=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var jt=Object.getOwnPropertyNames;var Ut=Object.getPrototypeOf,Vt=Object.prototype.hasOwnProperty;var Mt=(t,e,r)=>e in t?H(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),qt=(t,e)=>{for(var r in e)H(t,r,{get:e[r],enumerable:!0})},Ne=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of jt(e))!Vt.call(t,n)&&n!==r&&H(t,n,{get:()=>e[n],enumerable:!(s=Gt(e,n))||s.enumerable});return t};var Y=(t,e,r)=>(r=t!=null?Pt(Ut(t)):{},Ne(e||!t||!t.__esModule?H(r,"default",{value:t,enumerable:!0}):r,t)),Xt=t=>Ne(H({},"__esModule",{value:!0}),t);var oe=(t,e,r)=>(Mt(t,typeof e!="symbol"?e+"":e,r),r);var B=m((bs,Te)=>{var Wt=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Te.exports=Wt});var Q=m((Ls,Oe)=>{var Ht="2.0.0",Yt=Number.MAX_SAFE_INTEGER||9007199254740991,Bt=16,Kt=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Oe.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Bt,MAX_SAFE_INTEGER:Yt,RELEASE_TYPES:Kt,SEMVER_SPEC_VERSION:Ht,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var K=m(($,Se)=>{var{MAX_SAFE_COMPONENT_LENGTH:le}=Q(),zt=B();$=Se.exports={};var Jt=$.re=[],l=$.src=[],u=$.t={},Zt=0,p=(t,e,r)=>{let s=Zt++;zt(t,s,e),u[t]=s,l[s]=e,Jt[s]=new RegExp(e,r?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*");p("NUMERICIDENTIFIERLOOSE","[0-9]+");p("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*");p("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`);p("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`);p("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`);p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`);p("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`);p("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`);p("BUILDIDENTIFIER","[0-9A-Za-z-]+");p("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`);p("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`);p("FULL",`^${l[u.FULLPLAIN]}$`);p("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`);p("LOOSE",`^${l[u.LOOSEPLAIN]}$`);p("GTLT","((?:<|>)?=?)");p("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);p("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`);p("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`);p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`);p("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`);p("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`);p("COERCE",`(^|[^\\d])(\\d{1,${le}})(?:\\.(\\d{1,${le}}))?(?:\\.(\\d{1,${le}}))?(?:$|[^\\d])`);p("COERCERTL",l[u.COERCE],!0);p("LONETILDE","(?:~>?)");p("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0);$.tildeTrimReplace="$1~";p("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`);p("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`);p("LONECARET","(?:\\^)");p("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0);$.caretTrimReplace="$1^";p("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`);p("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`);p("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`);p("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`);p("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0);$.comparatorTrimReplace="$1$2$3";p("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`);p("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`);p("STAR","(<|>)?=?\\s*\\*");p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var ee=m((_s,Ce)=>{var kt=Object.freeze({loose:!0}),Qt=Object.freeze({}),er=t=>t?typeof t!="object"?kt:t:Qt;Ce.exports=er});var Le=m((ws,be)=>{var $e=/^[0-9]+$/,Fe=(t,e)=>{let r=$e.test(t),s=$e.test(e);return r&&s&&(t=+t,e=+e),t===e?0:r&&!s?-1:s&&!r?1:tFe(e,t);be.exports={compareIdentifiers:Fe,rcompareIdentifiers:tr}});var U=m((Ds,Pe)=>{var te=B(),{MAX_LENGTH:_e,MAX_SAFE_INTEGER:re}=Q(),{re:we,t:De}=K(),rr=ee(),{compareIdentifiers:j}=Le(),N=class{constructor(e,r){if(r=rr(r),e instanceof N){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>_e)throw new TypeError(`version is longer than ${_e} characters`);te("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let s=e.trim().match(r.loose?we[De.LOOSE]:we[De.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>re||this.major<0)throw new TypeError("Invalid major version");if(this.minor>re||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>re||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&s===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(r){let i=[r,n];s===!1&&(i=[r]),j(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}};Pe.exports=N});var Ue=m((Ps,je)=>{var Ge=U(),sr=(t,e,r=!1)=>{if(t instanceof Ge)return t;try{return new Ge(t,e)}catch(s){if(!r)return null;throw s}};je.exports=sr});var ue=m((Gs,Ve)=>{var nr=U(),ir=Ue(),{re:se,t:ne}=K(),ar=(t,e)=>{if(t instanceof nr)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(se[ne.COERCE]);else{let s;for(;(s=se[ne.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||s.index+s[0].length!==r.index+r[0].length)&&(r=s),se[ne.COERCERTL].lastIndex=s.index+s[1].length+s[2].length;se[ne.COERCERTL].lastIndex=-1}return r===null?null:ir(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,e)};Ve.exports=ar});var qe=m((js,Me)=>{"use strict";Me.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var We=m((Us,Xe)=>{"use strict";Xe.exports=f;f.Node=L;f.create=f;function f(t){var e=this;if(e instanceof f||(e=new f),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(n){e.push(n)});else if(arguments.length>0)for(var r=0,s=arguments.length;r1)r=e;else if(this.head)s=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;s!==null;n++)r=t(r,s.value,n),s=s.next;return r};f.prototype.reduceReverse=function(t,e){var r,s=this.tail;if(arguments.length>1)r=e;else if(this.tail)s=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=this.length-1;s!==null;n--)r=t(r,s.value,n),s=s.prev;return r};f.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};f.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};f.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new f;if(ethis.length&&(e=this.length);for(var s=0,n=this.head;n!==null&&sthis.length&&(e=this.length);for(var s=this.length,n=this.tail;n!==null&&s>e;s--)n=n.prev;for(;n!==null&&s>t;s--,n=n.prev)r.push(n.value);return r};f.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var s=0,n=this.head;n!==null&&s{"use strict";var cr=We(),_=Symbol("max"),S=Symbol("length"),V=Symbol("lengthCalculator"),J=Symbol("allowStale"),w=Symbol("maxAge"),O=Symbol("dispose"),He=Symbol("noDisposeOnSet"),R=Symbol("lruList"),T=Symbol("cache"),Be=Symbol("updateAgeOnGet"),ce=()=>1,he=class{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");let r=this[_]=e.max||1/0,s=e.length||ce;if(this[V]=typeof s!="function"?ce:s,this[J]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[w]=e.maxAge||0,this[O]=e.dispose,this[He]=e.noDisposeOnSet||!1,this[Be]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[_]=e||1/0,z(this)}get max(){return this[_]}set allowStale(e){this[J]=!!e}get allowStale(){return this[J]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[w]=e,z(this)}get maxAge(){return this[w]}set lengthCalculator(e){typeof e!="function"&&(e=ce),e!==this[V]&&(this[V]=e,this[S]=0,this[R].forEach(r=>{r.length=this[V](r.value,r.key),this[S]+=r.length})),z(this)}get lengthCalculator(){return this[V]}get length(){return this[S]}get itemCount(){return this[R].length}rforEach(e,r){r=r||this;for(let s=this[R].tail;s!==null;){let n=s.prev;Ye(this,e,s,r),s=n}}forEach(e,r){r=r||this;for(let s=this[R].head;s!==null;){let n=s.next;Ye(this,e,s,r),s=n}}keys(){return this[R].toArray().map(e=>e.key)}values(){return this[R].toArray().map(e=>e.value)}reset(){this[O]&&this[R]&&this[R].length&&this[R].forEach(e=>this[O](e.key,e.value)),this[T]=new Map,this[R]=new cr,this[S]=0}dump(){return this[R].map(e=>ie(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[R]}set(e,r,s){if(s=s||this[w],s&&typeof s!="number")throw new TypeError("maxAge must be a number");let n=s?Date.now():0,i=this[V](r,e);if(this[T].has(e)){if(i>this[_])return M(this,this[T].get(e)),!1;let g=this[T].get(e).value;return this[O]&&(this[He]||this[O](e,g.value)),g.now=n,g.maxAge=s,g.value=r,this[S]+=i-g.length,g.length=i,this.get(e),z(this),!0}let a=new pe(e,r,i,n,s);return a.length>this[_]?(this[O]&&this[O](e,r),!1):(this[S]+=a.length,this[R].unshift(a),this[T].set(e,this[R].head),z(this),!0)}has(e){if(!this[T].has(e))return!1;let r=this[T].get(e).value;return!ie(this,r)}get(e){return ge(this,e,!0)}peek(e){return ge(this,e,!1)}pop(){let e=this[R].tail;return e?(M(this,e),e.value):null}del(e){M(this,this[T].get(e))}load(e){this.reset();let r=Date.now();for(let s=e.length-1;s>=0;s--){let n=e[s],i=n.e||0;if(i===0)this.set(n.k,n.v);else{let a=i-r;a>0&&this.set(n.k,n.v,a)}}}prune(){this[T].forEach((e,r)=>ge(this,r,!1))}},ge=(t,e,r)=>{let s=t[T].get(e);if(s){let n=s.value;if(ie(t,n)){if(M(t,s),!t[J])return}else r&&(t[Be]&&(s.value.now=Date.now()),t[R].unshiftNode(s));return n.value}},ie=(t,e)=>{if(!e||!e.maxAge&&!t[w])return!1;let r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[w]&&r>t[w]},z=t=>{if(t[S]>t[_])for(let e=t[R].tail;t[S]>t[_]&&e!==null;){let r=e.prev;M(t,e),e=r}},M=(t,e)=>{if(e){let r=e.value;t[O]&&t[O](r.key,r.value),t[S]-=r.length,t[T].delete(r.key),t[R].removeNode(e)}},pe=class{constructor(e,r,s,n,i){this.key=e,this.value=r,this.length=s,this.now=n,this.maxAge=i||0}},Ye=(t,e,r,s)=>{let n=r.value;ie(t,n)&&(M(t,r),t[J]||(n=void 0)),n&&e.call(s,n.value,n.key,t)};Ke.exports=he});var D=m((Ms,Ze)=>{var Je=U(),gr=(t,e,r)=>new Je(t,r).compare(new Je(e,r));Ze.exports=gr});var Qe=m((qs,ke)=>{var hr=D(),pr=(t,e,r)=>hr(t,e,r)===0;ke.exports=pr});var tt=m((Xs,et)=>{var fr=D(),dr=(t,e,r)=>fr(t,e,r)!==0;et.exports=dr});var st=m((Ws,rt)=>{var Er=D(),mr=(t,e,r)=>Er(t,e,r)>0;rt.exports=mr});var it=m((Hs,nt)=>{var vr=D(),Rr=(t,e,r)=>vr(t,e,r)>=0;nt.exports=Rr});var ot=m((Ys,at)=>{var Ir=D(),Ar=(t,e,r)=>Ir(t,e,r)<0;at.exports=Ar});var ut=m((Bs,lt)=>{var yr=D(),xr=(t,e,r)=>yr(t,e,r)<=0;lt.exports=xr});var gt=m((Ks,ct)=>{var Nr=Qe(),Tr=tt(),Or=st(),Sr=it(),Cr=ot(),$r=ut(),Fr=(t,e,r,s)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return Nr(t,r,s);case"!=":return Tr(t,r,s);case">":return Or(t,r,s);case">=":return Sr(t,r,s);case"<":return Cr(t,r,s);case"<=":return $r(t,r,s);default:throw new TypeError(`Invalid operator: ${e}`)}};ct.exports=Fr});var vt=m((zs,mt)=>{var Z=Symbol("SemVer ANY"),q=class{static get ANY(){return Z}constructor(e,r){if(r=ht(r),e instanceof q){if(e.loose===!!r.loose)return e;e=e.value}de("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Z?this.value="":this.value=this.operator+this.semver.version,de("comp",this)}parse(e){let r=this.options.loose?pt[ft.COMPARATORLOOSE]:pt[ft.COMPARATOR],s=e.match(r);if(!s)throw new TypeError(`Invalid comparator: ${e}`);this.operator=s[1]!==void 0?s[1]:"",this.operator==="="&&(this.operator=""),s[2]?this.semver=new dt(s[2],this.options.loose):this.semver=Z}toString(){return this.value}test(e){if(de("Comparator.test",e,this.options.loose),this.semver===Z||e===Z)return!0;if(typeof e=="string")try{e=new dt(e,this.options)}catch{return!1}return fe(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof q))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Et(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Et(this.value,r).test(e.semver):(r=ht(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||fe(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||fe(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};mt.exports=q;var ht=ee(),{re:pt,t:ft}=K(),fe=gt(),de=B(),dt=U(),Et=Ee()});var Ee=m((Js,yt)=>{var P=class{constructor(e,r){if(r=Lr(r),e instanceof P)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new P(e.raw,r);if(e instanceof me)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e,this.set=e.split("||").map(s=>this.parseRange(s.trim())).filter(s=>s.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);if(this.set.length>1){let s=this.set[0];if(this.set=this.set.filter(n=>!It(n[0])),this.set.length===0)this.set=[s];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&Ur(n[0])){this.set=[n];break}}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();let s=((this.options.includePrerelease&&Gr)|(this.options.loose&&jr))+":"+e,n=Rt.get(s);if(n)return n;let i=this.options.loose,a=i?y[I.HYPHENRANGELOOSE]:y[I.HYPHENRANGE];e=e.replace(a,zr(this.options.includePrerelease)),v("hyphen replace",e),e=e.replace(y[I.COMPARATORTRIM],wr),v("comparator trim",e),e=e.replace(y[I.TILDETRIM],Dr),e=e.replace(y[I.CARETTRIM],Pr),e=e.split(/\s+/).join(" ");let h=e.split(" ").map(E=>Vr(E,this.options)).join(" ").split(/\s+/).map(E=>Kr(E,this.options));i&&(h=h.filter(E=>(v("loose invalid filter",E,this.options),!!E.match(y[I.COMPARATORLOOSE])))),v("range list",h);let g=new Map,c=h.map(E=>new me(E,this.options));for(let E of c){if(It(E))return[E];g.set(E.value,E)}g.size>1&&g.has("")&&g.delete("");let d=[...g.values()];return Rt.set(s,d),d}intersects(e,r){if(!(e instanceof P))throw new TypeError("a Range is required");return this.set.some(s=>At(s,r)&&e.set.some(n=>At(n,r)&&s.every(i=>n.every(a=>i.intersects(a,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new _r(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0",Ur=t=>t.value==="",At=(t,e)=>{let r=!0,s=t.slice(),n=s.pop();for(;r&&s.length;)r=s.every(i=>n.intersects(i,e)),n=s.pop();return r},Vr=(t,e)=>(v("comp",t,e),t=Xr(t,e),v("caret",t),t=Mr(t,e),v("tildes",t),t=Hr(t,e),v("xrange",t),t=Br(t,e),v("stars",t),t),A=t=>!t||t.toLowerCase()==="x"||t==="*",Mr=(t,e)=>t.trim().split(/\s+/).map(r=>qr(r,e)).join(" "),qr=(t,e)=>{let r=e.loose?y[I.TILDELOOSE]:y[I.TILDE];return t.replace(r,(s,n,i,a,h)=>{v("tilde",t,s,n,i,a,h);let g;return A(n)?g="":A(i)?g=`>=${n}.0.0 <${+n+1}.0.0-0`:A(a)?g=`>=${n}.${i}.0 <${n}.${+i+1}.0-0`:h?(v("replaceTilde pr",h),g=`>=${n}.${i}.${a}-${h} <${n}.${+i+1}.0-0`):g=`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`,v("tilde return",g),g})},Xr=(t,e)=>t.trim().split(/\s+/).map(r=>Wr(r,e)).join(" "),Wr=(t,e)=>{v("caret",t,e);let r=e.loose?y[I.CARETLOOSE]:y[I.CARET],s=e.includePrerelease?"-0":"";return t.replace(r,(n,i,a,h,g)=>{v("caret",t,n,i,a,h,g);let c;return A(i)?c="":A(a)?c=`>=${i}.0.0${s} <${+i+1}.0.0-0`:A(h)?i==="0"?c=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`:c=`>=${i}.${a}.0${s} <${+i+1}.0.0-0`:g?(v("replaceCaret pr",g),i==="0"?a==="0"?c=`>=${i}.${a}.${h}-${g} <${i}.${a}.${+h+1}-0`:c=`>=${i}.${a}.${h}-${g} <${i}.${+a+1}.0-0`:c=`>=${i}.${a}.${h}-${g} <${+i+1}.0.0-0`):(v("no pr"),i==="0"?a==="0"?c=`>=${i}.${a}.${h}${s} <${i}.${a}.${+h+1}-0`:c=`>=${i}.${a}.${h}${s} <${i}.${+a+1}.0-0`:c=`>=${i}.${a}.${h} <${+i+1}.0.0-0`),v("caret return",c),c})},Hr=(t,e)=>(v("replaceXRanges",t,e),t.split(/\s+/).map(r=>Yr(r,e)).join(" ")),Yr=(t,e)=>{t=t.trim();let r=e.loose?y[I.XRANGELOOSE]:y[I.XRANGE];return t.replace(r,(s,n,i,a,h,g)=>{v("xRange",t,s,n,i,a,h,g);let c=A(i),d=c||A(a),E=d||A(h),C=E;return n==="="&&C&&(n=""),g=e.includePrerelease?"-0":"",c?n===">"||n==="<"?s="<0.0.0-0":s="*":n&&C?(d&&(a=0),h=0,n===">"?(n=">=",d?(i=+i+1,a=0,h=0):(a=+a+1,h=0)):n==="<="&&(n="<",d?i=+i+1:a=+a+1),n==="<"&&(g="-0"),s=`${n+i}.${a}.${h}${g}`):d?s=`>=${i}.0.0${g} <${+i+1}.0.0-0`:E&&(s=`>=${i}.${a}.0${g} <${i}.${+a+1}.0-0`),v("xRange return",s),s})},Br=(t,e)=>(v("replaceStars",t,e),t.trim().replace(y[I.STAR],"")),Kr=(t,e)=>(v("replaceGTE0",t,e),t.trim().replace(y[e.includePrerelease?I.GTE0PRE:I.GTE0],"")),zr=t=>(e,r,s,n,i,a,h,g,c,d,E,C,W)=>(A(s)?r="":A(n)?r=`>=${s}.0.0${t?"-0":""}`:A(i)?r=`>=${s}.${n}.0${t?"-0":""}`:a?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,A(c)?g="":A(d)?g=`<${+c+1}.0.0-0`:A(E)?g=`<${c}.${+d+1}.0-0`:C?g=`<=${c}.${d}.${E}-${C}`:t?g=`<${c}.${d}.${+E+1}-0`:g=`<=${g}`,`${r} ${g}`.trim()),Jr=(t,e,r)=>{for(let s=0;s0){let n=t[s].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0}});var ve=m((Zs,xt)=>{var Zr=Ee(),kr=(t,e,r)=>{try{e=new Zr(e,r)}catch{return!1}return e.test(t)};xt.exports=kr});var $t=m(x=>{"use strict";var Qr=x&&x.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),es=x&&x.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Ot=x&&x.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Qr(e,t,r);return es(e,t),e},St=x&&x.__awaiter||function(t,e,r,s){function n(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function h(d){try{c(s.next(d))}catch(E){a(E)}}function g(d){try{c(s.throw(d))}catch(E){a(E)}}function c(d){d.done?i(d.value):n(d.value).then(h,g)}c((s=s.apply(t,e||[])).next())})},Ct=x&&x.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},s,n,i,a;return a={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function h(c){return function(d){return g([c,d])}}function g(c){if(s)throw new TypeError("Generator is already executing.");for(;r;)try{if(s=1,n&&(i=c[0]&2?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]F,ExecutionError:()=>G,ValidationError:()=>X,account:()=>Is,connect:()=>Ns,document:()=>ys,eventsApi:()=>xs,group:()=>Cs,inject:()=>vs,item:()=>Ts,read:()=>Rs,semverToInt:()=>Ae,setClientInfo:()=>ps,setConnect:()=>ds,setGlobalFlags:()=>fs,user:()=>Ss,validateCli:()=>Es,vault:()=>Os,version:()=>ms,whoami:()=>As});module.exports=Xt($s);var _t=Y(ue()),wt=Y(ve());var bt=__nccwpck_require__(81),Lt=Y($t()),Re=Y(ue()),Ie=Y(ve());var Ft="0.1.9";var X=class extends Error{constructor(r,s,n){let i;switch(r){case"not-found":i="Could not find `op` executable";break;case"version":i=`CLI version ${n} does not satisfy required version ${s}`;break}super(i);this.type=r;this.requiredVersion=s;this.currentVersion=n;this.name="ValidationError"}},G=class extends Error{constructor(r,s){super(r);this.status=s;this.name="ExecutionError"}},ye=class extends G{constructor(r,s){let n=r.match(ye.errorRegex),i,a;n?(i=n[2],a=new Date(n[1])):i="Unknown error";super(i,s);this.originalMessage=r;this.name="CLIError",this.timestamp=a}timestamp},F=ye;oe(F,"errorRegex",/\[ERROR] (\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}) (.+)/);var Ae=t=>t.split(".").map(e=>e.padStart(2,"0")).join(""),os=t=>t.replace(/([A-Za-z])(?=[A-Z])/g,"$1-").toLowerCase(),b=t=>t.replace(/(["$'\\`])/g,"\\$1"),ls=(t,e)=>t.length===e.length&&t.every((r,s)=>r===e[s]),us=t=>{if(typeof t=="string")return`=${b(t)}`;if(Array.isArray(t))return`=${t.join(",")}`;if(typeof t=="object"){let e="";if("label"in t&&(e+=(t.label||[]).map(r=>`label=${r}`).join(",")),"type"in t&&(e+=(t.type||[]).map(r=>`type=${r}`).join(",")),e.length>0)return`=${b(e)}`}return""},cs=t=>Object.entries(t).filter(([e,r])=>Boolean(r)).map(([e,r])=>`--${os(b(e))}${us(r)}`),gs=([t,e,r])=>`${b(t)}[${b(e)}]=${b(r)}`,hs={name:"1Password for JavaScript",id:"JS",build:Ae(Ft)},xe=class{clientInfo=hs;globalFlags={};connect;setClientInfo(e){this.clientInfo=e}getVersion(){return this.execute([],{flags:{version:!0},json:!1})}async validate(e=xe.recommendedVersion){if(!!!await(0,Lt.lookpath)("op"))throw new X("not-found");let s=this.getVersion(),n=(0,Re.default)(s);if(!(0,Ie.default)(n,e))throw new X("version",e,s)}createParts(e,r,s,n){let i=e.map(a=>b(a));for(let a of r)if(typeof a=="string")i.push(b(a));else if(Array.isArray(a))i.push(gs(a));else throw new TypeError("Invalid argument");if(n&&(s={...s,format:"json"}),ls(e,["inject"])){let a=(0,Re.default)(o.getVersion());if((0,Ie.default)(a,">=2.6.2")){if(process.platform==="win32")throw new G("Inject is not supported on Windows for version >=2.6.2 of the CLI",1);s={...s,inFile:"/dev/stdin"}}}return[...i,...cs({...this.globalFlags,...s})]}execute(e,{args:r=[],flags:s={},stdin:n,json:i=!0}={}){let a,h=this.createParts(e,r,s,i);n&&(a=Buffer.from(typeof n=="string"?n:JSON.stringify(n)));let{status:g,error:c,stdout:d,stderr:E}=(0,bt.spawnSync)("op",h,{stdio:"pipe",input:a,env:{...process.env,...this.connect&&{OP_CONNECT_HOST:this.connect.host,OP_CONNECT_TOKEN:this.connect.token},OP_INTEGRATION_NAME:this.clientInfo.name,OP_INTEGRATION_ID:this.clientInfo.id,OP_INTEGRATION_BUILDNUMBER:this.clientInfo.build}});if(c)throw new G(c.message,g);let C=E.toString();if(C.length>0)throw new F(C,g);let W=d.toString().trim();if(W.length!==0){if(!i)return W;try{return JSON.parse(W)}catch(Dt){throw console.log(W),Dt}}}},ae=xe;oe(ae,"recommendedVersion",">=2.4.0");var o=new ae;var ps=t=>o.setClientInfo(t),fs=t=>{o.globalFlags=t},ds=(t,e)=>{o.connect={host:t,token:e}},Es=async t=>await o.validate(t),ms=()=>o.getVersion(),vs={data:(t,e={})=>o.execute(["inject"],{flags:e,json:!1,stdin:t}),toFile:(t,e,r={})=>o.execute(["inject"],{flags:{outFile:e,...r},json:!1,stdin:t})},Rs={parse:(t,e={})=>o.execute(["read"],{args:[t],flags:e,json:!1}),toFile:(t,e,r={})=>o.execute(["read"],{args:[t],flags:{outFile:e,...r},json:!1})},Is={forget:(t,e={})=>o.execute(["account","forget"],{args:[t],flags:e,json:!1}),get:(t={})=>o.execute(["account","get"],{flags:t}),list:(t={})=>o.execute(["account","list"],{flags:t})},As=()=>{try{return o.execute(["whoami"])}catch(t){if(t instanceof F&&t.message.includes("signed in"))return null;throw t}},ys={create:(t,e={},r=!1)=>o.execute(["document","create"],{args:[r?t:""],flags:e,stdin:r?void 0:t}),delete:(t,e={})=>o.execute(["document","delete"],{args:[t],flags:e}),edit:(t,e,r={},s=!1)=>o.execute(["document","edit"],{args:[t,s?e:""],flags:r,stdin:s?void 0:e}),get:(t,e={})=>o.execute(["document","get"],{args:[t],flags:e,json:!1}),toFile:(t,e,r={})=>o.execute(["document","get"],{args:[t],flags:{output:e,...r},json:!1}),list:(t={})=>o.execute(["document","list"],{flags:t})},xs={create:(t,e={})=>o.execute(["events-api","create"],{args:[t],flags:e,json:!1})},Ns={group:{grant:(t,e={})=>o.execute(["connect","group","grant"],{flags:{group:t,...e},json:!1}),revoke:(t,e={})=>o.execute(["connect","group","revoke"],{flags:{group:t,...e},json:!1})},server:{create:(t,e={})=>o.execute(["connect","server","create"],{args:[t],flags:e,json:!1}),delete:(t,e={})=>o.execute(["connect","server","delete"],{args:[t],flags:e}),edit:(t,e,r={})=>o.execute(["connect","server","edit"],{args:[t],flags:{name:e,...r},json:!1}),get:(t,e={})=>o.execute(["connect","server","get"],{args:[t],flags:e}),list:(t={})=>o.execute(["connect","server","list"],{flags:t})},token:{create:(t,e,r={})=>o.execute(["connect","token","create"],{args:[t],flags:{server:e,...r},json:!1}),delete:(t,e={})=>o.execute(["connect","token","delete"],{args:[t],flags:e,json:!1}),edit:(t,e,r={})=>o.execute(["connect","token","edit"],{args:[t],flags:{name:e,...r},json:!1}),list:(t={})=>o.execute(["connect","token","list"],{flags:t})},vault:{grant:(t,e,r={})=>o.execute(["connect","vault","grant"],{flags:{server:t,vault:e,...r},json:!1}),revoke:(t,e,r={})=>o.execute(["connect","vault","revoke"],{flags:{server:t,vault:e,...r},json:!1})}},Ts={create:(t,e={})=>{let r={flags:e},s=(0,_t.default)(o.getVersion());return(0,wt.default)(s,">=2.6.2")?r.args=t:r.stdin={fields:t.map(([n,i,a,h])=>{let g={label:n,type:i,value:a};return h&&Object.assign(g,{purpose:h}),g})},o.execute(["item","create"],r)},delete:(t,e={})=>o.execute(["item","delete"],{args:[t],flags:e,json:!1}),edit:(t,e,r={})=>o.execute(["item","edit"],{args:[t,...e],flags:r}),get:(t,e={})=>o.execute(["item","get"],{args:[t],flags:e}),otp:(t,e={})=>o.execute(["item","get"],{args:[t],flags:{otp:!0,...e},json:!1}),shareLink:(t,e={})=>o.execute(["item","get"],{args:[t],flags:{shareLink:!0,...e},json:!1}),list:(t={})=>o.execute(["item","list"],{flags:t}),share:(t,e={})=>o.execute(["item","share"],{args:[t],flags:e,json:!1}),template:{get:(t,e={})=>o.execute(["item","template","get"],{args:[t],flags:e}),list:(t={})=>o.execute(["item","template","list"],{flags:t})}},Os={create:(t,e={})=>o.execute(["vault","create"],{args:[t],flags:e}),delete:(t,e={})=>o.execute(["vault","delete"],{args:[t],flags:e,json:!1}),edit:(t,e={})=>o.execute(["vault","edit"],{args:[t],flags:e,json:!1}),get:(t,e={})=>o.execute(["vault","get"],{args:[t],flags:e}),list:(t={})=>o.execute(["vault","list"],{flags:t}),group:{grant:(t={})=>o.execute(["vault","group","grant"],{flags:{noInput:!0,...t}}),revoke:(t={})=>o.execute(["vault","group","revoke"],{flags:{noInput:!0,...t}}),list:(t,e={})=>o.execute(["vault","group","list"],{args:[t],flags:e})},user:{grant:(t={})=>o.execute(["vault","user","grant"],{flags:{noInput:!0,...t}}),revoke:(t={})=>o.execute(["vault","user","revoke"],{flags:{noInput:!0,...t}}),list:(t,e={})=>o.execute(["vault","user","list"],{args:[t],flags:e})}},Ss={confirm:(t,e={})=>o.execute(["user","confirm"],{args:[t],flags:e,json:!1}),confirmAll:(t={})=>o.execute(["user","confirm"],{flags:{all:!0,...t},json:!1}),delete:(t,e={})=>o.execute(["user","delete"],{args:[t],flags:e,json:!1}),edit:(t,e={})=>o.execute(["user","edit"],{args:[t],flags:e,json:!1}),get:(t,e={})=>o.execute(["user","get"],{args:[t],flags:e}),me:(t={})=>o.execute(["user","get"],{flags:{me:!0,...t}}),fingerprint:(t,e={})=>o.execute(["user","get"],{args:[t],flags:{fingerprint:!0,...e},json:!1}),publicKey:(t,e={})=>o.execute(["user","get"],{args:[t],flags:{publicKey:!0,...e},json:!1}),list:(t={})=>o.execute(["user","list"],{flags:t}),provision:(t,e,r)=>o.execute(["user","provision"],{flags:{email:t,name:e,...r}}),reactivate:(t,e={})=>o.execute(["user","reactivate"],{args:[t],flags:e,json:!1}),suspend:(t,e={})=>o.execute(["user","suspend"],{args:[t],flags:e,json:!1})},Cs={create:(t,e={})=>o.execute(["group","create"],{args:[t],flags:e}),delete:(t,e={})=>o.execute(["group","delete"],{args:[t],flags:e,json:!1}),edit:(t,e={})=>o.execute(["group","edit"],{args:[t],flags:e,json:!1}),get:(t,e={})=>o.execute(["group","get"],{args:[t],flags:e}),list:(t={})=>o.execute(["group","list"],{flags:t}),user:{grant:(t={})=>o.execute(["group","user","grant"],{flags:t,json:!1}),list:(t,e={})=>o.execute(["group","user","list"],{args:[t],flags:e}),revoke:(t={})=>o.execute(["group","user","grant"],{flags:t,json:!1})}};0&&(0); /***/ }), @@ -4121,19 +4121,20 @@ const envConnectHost = "OP_CONNECT_HOST"; const envConnectToken = "OP_CONNECT_TOKEN"; const envServiceAccountToken = "OP_SERVICE_ACCOUNT_TOKEN"; const envManagedVariables = "OP_MANAGED_VARIABLES"; -const authErr = `(${envConnectHost} and ${envConnectToken}) or ${envServiceAccountToken} must be set`; +const authErr = `Authentication error with environment variables: you must set either 1) ${envServiceAccountToken}, or 2) both ${envConnectHost} and ${envConnectToken}.`; ;// CONCATENATED MODULE: ./src/utils.ts -const semverToInt = (input) => input - .split(".") - .map((n) => n.padStart(2, "0")) - .join(""); + + const validateAuth = () => { const isConnect = process.env[envConnectHost] && process.env[envConnectToken]; const isServiceAccount = process.env[envServiceAccountToken]; + if (isConnect && isServiceAccount) { + core.warning("WARNING: Both service account and Connect credentials are provided. Connect credentials will take priority."); + } if (!isConnect && !isServiceAccount) { throw new Error(authErr); } @@ -4147,10 +4148,10 @@ const validateAuth = () => { !process.env[envConnectHost].startsWith("https://")) { process.env[envConnectHost] = `http://${process.env[envConnectHost]}`; } - core.debug(`Authenticated with ${authType}.`); + core.info(`Authenticated with ${authType}.`); }; const extractSecret = (envName, shouldExportEnv) => { - core.debug(`Populating variable: ${envName}`); + core.info(`Populating variable: ${envName}`); const ref = process.env[envName]; if (!ref) { return; @@ -4167,12 +4168,31 @@ const extractSecret = (envName, shouldExportEnv) => { } core.setSecret(secretValue); }; +const loadSecrets = async (shouldExportEnv) => { + // Pass User-Agent Information to the 1Password CLI + (0,dist.setClientInfo)({ + name: "1Password GitHub Action", + id: "GHA", + build: (0,dist.semverToInt)(package_namespaceObject.i8), + }); + // Load secrets from environment variables using 1Password CLI. + // Iterate over them to find 1Password references, extract the secret values, + // and make them available in the next steps either as step outputs or as environment variables. + const res = await exec.getExecOutput(`sh -c "op env ls"`); + const envs = res.stdout.replace(/\n+$/g, "").split(/\r?\n/); + for (const envName of envs) { + extractSecret(envName, shouldExportEnv); + } + if (shouldExportEnv) { + core.exportVariable(envManagedVariables, envs.join()); + } +}; const unsetPrevious = () => { if (process.env[envManagedVariables]) { - core.debug("Unsetting previous values ..."); + core.info("Unsetting previous values ..."); const managedEnvs = process.env[envManagedVariables].split(","); for (const envName of managedEnvs) { - core.debug(`Unsetting ${envName}`); + core.info(`Unsetting ${envName}`); core.exportVariable(envName, ""); } } @@ -4185,9 +4205,7 @@ const unsetPrevious = () => { - - -const run = async () => { +const loadSecretsAction = async () => { try { // Get action inputs const shouldUnsetPrevious = core.getBooleanInput("unset-previous"); @@ -4221,6 +4239,9 @@ const run = async () => { // since we refer to the 1Password CLI here. // eslint-disable-next-line @typescript-eslint/naming-convention const installCLI = async () => { + // validateCli checks if there's an existing 1Password CLI installed on the runner. + // If there's no CLI installed, then validateCli will throw an error, which we will use + // as an indicator that we need to execute the installation script. await (0,dist.validateCli)().catch(async () => { const currentFile = external_url_default().fileURLToPath(import.meta.url); const currentDir = external_path_default().dirname(currentFile); @@ -4235,26 +4256,7 @@ const installCLI = async () => { } }); }; -const loadSecrets = async (shouldExportEnv) => { - // Pass User-Agent Information to the 1Password CLI - (0,dist.setClientInfo)({ - name: "1Password GitHub Action", - id: "GHA", - build: semverToInt(package_namespaceObject.i8), - }); - // Load secrets from environment variables using 1Password CLI. - // Iterate over them to find 1Password references, extract the secret values, - // and make them available in the next steps either as step outputs or as environment variables. - const res = await exec.getExecOutput(`sh -c "op env ls"`); - const envs = res.stdout.replace(/\n+$/g, "").split(/\r?\n/); - for (const envName of envs) { - extractSecret(envName, shouldExportEnv); - } - if (shouldExportEnv) { - core.exportVariable(envManagedVariables, envs.join()); - } -}; -void run(); +void loadSecretsAction(); })(); From 433acb33c7c43404274cf3048fc0e00cf2e75124 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Thu, 6 Jul 2023 17:29:45 +0100 Subject: [PATCH 40/44] Update packages --- package-lock.json | 1986 ++++++++++++++++++++++----------------------- package.json | 4 +- 2 files changed, 983 insertions(+), 1007 deletions(-) diff --git a/package-lock.json b/package-lock.json index d231ff3..d9e57c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,10 +16,10 @@ "devDependencies": { "@1password/front-end-style": "^6.0.1", "@types/jest": "^29.5.2", - "@types/node": "^20.3.3", + "@types/node": "^20.4.0", "@vercel/ncc": "^0.36.1", "husky": "^8.0.3", - "jest": "^29.5.0", + "jest": "^29.6.1", "lint-staged": "^13.2.3", "ts-jest": "^29.1.1", "typescript": "^5.1.6" @@ -67,6 +67,15 @@ "semver": "^7.3.6" } }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@actions/core": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", @@ -120,35 +129,35 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.21.0.tgz", - "integrity": "sha512-gMuZsmsgxk/ENC3O/fRw5QY8A9/uxQbbCEypnLIiYYc/qVJtEV7ouxC3EllIIwNzMqAQee5tanFabWsUOutS7g==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.6.tgz", + "integrity": "sha512-29tfsWTq2Ftu7MXmimyC0C5FDZv5DYxOZkh3XD3+QW4V/BYuv/LyEsjj3c0hqedEaDt6DBfDvexMKU8YevdqFg==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.21.3.tgz", - "integrity": "sha512-qIJONzoa/qiHghnm0l1n4i/6IIziDpzqc36FBs4pzMhDUraHqponwJLiAKm1hGLP3OSB/TVNz6rMwVGpwxxySw==", + "version": "7.22.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.8.tgz", + "integrity": "sha512-75+KxFB4CZqYRXjx4NlR4J7yGvKumBuZTmV4NV6v09dVXXkuYVYLT68N6HCzLvfJ+fWCxQsntNzKwwIXL4bHnw==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.21.3", - "@babel/helper-compilation-targets": "^7.20.7", - "@babel/helper-module-transforms": "^7.21.2", - "@babel/helpers": "^7.21.0", - "@babel/parser": "^7.21.3", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.21.3", - "@babel/types": "^7.21.3", + "@babel/code-frame": "^7.22.5", + "@babel/generator": "^7.22.7", + "@babel/helper-compilation-targets": "^7.22.6", + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helpers": "^7.22.6", + "@babel/parser": "^7.22.7", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.8", + "@babel/types": "^7.22.5", + "@nicolo-ribaudo/semver-v6": "^6.3.3", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.2.2", - "semver": "^6.3.0" + "json5": "^2.2.2" }, "engines": { "node": ">=6.9.0" @@ -159,35 +168,26 @@ } }, "node_modules/@babel/core/node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", + "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", "dev": true, "dependencies": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/@babel/eslint-parser": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.21.3.tgz", - "integrity": "sha512-kfhmPimwo6k4P8zxNs8+T7yR44q1LdpsZdE1NkCsVlfiuTPRfnGgjaF8Qgug9q9Pou17u6wneYF0lDCZJATMFg==", + "version": "7.22.7", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.22.7.tgz", + "integrity": "sha512-LH6HJqjOyu/Qtp7LuSycZXK/CYXQ4ohdkliEaL1QTdtOXVdOVpTBKVxAo/+eeyt+x/2SRzB+zUPduVl+xiEvdg==", "dev": true, "dependencies": { "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", - "eslint-visitor-keys": "^2.1.0", - "semver": "^6.3.0" + "@nicolo-ribaudo/semver-v6": "^6.3.3", + "eslint-visitor-keys": "^2.1.0" }, "engines": { "node": "^10.13.0 || ^12.13.0 || >=14.0.0" @@ -197,22 +197,13 @@ "eslint": "^7.5.0 || ^8.0.0" } }, - "node_modules/@babel/eslint-parser/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/@babel/generator": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.3.tgz", - "integrity": "sha512-QS3iR1GYC/YGUnW7IdggFeN5c1poPUurnGttOV/bZgPGV+izC/D8HnD6DLwod0fsatNyVn1G3EVWMYIF0nHbeA==", + "version": "7.22.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.7.tgz", + "integrity": "sha512-p+jPjMG+SI8yvIaxGgeW24u7q9+5+TGpZh8/CuB7RhBKd7RCy8FayNEFNNKrNK/eUcY/4ExQqLmyrvBXKsIcwQ==", "dev": true, "dependencies": { - "@babel/types": "^7.21.3", + "@babel/types": "^7.22.5", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -236,16 +227,16 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz", - "integrity": "sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.6.tgz", + "integrity": "sha512-534sYEqWD9VfUm3IPn2SLcH4Q3P86XL+QvqdC7ZsFrzyyPF3T4XGiVghF6PTYNdWg6pXuoqXxNQAhbYeEInTzA==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.20.5", - "@babel/helper-validator-option": "^7.18.6", - "browserslist": "^4.21.3", - "lru-cache": "^5.1.1", - "semver": "^6.3.0" + "@babel/compat-data": "^7.22.6", + "@babel/helper-validator-option": "^7.22.5", + "@nicolo-ribaudo/semver-v6": "^6.3.3", + "browserslist": "^4.21.9", + "lru-cache": "^5.1.1" }, "engines": { "node": ">=6.9.0" @@ -254,161 +245,152 @@ "@babel/core": "^7.0.0" } }, - "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", - "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", + "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz", - "integrity": "sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", + "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", "dev": true, "dependencies": { - "@babel/template": "^7.20.7", - "@babel/types": "^7.21.0" + "@babel/template": "^7.22.5", + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", - "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", - "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", + "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.21.2", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.21.2.tgz", - "integrity": "sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz", + "integrity": "sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-simple-access": "^7.20.2", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/helper-validator-identifier": "^7.19.1", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.21.2", - "@babel/types": "^7.21.2" + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-module-imports": "^7.22.5", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.5", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.5", + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz", - "integrity": "sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-simple-access": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz", - "integrity": "sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", "dev": true, "dependencies": { - "@babel/types": "^7.20.2" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", - "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.19.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", - "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", + "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz", - "integrity": "sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz", + "integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.21.0.tgz", - "integrity": "sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.6.tgz", + "integrity": "sha512-YjDs6y/fVOYFV8hAf1rxd1QvR9wJe1pDBZ2AREKq/SDayfPzgk0PBnVuTCE5X1acEpMMNOVUqoe+OwiZGJ+OaA==", "dev": true, "dependencies": { - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.21.0", - "@babel/types": "^7.21.0" + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.6", + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", + "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", + "@babel/helper-validator-identifier": "^7.22.5", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -488,9 +470,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.3.tgz", - "integrity": "sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ==", + "version": "7.22.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.7.tgz", + "integrity": "sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -560,12 +542,12 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz", - "integrity": "sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", + "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -662,12 +644,12 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz", - "integrity": "sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", + "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.19.0" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -677,45 +659,45 @@ } }, "node_modules/@babel/template": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz", - "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", + "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7" + "@babel/code-frame": "^7.22.5", + "@babel/parser": "^7.22.5", + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/template/node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", + "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", "dev": true, "dependencies": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.3.tgz", - "integrity": "sha512-XLyopNeaTancVitYZe2MlUEvgKb6YVVPXzofHgqHijCImG33b/uTurMS488ht/Hbsb2XK3U2BnSTxKVNGV3nGQ==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.21.3", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.21.0", - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.21.3", - "@babel/types": "^7.21.3", + "version": "7.22.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.8.tgz", + "integrity": "sha512-y6LPR+wpM2I3qJrsheCTwhIinzkETbplIgPBbwvqPKc+uljeA5gP+3nP8irdYt1mjQaDnlIcG+dw8OjAco4GXw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.5", + "@babel/generator": "^7.22.7", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.22.7", + "@babel/types": "^7.22.5", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -724,12 +706,12 @@ } }, "node_modules/@babel/traverse/node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", + "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", "dev": true, "dependencies": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -745,13 +727,13 @@ } }, "node_modules/@babel/types": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.3.tgz", - "integrity": "sha512-sBGdETxC+/M4o/zKC0sl6sjWv62WFR/uzxrJ6uYyMLZOUlPnwzw0tKgVHOXxaAd5l2g8pEDM5RZ495GPQI77kg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", + "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.19.4", - "@babel/helper-validator-identifier": "^7.19.1", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.5", "to-fast-properties": "^2.0.0" }, "engines": { @@ -891,16 +873,16 @@ } }, "node_modules/@jest/console": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.5.0.tgz", - "integrity": "sha512-NEpkObxPwyw/XxZVLPmAGKE89IQRp4puc6IQRPru6JKd1M3fW9v1xM1AnzIJE65hbCkzQAdnL8P47e9hzhiYLQ==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.6.1.tgz", + "integrity": "sha512-Aj772AYgwTSr5w8qnyoJ0eDYvN6bMsH3ORH1ivMotrInHLKdUz6BDlaEXHdM6kODaBIkNIyQGzsMvRdOv7VG7Q==", "dev": true, "dependencies": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.1", "@types/node": "*", "chalk": "^4.0.0", - "jest-message-util": "^29.5.0", - "jest-util": "^29.5.0", + "jest-message-util": "^29.6.1", + "jest-util": "^29.6.1", "slash": "^3.0.0" }, "engines": { @@ -908,16 +890,16 @@ } }, "node_modules/@jest/core": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.5.0.tgz", - "integrity": "sha512-28UzQc7ulUrOQw1IsN/kv1QES3q2kkbl/wGslyhAclqZ/8cMdB5M68BffkIdSJgKBUt50d3hbwJ92XESlE7LiQ==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.6.1.tgz", + "integrity": "sha512-CcowHypRSm5oYQ1obz1wfvkjZZ2qoQlrKKvlfPwh5jUXVU12TWr2qMeH8chLMuTFzHh5a1g2yaqlqDICbr+ukQ==", "dev": true, "dependencies": { - "@jest/console": "^29.5.0", - "@jest/reporters": "^29.5.0", - "@jest/test-result": "^29.5.0", - "@jest/transform": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/console": "^29.6.1", + "@jest/reporters": "^29.6.1", + "@jest/test-result": "^29.6.1", + "@jest/transform": "^29.6.1", + "@jest/types": "^29.6.1", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", @@ -925,20 +907,20 @@ "exit": "^0.1.2", "graceful-fs": "^4.2.9", "jest-changed-files": "^29.5.0", - "jest-config": "^29.5.0", - "jest-haste-map": "^29.5.0", - "jest-message-util": "^29.5.0", + "jest-config": "^29.6.1", + "jest-haste-map": "^29.6.1", + "jest-message-util": "^29.6.1", "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.5.0", - "jest-resolve-dependencies": "^29.5.0", - "jest-runner": "^29.5.0", - "jest-runtime": "^29.5.0", - "jest-snapshot": "^29.5.0", - "jest-util": "^29.5.0", - "jest-validate": "^29.5.0", - "jest-watcher": "^29.5.0", + "jest-resolve": "^29.6.1", + "jest-resolve-dependencies": "^29.6.1", + "jest-runner": "^29.6.1", + "jest-runtime": "^29.6.1", + "jest-snapshot": "^29.6.1", + "jest-util": "^29.6.1", + "jest-validate": "^29.6.1", + "jest-watcher": "^29.6.1", "micromatch": "^4.0.4", - "pretty-format": "^29.5.0", + "pretty-format": "^29.6.1", "slash": "^3.0.0", "strip-ansi": "^6.0.0" }, @@ -970,37 +952,37 @@ } }, "node_modules/@jest/environment": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.5.0.tgz", - "integrity": "sha512-5FXw2+wD29YU1d4I2htpRX7jYnAyTRjP2CsXQdo9SAM8g3ifxWPSV0HnClSn71xwctr0U3oZIIH+dtbfmnbXVQ==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.6.1.tgz", + "integrity": "sha512-RMMXx4ws+Gbvw3DfLSuo2cfQlK7IwGbpuEWXCqyYDcqYTI+9Ju3a5hDnXaxjNsa6uKh9PQF2v+qg+RLe63tz5A==", "dev": true, "dependencies": { - "@jest/fake-timers": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/fake-timers": "^29.6.1", + "@jest/types": "^29.6.1", "@types/node": "*", - "jest-mock": "^29.5.0" + "jest-mock": "^29.6.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/expect": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.5.0.tgz", - "integrity": "sha512-PueDR2HGihN3ciUNGr4uelropW7rqUfTiOn+8u0leg/42UhblPxHkfoh0Ruu3I9Y1962P3u2DY4+h7GVTSVU6g==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.6.1.tgz", + "integrity": "sha512-N5xlPrAYaRNyFgVf2s9Uyyvr795jnB6rObuPx4QFvNJz8aAjpZUDfO4bh5G/xuplMID8PrnuF1+SfSyDxhsgYg==", "dev": true, "dependencies": { - "expect": "^29.5.0", - "jest-snapshot": "^29.5.0" + "expect": "^29.6.1", + "jest-snapshot": "^29.6.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/expect-utils": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.5.0.tgz", - "integrity": "sha512-fmKzsidoXQT2KwnrwE0SQq3uj8Z763vzR8LnLBwC2qYWEFpjX8daRsk6rHUM1QvNlEW/UJXNXm59ztmJJWs2Mg==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.6.1.tgz", + "integrity": "sha512-o319vIf5pEMx0LmzSxxkYYxo4wrRLKHq9dP1yJU7FoPTB0LfAKSz8SWD6D/6U3v/O52t9cF5t+MeJiRsfk7zMw==", "dev": true, "dependencies": { "jest-get-type": "^29.4.3" @@ -1010,49 +992,49 @@ } }, "node_modules/@jest/fake-timers": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.5.0.tgz", - "integrity": "sha512-9ARvuAAQcBwDAqOnglWq2zwNIRUDtk/SCkp/ToGEhFv5r86K21l+VEs0qNTaXtyiY0lEePl3kylijSYJQqdbDg==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.6.1.tgz", + "integrity": "sha512-RdgHgbXyosCDMVYmj7lLpUwXA4c69vcNzhrt69dJJdf8azUrpRh3ckFCaTPNjsEeRi27Cig0oKDGxy5j7hOgHg==", "dev": true, "dependencies": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.1", "@sinonjs/fake-timers": "^10.0.2", "@types/node": "*", - "jest-message-util": "^29.5.0", - "jest-mock": "^29.5.0", - "jest-util": "^29.5.0" + "jest-message-util": "^29.6.1", + "jest-mock": "^29.6.1", + "jest-util": "^29.6.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/globals": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.5.0.tgz", - "integrity": "sha512-S02y0qMWGihdzNbUiqSAiKSpSozSuHX5UYc7QbnHP+D9Lyw8DgGGCinrN9uSuHPeKgSSzvPom2q1nAtBvUsvPQ==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.6.1.tgz", + "integrity": "sha512-2VjpaGy78JY9n9370H8zGRCFbYVWwjY6RdDMhoJHa1sYfwe6XM/azGN0SjY8kk7BOZApIejQ1BFPyH7FPG0w3A==", "dev": true, "dependencies": { - "@jest/environment": "^29.5.0", - "@jest/expect": "^29.5.0", - "@jest/types": "^29.5.0", - "jest-mock": "^29.5.0" + "@jest/environment": "^29.6.1", + "@jest/expect": "^29.6.1", + "@jest/types": "^29.6.1", + "jest-mock": "^29.6.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/reporters": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.5.0.tgz", - "integrity": "sha512-D05STXqj/M8bP9hQNSICtPqz97u7ffGzZu+9XLucXhkOFBqKcXe04JLZOgIekOxdb73MAoBUFnqvf7MCpKk5OA==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.6.1.tgz", + "integrity": "sha512-9zuaI9QKr9JnoZtFQlw4GREQbxgmNYXU6QuWtmuODvk5nvPUeBYapVR/VYMyi2WSx3jXTLJTJji8rN6+Cm4+FA==", "dev": true, "dependencies": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^29.5.0", - "@jest/test-result": "^29.5.0", - "@jest/transform": "^29.5.0", - "@jest/types": "^29.5.0", - "@jridgewell/trace-mapping": "^0.3.15", + "@jest/console": "^29.6.1", + "@jest/test-result": "^29.6.1", + "@jest/transform": "^29.6.1", + "@jest/types": "^29.6.1", + "@jridgewell/trace-mapping": "^0.3.18", "@types/node": "*", "chalk": "^4.0.0", "collect-v8-coverage": "^1.0.0", @@ -1064,9 +1046,9 @@ "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.1.3", - "jest-message-util": "^29.5.0", - "jest-util": "^29.5.0", - "jest-worker": "^29.5.0", + "jest-message-util": "^29.6.1", + "jest-util": "^29.6.1", + "jest-worker": "^29.6.1", "slash": "^3.0.0", "string-length": "^4.0.1", "strip-ansi": "^6.0.0", @@ -1085,24 +1067,24 @@ } }, "node_modules/@jest/schemas": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.4.3.tgz", - "integrity": "sha512-VLYKXQmtmuEz6IxJsrZwzG9NvtkQsWNnWMsKxqWNu3+CnfzJQhp0WDDKWLVV9hLKr0l3SLLFRqcYHjhtyuDVxg==", + "version": "29.6.0", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.0.tgz", + "integrity": "sha512-rxLjXyJBTL4LQeJW3aKo0M/+GkCOXsO+8i9Iu7eDb6KwtP65ayoDsitrdPBtujxQ88k4wI2FNYfa6TOGwSn6cQ==", "dev": true, "dependencies": { - "@sinclair/typebox": "^0.25.16" + "@sinclair/typebox": "^0.27.8" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/source-map": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.4.3.tgz", - "integrity": "sha512-qyt/mb6rLyd9j1jUts4EQncvS6Yy3PM9HghnNv86QBlV+zdL2inCdK1tuVlL+J+lpiw2BI67qXOrX3UurBqQ1w==", + "version": "29.6.0", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.0.tgz", + "integrity": "sha512-oA+I2SHHQGxDCZpbrsCQSoMLb3Bz547JnM+jUr9qEbuw0vQlWZfpPS7CO9J7XiwKicEz9OFn/IYoLkkiUD7bzA==", "dev": true, "dependencies": { - "@jridgewell/trace-mapping": "^0.3.15", + "@jridgewell/trace-mapping": "^0.3.18", "callsites": "^3.0.0", "graceful-fs": "^4.2.9" }, @@ -1111,13 +1093,13 @@ } }, "node_modules/@jest/test-result": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.5.0.tgz", - "integrity": "sha512-fGl4rfitnbfLsrfx1uUpDEESS7zM8JdgZgOCQuxQvL1Sn/I6ijeAVQWGfXI9zb1i9Mzo495cIpVZhA0yr60PkQ==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.6.1.tgz", + "integrity": "sha512-Ynr13ZRcpX6INak0TPUukU8GWRfm/vAytE3JbJNGAvINySWYdfE7dGZMbk36oVuK4CigpbhMn8eg1dixZ7ZJOw==", "dev": true, "dependencies": { - "@jest/console": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/console": "^29.6.1", + "@jest/types": "^29.6.1", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" }, @@ -1126,14 +1108,14 @@ } }, "node_modules/@jest/test-sequencer": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.5.0.tgz", - "integrity": "sha512-yPafQEcKjkSfDXyvtgiV4pevSeyuA6MQr6ZIdVkWJly9vkqjnFfcfhRQqpD5whjoU8EORki752xQmjaqoFjzMQ==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.6.1.tgz", + "integrity": "sha512-oBkC36PCDf/wb6dWeQIhaviU0l5u6VCsXa119yqdUosYAt7/FbQU2M2UoziO3igj/HBDEgp57ONQ3fm0v9uyyg==", "dev": true, "dependencies": { - "@jest/test-result": "^29.5.0", + "@jest/test-result": "^29.6.1", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.5.0", + "jest-haste-map": "^29.6.1", "slash": "^3.0.0" }, "engines": { @@ -1141,22 +1123,22 @@ } }, "node_modules/@jest/transform": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.5.0.tgz", - "integrity": "sha512-8vbeZWqLJOvHaDfeMuoHITGKSz5qWc9u04lnWrQE3VyuSw604PzQM824ZeX9XSjUCeDiE3GuxZe5UKa8J61NQw==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.6.1.tgz", + "integrity": "sha512-URnTneIU3ZjRSaf906cvf6Hpox3hIeJXRnz3VDSw5/X93gR8ycdfSIEy19FlVx8NFmpN7fe3Gb1xF+NjXaQLWg==", "dev": true, "dependencies": { "@babel/core": "^7.11.6", - "@jest/types": "^29.5.0", - "@jridgewell/trace-mapping": "^0.3.15", + "@jest/types": "^29.6.1", + "@jridgewell/trace-mapping": "^0.3.18", "babel-plugin-istanbul": "^6.1.1", "chalk": "^4.0.0", "convert-source-map": "^2.0.0", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.5.0", + "jest-haste-map": "^29.6.1", "jest-regex-util": "^29.4.3", - "jest-util": "^29.5.0", + "jest-util": "^29.6.1", "micromatch": "^4.0.4", "pirates": "^4.0.4", "slash": "^3.0.0", @@ -1173,12 +1155,12 @@ "dev": true }, "node_modules/@jest/types": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.5.0.tgz", - "integrity": "sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.1.tgz", + "integrity": "sha512-tPKQNMPuXgvdOn2/Lg9HNfUvjYVGolt04Hp03f5hAk878uwOLikN+JzeLY0HcVgKgFl9Hs3EIqpu3WX27XNhnw==", "dev": true, "dependencies": { - "@jest/schemas": "^29.4.3", + "@jest/schemas": "^29.6.0", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", "@types/node": "*", @@ -1227,9 +1209,9 @@ "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz", - "integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==", + "version": "0.3.18", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", + "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", "dev": true, "dependencies": { "@jridgewell/resolve-uri": "3.1.0", @@ -1245,6 +1227,15 @@ "eslint-scope": "5.1.1" } }, + "node_modules/@nicolo-ribaudo/semver-v6": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/semver-v6/-/semver-v6-6.3.3.tgz", + "integrity": "sha512-3Yc1fUTs69MG/uZbJlLSI3JISMn2UV2rg+1D/vROUqZyh3l6iYHCs7GMp+M40ZD7yOdDbYjJcU1oTJhrc+dGKg==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -1281,27 +1272,27 @@ } }, "node_modules/@sinclair/typebox": { - "version": "0.25.24", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.25.24.tgz", - "integrity": "sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==", + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", "dev": true }, "node_modules/@sinonjs/commons": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", - "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", + "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", "dev": true, "dependencies": { "type-detect": "4.0.8" } }, "node_modules/@sinonjs/fake-timers": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz", - "integrity": "sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", "dev": true, "dependencies": { - "@sinonjs/commons": "^2.0.0" + "@sinonjs/commons": "^3.0.0" } }, "node_modules/@types/babel__core": { @@ -1407,9 +1398,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.3.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.3.tgz", - "integrity": "sha512-wheIYdr4NYML61AjC8MKj/2jrR/kDQri/CIpVoZwldwhnIrD/j9jIU5bJ8yBKuB2VhpFV7Ab6G2XkBjv9r9Zzw==", + "version": "20.4.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.0.tgz", + "integrity": "sha512-jfT7iTf/4kOQ9S7CHV9BIyRaQqHu67mOjsIQBC3BKZvzvUB6zLxEwJ6sBE3ozcvP8kF6Uk5PXN0Q+c0dfhGX0g==", "dev": true }, "node_modules/@types/normalize-package-data": { @@ -1425,9 +1416,9 @@ "dev": true }, "node_modules/@types/prettier": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz", - "integrity": "sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==", + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz", + "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==", "dev": true }, "node_modules/@types/semver": { @@ -2004,12 +1995,12 @@ } }, "node_modules/babel-jest": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.5.0.tgz", - "integrity": "sha512-mA4eCDh5mSo2EcA9xQjVTpmbbNk32Zb3Q3QFQsNhaK56Q+yoXowzFodLux30HRgyOho5rsQ6B0P9QpMkvvnJ0Q==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.6.1.tgz", + "integrity": "sha512-qu+3bdPEQC6KZSPz+4Fyjbga5OODNcp49j6GKzG1EKbkfyJBxEYGVUmVGpwCSeGouG52R4EgYMLb6p9YeEEQ4A==", "dev": true, "dependencies": { - "@jest/transform": "^29.5.0", + "@jest/transform": "^29.6.1", "@types/babel__core": "^7.1.14", "babel-plugin-istanbul": "^6.1.1", "babel-preset-jest": "^29.5.0", @@ -2123,9 +2114,9 @@ } }, "node_modules/browserslist": { - "version": "4.21.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz", - "integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==", + "version": "4.21.9", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.9.tgz", + "integrity": "sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==", "dev": true, "funding": [ { @@ -2135,13 +2126,17 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { - "caniuse-lite": "^1.0.30001449", - "electron-to-chromium": "^1.4.284", - "node-releases": "^2.0.8", - "update-browserslist-db": "^1.0.10" + "caniuse-lite": "^1.0.30001503", + "electron-to-chromium": "^1.4.431", + "node-releases": "^2.0.12", + "update-browserslist-db": "^1.0.11" }, "bin": { "browserslist": "cli.js" @@ -2226,9 +2221,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001469", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001469.tgz", - "integrity": "sha512-Rcp7221ScNqQPP3W+lVOYDyjdR6dC+neEQCttoNr5bAyz54AboB4iwpnWgyi8P4YUsPybVzT4LgWiBbI3drL4g==", + "version": "1.0.30001512", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001512.tgz", + "integrity": "sha512-2S9nK0G/mE+jasCUsMPlARhRCts1ebcp2Ji8Y8PWi4NDE1iRdLCnEPHkEfeBrGC45L4isBx5ur3IQ6yTE2mRZw==", "dev": true, "funding": [ { @@ -2238,6 +2233,10 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ] }, @@ -2273,9 +2272,9 @@ "dev": true }, "node_modules/cjs-module-lexer": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz", - "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", "dev": true }, "node_modules/clean-regexp": { @@ -2451,9 +2450,9 @@ } }, "node_modules/collect-v8-coverage": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", - "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", "dev": true }, "node_modules/color-convert": { @@ -2704,9 +2703,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.335", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.335.tgz", - "integrity": "sha512-l/eowQqTnrq3gu+WSrdfkhfNHnPgYqlKAwxz7MTOj6mom19vpEDHNXl6dxDxyTiYuhemydprKr/HCrHfgk+OfQ==", + "version": "1.4.451", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.451.tgz", + "integrity": "sha512-YYbXHIBxAHe3KWvGOJOuWa6f3tgow44rBW+QAuwVp2DvGqNZeE//K2MowNdWS7XE8li5cgQDrX1LdBr41LufkA==", "dev": true }, "node_modules/emittery": { @@ -3455,16 +3454,17 @@ } }, "node_modules/expect": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.5.0.tgz", - "integrity": "sha512-yM7xqUrCO2JdpFo4XpM82t+PJBFybdqoQuJLDGeDX2ij8NZzqRHyu3Hp188/JX7SWqud+7t4MUdvcgGBICMHZg==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.6.1.tgz", + "integrity": "sha512-XEdDLonERCU1n9uR56/Stx9OqojaLAQtZf9PrCHH9Hl8YXiEIka3H4NXJ3NOIBmQJTg7+j7buh34PMHfJujc8g==", "dev": true, "dependencies": { - "@jest/expect-utils": "^29.5.0", + "@jest/expect-utils": "^29.6.1", + "@types/node": "*", "jest-get-type": "^29.4.3", - "jest-matcher-utils": "^29.5.0", - "jest-message-util": "^29.5.0", - "jest-util": "^29.5.0" + "jest-matcher-utils": "^29.6.1", + "jest-message-util": "^29.6.1", + "jest-util": "^29.6.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -4497,15 +4497,15 @@ } }, "node_modules/jest": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.5.0.tgz", - "integrity": "sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.6.1.tgz", + "integrity": "sha512-Nirw5B4nn69rVUZtemCQhwxOBhm0nsp3hmtF4rzCeWD7BkjAXRIji7xWQfnTNbz9g0aVsBX6aZK3n+23LM6uDw==", "dev": true, "dependencies": { - "@jest/core": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/core": "^29.6.1", + "@jest/types": "^29.6.1", "import-local": "^3.0.2", - "jest-cli": "^29.5.0" + "jest-cli": "^29.6.1" }, "bin": { "jest": "bin/jest.js" @@ -4551,28 +4551,28 @@ } }, "node_modules/jest-circus": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.5.0.tgz", - "integrity": "sha512-gq/ongqeQKAplVxqJmbeUOJJKkW3dDNPY8PjhJ5G0lBRvu0e3EWGxGy5cI4LAGA7gV2UHCtWBI4EMXK8c9nQKA==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.6.1.tgz", + "integrity": "sha512-tPbYLEiBU4MYAL2XoZme/bgfUeotpDBd81lgHLCbDZZFaGmECk0b+/xejPFtmiBP87GgP/y4jplcRpbH+fgCzQ==", "dev": true, "dependencies": { - "@jest/environment": "^29.5.0", - "@jest/expect": "^29.5.0", - "@jest/test-result": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/environment": "^29.6.1", + "@jest/expect": "^29.6.1", + "@jest/test-result": "^29.6.1", + "@jest/types": "^29.6.1", "@types/node": "*", "chalk": "^4.0.0", "co": "^4.6.0", "dedent": "^0.7.0", "is-generator-fn": "^2.0.0", - "jest-each": "^29.5.0", - "jest-matcher-utils": "^29.5.0", - "jest-message-util": "^29.5.0", - "jest-runtime": "^29.5.0", - "jest-snapshot": "^29.5.0", - "jest-util": "^29.5.0", + "jest-each": "^29.6.1", + "jest-matcher-utils": "^29.6.1", + "jest-message-util": "^29.6.1", + "jest-runtime": "^29.6.1", + "jest-snapshot": "^29.6.1", + "jest-util": "^29.6.1", "p-limit": "^3.1.0", - "pretty-format": "^29.5.0", + "pretty-format": "^29.6.1", "pure-rand": "^6.0.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" @@ -4597,21 +4597,21 @@ } }, "node_modules/jest-cli": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.5.0.tgz", - "integrity": "sha512-L1KcP1l4HtfwdxXNFCL5bmUbLQiKrakMUriBEcc1Vfz6gx31ORKdreuWvmQVBit+1ss9NNR3yxjwfwzZNdQXJw==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.6.1.tgz", + "integrity": "sha512-607dSgTA4ODIN6go9w6xY3EYkyPFGicx51a69H7yfvt7lN53xNswEVLovq+E77VsTRi5fWprLH0yl4DJgE8Ing==", "dev": true, "dependencies": { - "@jest/core": "^29.5.0", - "@jest/test-result": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/core": "^29.6.1", + "@jest/test-result": "^29.6.1", + "@jest/types": "^29.6.1", "chalk": "^4.0.0", "exit": "^0.1.2", "graceful-fs": "^4.2.9", "import-local": "^3.0.2", - "jest-config": "^29.5.0", - "jest-util": "^29.5.0", - "jest-validate": "^29.5.0", + "jest-config": "^29.6.1", + "jest-util": "^29.6.1", + "jest-validate": "^29.6.1", "prompts": "^2.0.1", "yargs": "^17.3.1" }, @@ -4631,31 +4631,31 @@ } }, "node_modules/jest-config": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.5.0.tgz", - "integrity": "sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.6.1.tgz", + "integrity": "sha512-XdjYV2fy2xYixUiV2Wc54t3Z4oxYPAELUzWnV6+mcbq0rh742X2p52pii5A3oeRzYjLnQxCsZmp0qpI6klE2cQ==", "dev": true, "dependencies": { "@babel/core": "^7.11.6", - "@jest/test-sequencer": "^29.5.0", - "@jest/types": "^29.5.0", - "babel-jest": "^29.5.0", + "@jest/test-sequencer": "^29.6.1", + "@jest/types": "^29.6.1", + "babel-jest": "^29.6.1", "chalk": "^4.0.0", "ci-info": "^3.2.0", "deepmerge": "^4.2.2", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-circus": "^29.5.0", - "jest-environment-node": "^29.5.0", + "jest-circus": "^29.6.1", + "jest-environment-node": "^29.6.1", "jest-get-type": "^29.4.3", "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.5.0", - "jest-runner": "^29.5.0", - "jest-util": "^29.5.0", - "jest-validate": "^29.5.0", + "jest-resolve": "^29.6.1", + "jest-runner": "^29.6.1", + "jest-util": "^29.6.1", + "jest-validate": "^29.6.1", "micromatch": "^4.0.4", "parse-json": "^5.2.0", - "pretty-format": "^29.5.0", + "pretty-format": "^29.6.1", "slash": "^3.0.0", "strip-json-comments": "^3.1.1" }, @@ -4691,15 +4691,15 @@ } }, "node_modules/jest-diff": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.5.0.tgz", - "integrity": "sha512-LtxijLLZBduXnHSniy0WMdaHjmQnt3g5sa16W4p0HqukYTTsyTW3GD1q41TyGl5YFXj/5B2U6dlh5FM1LIMgxw==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.6.1.tgz", + "integrity": "sha512-FsNCvinvl8oVxpNLttNQX7FAq7vR+gMDGj90tiP7siWw1UdakWUGqrylpsYrpvj908IYckm5Y0Q7azNAozU1Kg==", "dev": true, "dependencies": { "chalk": "^4.0.0", "diff-sequences": "^29.4.3", "jest-get-type": "^29.4.3", - "pretty-format": "^29.5.0" + "pretty-format": "^29.6.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -4718,33 +4718,33 @@ } }, "node_modules/jest-each": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.5.0.tgz", - "integrity": "sha512-HM5kIJ1BTnVt+DQZ2ALp3rzXEl+g726csObrW/jpEGl+CDSSQpOJJX2KE/vEg8cxcMXdyEPu6U4QX5eruQv5hA==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.6.1.tgz", + "integrity": "sha512-n5eoj5eiTHpKQCAVcNTT7DRqeUmJ01hsAL0Q1SMiBHcBcvTKDELixQOGMCpqhbIuTcfC4kMfSnpmDqRgRJcLNQ==", "dev": true, "dependencies": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.1", "chalk": "^4.0.0", "jest-get-type": "^29.4.3", - "jest-util": "^29.5.0", - "pretty-format": "^29.5.0" + "jest-util": "^29.6.1", + "pretty-format": "^29.6.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-environment-node": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.5.0.tgz", - "integrity": "sha512-ExxuIK/+yQ+6PRGaHkKewYtg6hto2uGCgvKdb2nfJfKXgZ17DfXjvbZ+jA1Qt9A8EQSfPnt5FKIfnOO3u1h9qw==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.6.1.tgz", + "integrity": "sha512-ZNIfAiE+foBog24W+2caIldl4Irh8Lx1PUhg/GZ0odM1d/h2qORAsejiFc7zb+SEmYPn1yDZzEDSU5PmDkmVLQ==", "dev": true, "dependencies": { - "@jest/environment": "^29.5.0", - "@jest/fake-timers": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/environment": "^29.6.1", + "@jest/fake-timers": "^29.6.1", + "@jest/types": "^29.6.1", "@types/node": "*", - "jest-mock": "^29.5.0", - "jest-util": "^29.5.0" + "jest-mock": "^29.6.1", + "jest-util": "^29.6.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -4760,20 +4760,20 @@ } }, "node_modules/jest-haste-map": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.5.0.tgz", - "integrity": "sha512-IspOPnnBro8YfVYSw6yDRKh/TiCdRngjxeacCps1cQ9cgVN6+10JUcuJ1EabrgYLOATsIAigxA0rLR9x/YlrSA==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.6.1.tgz", + "integrity": "sha512-0m7f9PZXxOCk1gRACiVgX85knUKPKLPg4oRCjLoqIm9brTHXaorMA0JpmtmVkQiT8nmXyIVoZd/nnH1cfC33ig==", "dev": true, "dependencies": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.1", "@types/graceful-fs": "^4.1.3", "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", "graceful-fs": "^4.2.9", "jest-regex-util": "^29.4.3", - "jest-util": "^29.5.0", - "jest-worker": "^29.5.0", + "jest-util": "^29.6.1", + "jest-worker": "^29.6.1", "micromatch": "^4.0.4", "walker": "^1.0.8" }, @@ -4785,46 +4785,46 @@ } }, "node_modules/jest-leak-detector": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.5.0.tgz", - "integrity": "sha512-u9YdeeVnghBUtpN5mVxjID7KbkKE1QU4f6uUwuxiY0vYRi9BUCLKlPEZfDGR67ofdFmDz9oPAy2G92Ujrntmow==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.6.1.tgz", + "integrity": "sha512-OrxMNyZirpOEwkF3UHnIkAiZbtkBWiye+hhBweCHkVbCgyEy71Mwbb5zgeTNYWJBi1qgDVfPC1IwO9dVEeTLwQ==", "dev": true, "dependencies": { "jest-get-type": "^29.4.3", - "pretty-format": "^29.5.0" + "pretty-format": "^29.6.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-matcher-utils": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.5.0.tgz", - "integrity": "sha512-lecRtgm/rjIK0CQ7LPQwzCs2VwW6WAahA55YBuI+xqmhm7LAaxokSB8C97yJeYyT+HvQkH741StzpU41wohhWw==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.6.1.tgz", + "integrity": "sha512-SLaztw9d2mfQQKHmJXKM0HCbl2PPVld/t9Xa6P9sgiExijviSp7TnZZpw2Fpt+OI3nwUO/slJbOfzfUMKKC5QA==", "dev": true, "dependencies": { "chalk": "^4.0.0", - "jest-diff": "^29.5.0", + "jest-diff": "^29.6.1", "jest-get-type": "^29.4.3", - "pretty-format": "^29.5.0" + "pretty-format": "^29.6.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-message-util": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.5.0.tgz", - "integrity": "sha512-Kijeg9Dag6CKtIDA7O21zNTACqD5MD/8HfIV8pdD94vFyFuer52SigdC3IQMhab3vACxXMiFk+yMHNdbqtyTGA==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.6.1.tgz", + "integrity": "sha512-KoAW2zAmNSd3Gk88uJ56qXUWbFk787QKmjjJVOjtGFmmGSZgDBrlIL4AfQw1xyMYPNVD7dNInfIbur9B2rd/wQ==", "dev": true, "dependencies": { "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.1", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", - "pretty-format": "^29.5.0", + "pretty-format": "^29.6.1", "slash": "^3.0.0", "stack-utils": "^2.0.3" }, @@ -4845,14 +4845,14 @@ } }, "node_modules/jest-mock": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.5.0.tgz", - "integrity": "sha512-GqOzvdWDE4fAV2bWQLQCkujxYWL7RxjCnj71b5VhDAGOevB3qj3Ovg26A5NI84ZpODxyzaozXLOh2NCgkbvyaw==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.6.1.tgz", + "integrity": "sha512-brovyV9HBkjXAEdRooaTQK42n8usKoSRR3gihzUpYeV/vwqgSoNfrksO7UfSACnPmxasO/8TmHM3w9Hp3G1dgw==", "dev": true, "dependencies": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.1", "@types/node": "*", - "jest-util": "^29.5.0" + "jest-util": "^29.6.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -4885,17 +4885,17 @@ } }, "node_modules/jest-resolve": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.5.0.tgz", - "integrity": "sha512-1TzxJ37FQq7J10jPtQjcc+MkCkE3GBpBecsSUWJ0qZNJpmg6m0D9/7II03yJulm3H/fvVjgqLh/k2eYg+ui52w==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.6.1.tgz", + "integrity": "sha512-AeRkyS8g37UyJiP9w3mmI/VXU/q8l/IH52vj/cDAyScDcemRbSBhfX/NMYIGilQgSVwsjxrCHf3XJu4f+lxCMg==", "dev": true, "dependencies": { "chalk": "^4.0.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.5.0", + "jest-haste-map": "^29.6.1", "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.5.0", - "jest-validate": "^29.5.0", + "jest-util": "^29.6.1", + "jest-validate": "^29.6.1", "resolve": "^1.20.0", "resolve.exports": "^2.0.0", "slash": "^3.0.0" @@ -4905,43 +4905,43 @@ } }, "node_modules/jest-resolve-dependencies": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.5.0.tgz", - "integrity": "sha512-sjV3GFr0hDJMBpYeUuGduP+YeCRbd7S/ck6IvL3kQ9cpySYKqcqhdLLC2rFwrcL7tz5vYibomBrsFYWkIGGjOg==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.1.tgz", + "integrity": "sha512-BbFvxLXtcldaFOhNMXmHRWx1nXQO5LoXiKSGQcA1LxxirYceZT6ch8KTE1bK3X31TNG/JbkI7OkS/ABexVahiw==", "dev": true, "dependencies": { "jest-regex-util": "^29.4.3", - "jest-snapshot": "^29.5.0" + "jest-snapshot": "^29.6.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-runner": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.5.0.tgz", - "integrity": "sha512-m7b6ypERhFghJsslMLhydaXBiLf7+jXy8FwGRHO3BGV1mcQpPbwiqiKUR2zU2NJuNeMenJmlFZCsIqzJCTeGLQ==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.6.1.tgz", + "integrity": "sha512-tw0wb2Q9yhjAQ2w8rHRDxteryyIck7gIzQE4Reu3JuOBpGp96xWgF0nY8MDdejzrLCZKDcp8JlZrBN/EtkQvPQ==", "dev": true, "dependencies": { - "@jest/console": "^29.5.0", - "@jest/environment": "^29.5.0", - "@jest/test-result": "^29.5.0", - "@jest/transform": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/console": "^29.6.1", + "@jest/environment": "^29.6.1", + "@jest/test-result": "^29.6.1", + "@jest/transform": "^29.6.1", + "@jest/types": "^29.6.1", "@types/node": "*", "chalk": "^4.0.0", "emittery": "^0.13.1", "graceful-fs": "^4.2.9", "jest-docblock": "^29.4.3", - "jest-environment-node": "^29.5.0", - "jest-haste-map": "^29.5.0", - "jest-leak-detector": "^29.5.0", - "jest-message-util": "^29.5.0", - "jest-resolve": "^29.5.0", - "jest-runtime": "^29.5.0", - "jest-util": "^29.5.0", - "jest-watcher": "^29.5.0", - "jest-worker": "^29.5.0", + "jest-environment-node": "^29.6.1", + "jest-haste-map": "^29.6.1", + "jest-leak-detector": "^29.6.1", + "jest-message-util": "^29.6.1", + "jest-resolve": "^29.6.1", + "jest-runtime": "^29.6.1", + "jest-util": "^29.6.1", + "jest-watcher": "^29.6.1", + "jest-worker": "^29.6.1", "p-limit": "^3.1.0", "source-map-support": "0.5.13" }, @@ -4965,31 +4965,31 @@ } }, "node_modules/jest-runtime": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.5.0.tgz", - "integrity": "sha512-1Hr6Hh7bAgXQP+pln3homOiEZtCDZFqwmle7Ew2j8OlbkIu6uE3Y/etJQG8MLQs3Zy90xrp2C0BRrtPHG4zryw==", - "dev": true, - "dependencies": { - "@jest/environment": "^29.5.0", - "@jest/fake-timers": "^29.5.0", - "@jest/globals": "^29.5.0", - "@jest/source-map": "^29.4.3", - "@jest/test-result": "^29.5.0", - "@jest/transform": "^29.5.0", - "@jest/types": "^29.5.0", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.6.1.tgz", + "integrity": "sha512-D6/AYOA+Lhs5e5il8+5pSLemjtJezUr+8zx+Sn8xlmOux3XOqx4d8l/2udBea8CRPqqrzhsKUsN/gBDE/IcaPQ==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.6.1", + "@jest/fake-timers": "^29.6.1", + "@jest/globals": "^29.6.1", + "@jest/source-map": "^29.6.0", + "@jest/test-result": "^29.6.1", + "@jest/transform": "^29.6.1", + "@jest/types": "^29.6.1", "@types/node": "*", "chalk": "^4.0.0", "cjs-module-lexer": "^1.0.0", "collect-v8-coverage": "^1.0.0", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.5.0", - "jest-message-util": "^29.5.0", - "jest-mock": "^29.5.0", + "jest-haste-map": "^29.6.1", + "jest-message-util": "^29.6.1", + "jest-mock": "^29.6.1", "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.5.0", - "jest-snapshot": "^29.5.0", - "jest-util": "^29.5.0", + "jest-resolve": "^29.6.1", + "jest-snapshot": "^29.6.1", + "jest-util": "^29.6.1", "slash": "^3.0.0", "strip-bom": "^4.0.0" }, @@ -5007,46 +5007,44 @@ } }, "node_modules/jest-snapshot": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.5.0.tgz", - "integrity": "sha512-x7Wolra5V0tt3wRs3/ts3S6ciSQVypgGQlJpz2rsdQYoUKxMxPNaoHMGJN6qAuPJqS+2iQ1ZUn5kl7HCyls84g==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.6.1.tgz", + "integrity": "sha512-G4UQE1QQ6OaCgfY+A0uR1W2AY0tGXUPQpoUClhWHq1Xdnx1H6JOrC2nH5lqnOEqaDgbHFgIwZ7bNq24HpB180A==", "dev": true, "dependencies": { "@babel/core": "^7.11.6", "@babel/generator": "^7.7.2", "@babel/plugin-syntax-jsx": "^7.7.2", "@babel/plugin-syntax-typescript": "^7.7.2", - "@babel/traverse": "^7.7.2", "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.5.0", - "@jest/transform": "^29.5.0", - "@jest/types": "^29.5.0", - "@types/babel__traverse": "^7.0.6", + "@jest/expect-utils": "^29.6.1", + "@jest/transform": "^29.6.1", + "@jest/types": "^29.6.1", "@types/prettier": "^2.1.5", "babel-preset-current-node-syntax": "^1.0.0", "chalk": "^4.0.0", - "expect": "^29.5.0", + "expect": "^29.6.1", "graceful-fs": "^4.2.9", - "jest-diff": "^29.5.0", + "jest-diff": "^29.6.1", "jest-get-type": "^29.4.3", - "jest-matcher-utils": "^29.5.0", - "jest-message-util": "^29.5.0", - "jest-util": "^29.5.0", + "jest-matcher-utils": "^29.6.1", + "jest-message-util": "^29.6.1", + "jest-util": "^29.6.1", "natural-compare": "^1.4.0", - "pretty-format": "^29.5.0", - "semver": "^7.3.5" + "pretty-format": "^29.6.1", + "semver": "^7.5.3" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-util": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.5.0.tgz", - "integrity": "sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.6.1.tgz", + "integrity": "sha512-NRFCcjc+/uO3ijUVyNOQJluf8PtGCe/W6cix36+M3cTFgiYqFOOW5MgN4JOOcvbUhcKTYVd1CvHz/LWi8d16Mg==", "dev": true, "dependencies": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.1", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", @@ -5073,17 +5071,17 @@ } }, "node_modules/jest-validate": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.5.0.tgz", - "integrity": "sha512-pC26etNIi+y3HV8A+tUGr/lph9B18GnzSRAkPaaZJIE1eFdiYm6/CewuiJQ8/RlfHd1u/8Ioi8/sJ+CmbA+zAQ==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.6.1.tgz", + "integrity": "sha512-r3Ds69/0KCN4vx4sYAbGL1EVpZ7MSS0vLmd3gV78O+NAx3PDQQukRU5hNHPXlyqCgFY8XUk7EuTMLugh0KzahA==", "dev": true, "dependencies": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.1", "camelcase": "^6.2.0", "chalk": "^4.0.0", "jest-get-type": "^29.4.3", "leven": "^3.1.0", - "pretty-format": "^29.5.0" + "pretty-format": "^29.6.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -5102,18 +5100,18 @@ } }, "node_modules/jest-watcher": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.5.0.tgz", - "integrity": "sha512-KmTojKcapuqYrKDpRwfqcQ3zjMlwu27SYext9pt4GlF5FUgB+7XE1mcCnSm6a4uUpFyQIkb6ZhzZvHl+jiBCiA==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.6.1.tgz", + "integrity": "sha512-d4wpjWTS7HEZPaaj8m36QiaP856JthRZkrgcIY/7ISoUWPIillrXM23WPboZVLbiwZBt4/qn2Jke84Sla6JhFA==", "dev": true, "dependencies": { - "@jest/test-result": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/test-result": "^29.6.1", + "@jest/types": "^29.6.1", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "emittery": "^0.13.1", - "jest-util": "^29.5.0", + "jest-util": "^29.6.1", "string-length": "^4.0.1" }, "engines": { @@ -5121,13 +5119,13 @@ } }, "node_modules/jest-worker": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.5.0.tgz", - "integrity": "sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.6.1.tgz", + "integrity": "sha512-U+Wrbca7S8ZAxAe9L6nb6g8kPdia5hj32Puu5iOqBCMTMWFHXuK6dOV2IFrpedbTV8fjMFLdWNttQTBL6u2MRA==", "dev": true, "dependencies": { "@types/node": "*", - "jest-util": "^29.5.0", + "jest-util": "^29.6.1", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" }, @@ -5890,9 +5888,9 @@ "dev": true }, "node_modules/node-releases": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", - "integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==", + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.12.tgz", + "integrity": "sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==", "dev": true }, "node_modules/normalize-package-data": { @@ -6068,17 +6066,17 @@ } }, "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", "dev": true, "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "type-check": "^0.4.0" }, "engines": { "node": ">= 0.8.0" @@ -6382,12 +6380,12 @@ } }, "node_modules/pretty-format": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.5.0.tgz", - "integrity": "sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", + "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", "dev": true, "dependencies": { - "@jest/schemas": "^29.4.3", + "@jest/schemas": "^29.6.0", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" }, @@ -6456,9 +6454,9 @@ } }, "node_modules/pure-rand": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.1.tgz", - "integrity": "sha512-t+x1zEHDjBwkDGY5v5ApnZ/utcd4XYDiJsaQQoptTXgUXX95sDg1elCdJghzicm7n2mbCBJ3uYWr6M22SO19rg==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.2.tgz", + "integrity": "sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ==", "dev": true, "funding": [ { @@ -6688,9 +6686,9 @@ } }, "node_modules/resolve.exports": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.1.tgz", - "integrity": "sha512-OEJWVeimw8mgQuj3HfkNl4KqRevH7lzeQNaWRPfx0PPse7Jk6ozcsG4FKVgtzDsC1KUF+YlTHh17NcgHOPykLw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", "dev": true, "engines": { "node": ">=10" @@ -7562,9 +7560,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", - "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", + "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", "dev": true, "funding": [ { @@ -7574,6 +7572,10 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { @@ -7581,7 +7583,7 @@ "picocolors": "^1.0.0" }, "bin": { - "browserslist-lint": "cli.js" + "update-browserslist-db": "cli.js" }, "peerDependencies": { "browserslist": ">= 4.21.0" @@ -7700,15 +7702,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -7770,9 +7763,9 @@ } }, "node_modules/yargs": { - "version": "17.7.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.1.tgz", - "integrity": "sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==", + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "dependencies": { "cliui": "^8.0.1", @@ -7854,6 +7847,12 @@ "semver": "^7.3.6" } }, + "@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true + }, "@actions/core": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", @@ -7904,77 +7903,63 @@ } }, "@babel/compat-data": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.21.0.tgz", - "integrity": "sha512-gMuZsmsgxk/ENC3O/fRw5QY8A9/uxQbbCEypnLIiYYc/qVJtEV7ouxC3EllIIwNzMqAQee5tanFabWsUOutS7g==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.6.tgz", + "integrity": "sha512-29tfsWTq2Ftu7MXmimyC0C5FDZv5DYxOZkh3XD3+QW4V/BYuv/LyEsjj3c0hqedEaDt6DBfDvexMKU8YevdqFg==", "dev": true }, "@babel/core": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.21.3.tgz", - "integrity": "sha512-qIJONzoa/qiHghnm0l1n4i/6IIziDpzqc36FBs4pzMhDUraHqponwJLiAKm1hGLP3OSB/TVNz6rMwVGpwxxySw==", + "version": "7.22.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.8.tgz", + "integrity": "sha512-75+KxFB4CZqYRXjx4NlR4J7yGvKumBuZTmV4NV6v09dVXXkuYVYLT68N6HCzLvfJ+fWCxQsntNzKwwIXL4bHnw==", "dev": true, "requires": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.21.3", - "@babel/helper-compilation-targets": "^7.20.7", - "@babel/helper-module-transforms": "^7.21.2", - "@babel/helpers": "^7.21.0", - "@babel/parser": "^7.21.3", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.21.3", - "@babel/types": "^7.21.3", + "@babel/code-frame": "^7.22.5", + "@babel/generator": "^7.22.7", + "@babel/helper-compilation-targets": "^7.22.6", + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helpers": "^7.22.6", + "@babel/parser": "^7.22.7", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.8", + "@babel/types": "^7.22.5", + "@nicolo-ribaudo/semver-v6": "^6.3.3", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.2.2", - "semver": "^6.3.0" + "json5": "^2.2.2" }, "dependencies": { "@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", + "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", "dev": true, "requires": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.22.5" } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true } } }, "@babel/eslint-parser": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.21.3.tgz", - "integrity": "sha512-kfhmPimwo6k4P8zxNs8+T7yR44q1LdpsZdE1NkCsVlfiuTPRfnGgjaF8Qgug9q9Pou17u6wneYF0lDCZJATMFg==", + "version": "7.22.7", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.22.7.tgz", + "integrity": "sha512-LH6HJqjOyu/Qtp7LuSycZXK/CYXQ4ohdkliEaL1QTdtOXVdOVpTBKVxAo/+eeyt+x/2SRzB+zUPduVl+xiEvdg==", "dev": true, "requires": { "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", - "eslint-visitor-keys": "^2.1.0", - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } + "@nicolo-ribaudo/semver-v6": "^6.3.3", + "eslint-visitor-keys": "^2.1.0" } }, "@babel/generator": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.3.tgz", - "integrity": "sha512-QS3iR1GYC/YGUnW7IdggFeN5c1poPUurnGttOV/bZgPGV+izC/D8HnD6DLwod0fsatNyVn1G3EVWMYIF0nHbeA==", + "version": "7.22.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.7.tgz", + "integrity": "sha512-p+jPjMG+SI8yvIaxGgeW24u7q9+5+TGpZh8/CuB7RhBKd7RCy8FayNEFNNKrNK/eUcY/4ExQqLmyrvBXKsIcwQ==", "dev": true, "requires": { - "@babel/types": "^7.21.3", + "@babel/types": "^7.22.5", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -7994,136 +7979,128 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz", - "integrity": "sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.6.tgz", + "integrity": "sha512-534sYEqWD9VfUm3IPn2SLcH4Q3P86XL+QvqdC7ZsFrzyyPF3T4XGiVghF6PTYNdWg6pXuoqXxNQAhbYeEInTzA==", "dev": true, "requires": { - "@babel/compat-data": "^7.20.5", - "@babel/helper-validator-option": "^7.18.6", - "browserslist": "^4.21.3", - "lru-cache": "^5.1.1", - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } + "@babel/compat-data": "^7.22.6", + "@babel/helper-validator-option": "^7.22.5", + "@nicolo-ribaudo/semver-v6": "^6.3.3", + "browserslist": "^4.21.9", + "lru-cache": "^5.1.1" } }, "@babel/helper-environment-visitor": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", - "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", + "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", "dev": true }, "@babel/helper-function-name": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz", - "integrity": "sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", + "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", "dev": true, "requires": { - "@babel/template": "^7.20.7", - "@babel/types": "^7.21.0" + "@babel/template": "^7.22.5", + "@babel/types": "^7.22.5" } }, "@babel/helper-hoist-variables": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", - "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "requires": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" } }, "@babel/helper-module-imports": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", - "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", + "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", "dev": true, "requires": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" } }, "@babel/helper-module-transforms": { - "version": "7.21.2", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.21.2.tgz", - "integrity": "sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz", + "integrity": "sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw==", "dev": true, "requires": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-simple-access": "^7.20.2", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/helper-validator-identifier": "^7.19.1", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.21.2", - "@babel/types": "^7.21.2" + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-module-imports": "^7.22.5", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.5", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.5", + "@babel/types": "^7.22.5" } }, "@babel/helper-plugin-utils": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz", - "integrity": "sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", "dev": true }, "@babel/helper-simple-access": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz", - "integrity": "sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", "dev": true, "requires": { - "@babel/types": "^7.20.2" + "@babel/types": "^7.22.5" } }, "@babel/helper-split-export-declaration": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", - "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "requires": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" } }, "@babel/helper-string-parser": { - "version": "7.19.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", - "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", "dev": true }, "@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", + "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", "dev": true }, "@babel/helper-validator-option": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz", - "integrity": "sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz", + "integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==", "dev": true }, "@babel/helpers": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.21.0.tgz", - "integrity": "sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.6.tgz", + "integrity": "sha512-YjDs6y/fVOYFV8hAf1rxd1QvR9wJe1pDBZ2AREKq/SDayfPzgk0PBnVuTCE5X1acEpMMNOVUqoe+OwiZGJ+OaA==", "dev": true, "requires": { - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.21.0", - "@babel/types": "^7.21.0" + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.6", + "@babel/types": "^7.22.5" } }, "@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", + "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.18.6", + "@babel/helper-validator-identifier": "^7.22.5", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -8187,9 +8164,9 @@ } }, "@babel/parser": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.3.tgz", - "integrity": "sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ==", + "version": "7.22.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.7.tgz", + "integrity": "sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q==", "dev": true }, "@babel/plugin-syntax-async-generators": { @@ -8238,12 +8215,12 @@ } }, "@babel/plugin-syntax-jsx": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz", - "integrity": "sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", + "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" } }, "@babel/plugin-syntax-logical-assignment-operators": { @@ -8310,61 +8287,61 @@ } }, "@babel/plugin-syntax-typescript": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz", - "integrity": "sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", + "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.19.0" + "@babel/helper-plugin-utils": "^7.22.5" } }, "@babel/template": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz", - "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", + "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==", "dev": true, "requires": { - "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7" + "@babel/code-frame": "^7.22.5", + "@babel/parser": "^7.22.5", + "@babel/types": "^7.22.5" }, "dependencies": { "@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", + "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", "dev": true, "requires": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.22.5" } } } }, "@babel/traverse": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.3.tgz", - "integrity": "sha512-XLyopNeaTancVitYZe2MlUEvgKb6YVVPXzofHgqHijCImG33b/uTurMS488ht/Hbsb2XK3U2BnSTxKVNGV3nGQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.21.3", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.21.0", - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.21.3", - "@babel/types": "^7.21.3", + "version": "7.22.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.8.tgz", + "integrity": "sha512-y6LPR+wpM2I3qJrsheCTwhIinzkETbplIgPBbwvqPKc+uljeA5gP+3nP8irdYt1mjQaDnlIcG+dw8OjAco4GXw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.22.5", + "@babel/generator": "^7.22.7", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.22.7", + "@babel/types": "^7.22.5", "debug": "^4.1.0", "globals": "^11.1.0" }, "dependencies": { "@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", + "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", "dev": true, "requires": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.22.5" } }, "globals": { @@ -8376,13 +8353,13 @@ } }, "@babel/types": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.3.tgz", - "integrity": "sha512-sBGdETxC+/M4o/zKC0sl6sjWv62WFR/uzxrJ6uYyMLZOUlPnwzw0tKgVHOXxaAd5l2g8pEDM5RZ495GPQI77kg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", + "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, "requires": { - "@babel/helper-string-parser": "^7.19.4", - "@babel/helper-validator-identifier": "^7.19.1", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.5", "to-fast-properties": "^2.0.0" } }, @@ -8486,30 +8463,30 @@ "dev": true }, "@jest/console": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.5.0.tgz", - "integrity": "sha512-NEpkObxPwyw/XxZVLPmAGKE89IQRp4puc6IQRPru6JKd1M3fW9v1xM1AnzIJE65hbCkzQAdnL8P47e9hzhiYLQ==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.6.1.tgz", + "integrity": "sha512-Aj772AYgwTSr5w8qnyoJ0eDYvN6bMsH3ORH1ivMotrInHLKdUz6BDlaEXHdM6kODaBIkNIyQGzsMvRdOv7VG7Q==", "dev": true, "requires": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.1", "@types/node": "*", "chalk": "^4.0.0", - "jest-message-util": "^29.5.0", - "jest-util": "^29.5.0", + "jest-message-util": "^29.6.1", + "jest-util": "^29.6.1", "slash": "^3.0.0" } }, "@jest/core": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.5.0.tgz", - "integrity": "sha512-28UzQc7ulUrOQw1IsN/kv1QES3q2kkbl/wGslyhAclqZ/8cMdB5M68BffkIdSJgKBUt50d3hbwJ92XESlE7LiQ==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.6.1.tgz", + "integrity": "sha512-CcowHypRSm5oYQ1obz1wfvkjZZ2qoQlrKKvlfPwh5jUXVU12TWr2qMeH8chLMuTFzHh5a1g2yaqlqDICbr+ukQ==", "dev": true, "requires": { - "@jest/console": "^29.5.0", - "@jest/reporters": "^29.5.0", - "@jest/test-result": "^29.5.0", - "@jest/transform": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/console": "^29.6.1", + "@jest/reporters": "^29.6.1", + "@jest/test-result": "^29.6.1", + "@jest/transform": "^29.6.1", + "@jest/types": "^29.6.1", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", @@ -8517,20 +8494,20 @@ "exit": "^0.1.2", "graceful-fs": "^4.2.9", "jest-changed-files": "^29.5.0", - "jest-config": "^29.5.0", - "jest-haste-map": "^29.5.0", - "jest-message-util": "^29.5.0", + "jest-config": "^29.6.1", + "jest-haste-map": "^29.6.1", + "jest-message-util": "^29.6.1", "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.5.0", - "jest-resolve-dependencies": "^29.5.0", - "jest-runner": "^29.5.0", - "jest-runtime": "^29.5.0", - "jest-snapshot": "^29.5.0", - "jest-util": "^29.5.0", - "jest-validate": "^29.5.0", - "jest-watcher": "^29.5.0", + "jest-resolve": "^29.6.1", + "jest-resolve-dependencies": "^29.6.1", + "jest-runner": "^29.6.1", + "jest-runtime": "^29.6.1", + "jest-snapshot": "^29.6.1", + "jest-util": "^29.6.1", + "jest-validate": "^29.6.1", + "jest-watcher": "^29.6.1", "micromatch": "^4.0.4", - "pretty-format": "^29.5.0", + "pretty-format": "^29.6.1", "slash": "^3.0.0", "strip-ansi": "^6.0.0" }, @@ -8544,74 +8521,74 @@ } }, "@jest/environment": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.5.0.tgz", - "integrity": "sha512-5FXw2+wD29YU1d4I2htpRX7jYnAyTRjP2CsXQdo9SAM8g3ifxWPSV0HnClSn71xwctr0U3oZIIH+dtbfmnbXVQ==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.6.1.tgz", + "integrity": "sha512-RMMXx4ws+Gbvw3DfLSuo2cfQlK7IwGbpuEWXCqyYDcqYTI+9Ju3a5hDnXaxjNsa6uKh9PQF2v+qg+RLe63tz5A==", "dev": true, "requires": { - "@jest/fake-timers": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/fake-timers": "^29.6.1", + "@jest/types": "^29.6.1", "@types/node": "*", - "jest-mock": "^29.5.0" + "jest-mock": "^29.6.1" } }, "@jest/expect": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.5.0.tgz", - "integrity": "sha512-PueDR2HGihN3ciUNGr4uelropW7rqUfTiOn+8u0leg/42UhblPxHkfoh0Ruu3I9Y1962P3u2DY4+h7GVTSVU6g==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.6.1.tgz", + "integrity": "sha512-N5xlPrAYaRNyFgVf2s9Uyyvr795jnB6rObuPx4QFvNJz8aAjpZUDfO4bh5G/xuplMID8PrnuF1+SfSyDxhsgYg==", "dev": true, "requires": { - "expect": "^29.5.0", - "jest-snapshot": "^29.5.0" + "expect": "^29.6.1", + "jest-snapshot": "^29.6.1" } }, "@jest/expect-utils": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.5.0.tgz", - "integrity": "sha512-fmKzsidoXQT2KwnrwE0SQq3uj8Z763vzR8LnLBwC2qYWEFpjX8daRsk6rHUM1QvNlEW/UJXNXm59ztmJJWs2Mg==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.6.1.tgz", + "integrity": "sha512-o319vIf5pEMx0LmzSxxkYYxo4wrRLKHq9dP1yJU7FoPTB0LfAKSz8SWD6D/6U3v/O52t9cF5t+MeJiRsfk7zMw==", "dev": true, "requires": { "jest-get-type": "^29.4.3" } }, "@jest/fake-timers": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.5.0.tgz", - "integrity": "sha512-9ARvuAAQcBwDAqOnglWq2zwNIRUDtk/SCkp/ToGEhFv5r86K21l+VEs0qNTaXtyiY0lEePl3kylijSYJQqdbDg==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.6.1.tgz", + "integrity": "sha512-RdgHgbXyosCDMVYmj7lLpUwXA4c69vcNzhrt69dJJdf8azUrpRh3ckFCaTPNjsEeRi27Cig0oKDGxy5j7hOgHg==", "dev": true, "requires": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.1", "@sinonjs/fake-timers": "^10.0.2", "@types/node": "*", - "jest-message-util": "^29.5.0", - "jest-mock": "^29.5.0", - "jest-util": "^29.5.0" + "jest-message-util": "^29.6.1", + "jest-mock": "^29.6.1", + "jest-util": "^29.6.1" } }, "@jest/globals": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.5.0.tgz", - "integrity": "sha512-S02y0qMWGihdzNbUiqSAiKSpSozSuHX5UYc7QbnHP+D9Lyw8DgGGCinrN9uSuHPeKgSSzvPom2q1nAtBvUsvPQ==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.6.1.tgz", + "integrity": "sha512-2VjpaGy78JY9n9370H8zGRCFbYVWwjY6RdDMhoJHa1sYfwe6XM/azGN0SjY8kk7BOZApIejQ1BFPyH7FPG0w3A==", "dev": true, "requires": { - "@jest/environment": "^29.5.0", - "@jest/expect": "^29.5.0", - "@jest/types": "^29.5.0", - "jest-mock": "^29.5.0" + "@jest/environment": "^29.6.1", + "@jest/expect": "^29.6.1", + "@jest/types": "^29.6.1", + "jest-mock": "^29.6.1" } }, "@jest/reporters": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.5.0.tgz", - "integrity": "sha512-D05STXqj/M8bP9hQNSICtPqz97u7ffGzZu+9XLucXhkOFBqKcXe04JLZOgIekOxdb73MAoBUFnqvf7MCpKk5OA==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.6.1.tgz", + "integrity": "sha512-9zuaI9QKr9JnoZtFQlw4GREQbxgmNYXU6QuWtmuODvk5nvPUeBYapVR/VYMyi2WSx3jXTLJTJji8rN6+Cm4+FA==", "dev": true, "requires": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^29.5.0", - "@jest/test-result": "^29.5.0", - "@jest/transform": "^29.5.0", - "@jest/types": "^29.5.0", - "@jridgewell/trace-mapping": "^0.3.15", + "@jest/console": "^29.6.1", + "@jest/test-result": "^29.6.1", + "@jest/transform": "^29.6.1", + "@jest/types": "^29.6.1", + "@jridgewell/trace-mapping": "^0.3.18", "@types/node": "*", "chalk": "^4.0.0", "collect-v8-coverage": "^1.0.0", @@ -8623,9 +8600,9 @@ "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.1.3", - "jest-message-util": "^29.5.0", - "jest-util": "^29.5.0", - "jest-worker": "^29.5.0", + "jest-message-util": "^29.6.1", + "jest-util": "^29.6.1", + "jest-worker": "^29.6.1", "slash": "^3.0.0", "string-length": "^4.0.1", "strip-ansi": "^6.0.0", @@ -8633,66 +8610,66 @@ } }, "@jest/schemas": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.4.3.tgz", - "integrity": "sha512-VLYKXQmtmuEz6IxJsrZwzG9NvtkQsWNnWMsKxqWNu3+CnfzJQhp0WDDKWLVV9hLKr0l3SLLFRqcYHjhtyuDVxg==", + "version": "29.6.0", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.0.tgz", + "integrity": "sha512-rxLjXyJBTL4LQeJW3aKo0M/+GkCOXsO+8i9Iu7eDb6KwtP65ayoDsitrdPBtujxQ88k4wI2FNYfa6TOGwSn6cQ==", "dev": true, "requires": { - "@sinclair/typebox": "^0.25.16" + "@sinclair/typebox": "^0.27.8" } }, "@jest/source-map": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.4.3.tgz", - "integrity": "sha512-qyt/mb6rLyd9j1jUts4EQncvS6Yy3PM9HghnNv86QBlV+zdL2inCdK1tuVlL+J+lpiw2BI67qXOrX3UurBqQ1w==", + "version": "29.6.0", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.0.tgz", + "integrity": "sha512-oA+I2SHHQGxDCZpbrsCQSoMLb3Bz547JnM+jUr9qEbuw0vQlWZfpPS7CO9J7XiwKicEz9OFn/IYoLkkiUD7bzA==", "dev": true, "requires": { - "@jridgewell/trace-mapping": "^0.3.15", + "@jridgewell/trace-mapping": "^0.3.18", "callsites": "^3.0.0", "graceful-fs": "^4.2.9" } }, "@jest/test-result": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.5.0.tgz", - "integrity": "sha512-fGl4rfitnbfLsrfx1uUpDEESS7zM8JdgZgOCQuxQvL1Sn/I6ijeAVQWGfXI9zb1i9Mzo495cIpVZhA0yr60PkQ==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.6.1.tgz", + "integrity": "sha512-Ynr13ZRcpX6INak0TPUukU8GWRfm/vAytE3JbJNGAvINySWYdfE7dGZMbk36oVuK4CigpbhMn8eg1dixZ7ZJOw==", "dev": true, "requires": { - "@jest/console": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/console": "^29.6.1", + "@jest/types": "^29.6.1", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" } }, "@jest/test-sequencer": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.5.0.tgz", - "integrity": "sha512-yPafQEcKjkSfDXyvtgiV4pevSeyuA6MQr6ZIdVkWJly9vkqjnFfcfhRQqpD5whjoU8EORki752xQmjaqoFjzMQ==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.6.1.tgz", + "integrity": "sha512-oBkC36PCDf/wb6dWeQIhaviU0l5u6VCsXa119yqdUosYAt7/FbQU2M2UoziO3igj/HBDEgp57ONQ3fm0v9uyyg==", "dev": true, "requires": { - "@jest/test-result": "^29.5.0", + "@jest/test-result": "^29.6.1", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.5.0", + "jest-haste-map": "^29.6.1", "slash": "^3.0.0" } }, "@jest/transform": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.5.0.tgz", - "integrity": "sha512-8vbeZWqLJOvHaDfeMuoHITGKSz5qWc9u04lnWrQE3VyuSw604PzQM824ZeX9XSjUCeDiE3GuxZe5UKa8J61NQw==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.6.1.tgz", + "integrity": "sha512-URnTneIU3ZjRSaf906cvf6Hpox3hIeJXRnz3VDSw5/X93gR8ycdfSIEy19FlVx8NFmpN7fe3Gb1xF+NjXaQLWg==", "dev": true, "requires": { "@babel/core": "^7.11.6", - "@jest/types": "^29.5.0", - "@jridgewell/trace-mapping": "^0.3.15", + "@jest/types": "^29.6.1", + "@jridgewell/trace-mapping": "^0.3.18", "babel-plugin-istanbul": "^6.1.1", "chalk": "^4.0.0", "convert-source-map": "^2.0.0", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.5.0", + "jest-haste-map": "^29.6.1", "jest-regex-util": "^29.4.3", - "jest-util": "^29.5.0", + "jest-util": "^29.6.1", "micromatch": "^4.0.4", "pirates": "^4.0.4", "slash": "^3.0.0", @@ -8708,12 +8685,12 @@ } }, "@jest/types": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.5.0.tgz", - "integrity": "sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.1.tgz", + "integrity": "sha512-tPKQNMPuXgvdOn2/Lg9HNfUvjYVGolt04Hp03f5hAk878uwOLikN+JzeLY0HcVgKgFl9Hs3EIqpu3WX27XNhnw==", "dev": true, "requires": { - "@jest/schemas": "^29.4.3", + "@jest/schemas": "^29.6.0", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", "@types/node": "*", @@ -8750,9 +8727,9 @@ "dev": true }, "@jridgewell/trace-mapping": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz", - "integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==", + "version": "0.3.18", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", + "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", "dev": true, "requires": { "@jridgewell/resolve-uri": "3.1.0", @@ -8768,6 +8745,12 @@ "eslint-scope": "5.1.1" } }, + "@nicolo-ribaudo/semver-v6": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/semver-v6/-/semver-v6-6.3.3.tgz", + "integrity": "sha512-3Yc1fUTs69MG/uZbJlLSI3JISMn2UV2rg+1D/vROUqZyh3l6iYHCs7GMp+M40ZD7yOdDbYjJcU1oTJhrc+dGKg==", + "dev": true + }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -8795,27 +8778,27 @@ } }, "@sinclair/typebox": { - "version": "0.25.24", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.25.24.tgz", - "integrity": "sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==", + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", "dev": true }, "@sinonjs/commons": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", - "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", + "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", "dev": true, "requires": { "type-detect": "4.0.8" } }, "@sinonjs/fake-timers": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz", - "integrity": "sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", "dev": true, "requires": { - "@sinonjs/commons": "^2.0.0" + "@sinonjs/commons": "^3.0.0" } }, "@types/babel__core": { @@ -8921,9 +8904,9 @@ "dev": true }, "@types/node": { - "version": "20.3.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.3.tgz", - "integrity": "sha512-wheIYdr4NYML61AjC8MKj/2jrR/kDQri/CIpVoZwldwhnIrD/j9jIU5bJ8yBKuB2VhpFV7Ab6G2XkBjv9r9Zzw==", + "version": "20.4.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.0.tgz", + "integrity": "sha512-jfT7iTf/4kOQ9S7CHV9BIyRaQqHu67mOjsIQBC3BKZvzvUB6zLxEwJ6sBE3ozcvP8kF6Uk5PXN0Q+c0dfhGX0g==", "dev": true }, "@types/normalize-package-data": { @@ -8939,9 +8922,9 @@ "dev": true }, "@types/prettier": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz", - "integrity": "sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==", + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz", + "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==", "dev": true }, "@types/semver": { @@ -9318,12 +9301,12 @@ "dev": true }, "babel-jest": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.5.0.tgz", - "integrity": "sha512-mA4eCDh5mSo2EcA9xQjVTpmbbNk32Zb3Q3QFQsNhaK56Q+yoXowzFodLux30HRgyOho5rsQ6B0P9QpMkvvnJ0Q==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.6.1.tgz", + "integrity": "sha512-qu+3bdPEQC6KZSPz+4Fyjbga5OODNcp49j6GKzG1EKbkfyJBxEYGVUmVGpwCSeGouG52R4EgYMLb6p9YeEEQ4A==", "dev": true, "requires": { - "@jest/transform": "^29.5.0", + "@jest/transform": "^29.6.1", "@types/babel__core": "^7.1.14", "babel-plugin-istanbul": "^6.1.1", "babel-preset-jest": "^29.5.0", @@ -9413,15 +9396,15 @@ } }, "browserslist": { - "version": "4.21.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz", - "integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==", + "version": "4.21.9", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.9.tgz", + "integrity": "sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001449", - "electron-to-chromium": "^1.4.284", - "node-releases": "^2.0.8", - "update-browserslist-db": "^1.0.10" + "caniuse-lite": "^1.0.30001503", + "electron-to-chromium": "^1.4.431", + "node-releases": "^2.0.12", + "update-browserslist-db": "^1.0.11" } }, "bs-logger": { @@ -9482,9 +9465,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001469", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001469.tgz", - "integrity": "sha512-Rcp7221ScNqQPP3W+lVOYDyjdR6dC+neEQCttoNr5bAyz54AboB4iwpnWgyi8P4YUsPybVzT4LgWiBbI3drL4g==", + "version": "1.0.30001512", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001512.tgz", + "integrity": "sha512-2S9nK0G/mE+jasCUsMPlARhRCts1ebcp2Ji8Y8PWi4NDE1iRdLCnEPHkEfeBrGC45L4isBx5ur3IQ6yTE2mRZw==", "dev": true }, "chalk": { @@ -9510,9 +9493,9 @@ "dev": true }, "cjs-module-lexer": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz", - "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", "dev": true }, "clean-regexp": { @@ -9631,9 +9614,9 @@ "dev": true }, "collect-v8-coverage": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", - "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", "dev": true }, "color-convert": { @@ -9821,9 +9804,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.4.335", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.335.tgz", - "integrity": "sha512-l/eowQqTnrq3gu+WSrdfkhfNHnPgYqlKAwxz7MTOj6mom19vpEDHNXl6dxDxyTiYuhemydprKr/HCrHfgk+OfQ==", + "version": "1.4.451", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.451.tgz", + "integrity": "sha512-YYbXHIBxAHe3KWvGOJOuWa6f3tgow44rBW+QAuwVp2DvGqNZeE//K2MowNdWS7XE8li5cgQDrX1LdBr41LufkA==", "dev": true }, "emittery": { @@ -10392,16 +10375,17 @@ "dev": true }, "expect": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.5.0.tgz", - "integrity": "sha512-yM7xqUrCO2JdpFo4XpM82t+PJBFybdqoQuJLDGeDX2ij8NZzqRHyu3Hp188/JX7SWqud+7t4MUdvcgGBICMHZg==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.6.1.tgz", + "integrity": "sha512-XEdDLonERCU1n9uR56/Stx9OqojaLAQtZf9PrCHH9Hl8YXiEIka3H4NXJ3NOIBmQJTg7+j7buh34PMHfJujc8g==", "dev": true, "requires": { - "@jest/expect-utils": "^29.5.0", + "@jest/expect-utils": "^29.6.1", + "@types/node": "*", "jest-get-type": "^29.4.3", - "jest-matcher-utils": "^29.5.0", - "jest-message-util": "^29.5.0", - "jest-util": "^29.5.0" + "jest-matcher-utils": "^29.6.1", + "jest-message-util": "^29.6.1", + "jest-util": "^29.6.1" } }, "fast-deep-equal": { @@ -11134,15 +11118,15 @@ } }, "jest": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.5.0.tgz", - "integrity": "sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.6.1.tgz", + "integrity": "sha512-Nirw5B4nn69rVUZtemCQhwxOBhm0nsp3hmtF4rzCeWD7BkjAXRIji7xWQfnTNbz9g0aVsBX6aZK3n+23LM6uDw==", "dev": true, "requires": { - "@jest/core": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/core": "^29.6.1", + "@jest/types": "^29.6.1", "import-local": "^3.0.2", - "jest-cli": "^29.5.0" + "jest-cli": "^29.6.1" } }, "jest-changed-files": { @@ -11167,28 +11151,28 @@ } }, "jest-circus": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.5.0.tgz", - "integrity": "sha512-gq/ongqeQKAplVxqJmbeUOJJKkW3dDNPY8PjhJ5G0lBRvu0e3EWGxGy5cI4LAGA7gV2UHCtWBI4EMXK8c9nQKA==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.6.1.tgz", + "integrity": "sha512-tPbYLEiBU4MYAL2XoZme/bgfUeotpDBd81lgHLCbDZZFaGmECk0b+/xejPFtmiBP87GgP/y4jplcRpbH+fgCzQ==", "dev": true, "requires": { - "@jest/environment": "^29.5.0", - "@jest/expect": "^29.5.0", - "@jest/test-result": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/environment": "^29.6.1", + "@jest/expect": "^29.6.1", + "@jest/test-result": "^29.6.1", + "@jest/types": "^29.6.1", "@types/node": "*", "chalk": "^4.0.0", "co": "^4.6.0", "dedent": "^0.7.0", "is-generator-fn": "^2.0.0", - "jest-each": "^29.5.0", - "jest-matcher-utils": "^29.5.0", - "jest-message-util": "^29.5.0", - "jest-runtime": "^29.5.0", - "jest-snapshot": "^29.5.0", - "jest-util": "^29.5.0", + "jest-each": "^29.6.1", + "jest-matcher-utils": "^29.6.1", + "jest-message-util": "^29.6.1", + "jest-runtime": "^29.6.1", + "jest-snapshot": "^29.6.1", + "jest-util": "^29.6.1", "p-limit": "^3.1.0", - "pretty-format": "^29.5.0", + "pretty-format": "^29.6.1", "pure-rand": "^6.0.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" @@ -11206,51 +11190,51 @@ } }, "jest-cli": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.5.0.tgz", - "integrity": "sha512-L1KcP1l4HtfwdxXNFCL5bmUbLQiKrakMUriBEcc1Vfz6gx31ORKdreuWvmQVBit+1ss9NNR3yxjwfwzZNdQXJw==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.6.1.tgz", + "integrity": "sha512-607dSgTA4ODIN6go9w6xY3EYkyPFGicx51a69H7yfvt7lN53xNswEVLovq+E77VsTRi5fWprLH0yl4DJgE8Ing==", "dev": true, "requires": { - "@jest/core": "^29.5.0", - "@jest/test-result": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/core": "^29.6.1", + "@jest/test-result": "^29.6.1", + "@jest/types": "^29.6.1", "chalk": "^4.0.0", "exit": "^0.1.2", "graceful-fs": "^4.2.9", "import-local": "^3.0.2", - "jest-config": "^29.5.0", - "jest-util": "^29.5.0", - "jest-validate": "^29.5.0", + "jest-config": "^29.6.1", + "jest-util": "^29.6.1", + "jest-validate": "^29.6.1", "prompts": "^2.0.1", "yargs": "^17.3.1" } }, "jest-config": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.5.0.tgz", - "integrity": "sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.6.1.tgz", + "integrity": "sha512-XdjYV2fy2xYixUiV2Wc54t3Z4oxYPAELUzWnV6+mcbq0rh742X2p52pii5A3oeRzYjLnQxCsZmp0qpI6klE2cQ==", "dev": true, "requires": { "@babel/core": "^7.11.6", - "@jest/test-sequencer": "^29.5.0", - "@jest/types": "^29.5.0", - "babel-jest": "^29.5.0", + "@jest/test-sequencer": "^29.6.1", + "@jest/types": "^29.6.1", + "babel-jest": "^29.6.1", "chalk": "^4.0.0", "ci-info": "^3.2.0", "deepmerge": "^4.2.2", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-circus": "^29.5.0", - "jest-environment-node": "^29.5.0", + "jest-circus": "^29.6.1", + "jest-environment-node": "^29.6.1", "jest-get-type": "^29.4.3", "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.5.0", - "jest-runner": "^29.5.0", - "jest-util": "^29.5.0", - "jest-validate": "^29.5.0", + "jest-resolve": "^29.6.1", + "jest-runner": "^29.6.1", + "jest-util": "^29.6.1", + "jest-validate": "^29.6.1", "micromatch": "^4.0.4", "parse-json": "^5.2.0", - "pretty-format": "^29.5.0", + "pretty-format": "^29.6.1", "slash": "^3.0.0", "strip-json-comments": "^3.1.1" }, @@ -11264,15 +11248,15 @@ } }, "jest-diff": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.5.0.tgz", - "integrity": "sha512-LtxijLLZBduXnHSniy0WMdaHjmQnt3g5sa16W4p0HqukYTTsyTW3GD1q41TyGl5YFXj/5B2U6dlh5FM1LIMgxw==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.6.1.tgz", + "integrity": "sha512-FsNCvinvl8oVxpNLttNQX7FAq7vR+gMDGj90tiP7siWw1UdakWUGqrylpsYrpvj908IYckm5Y0Q7azNAozU1Kg==", "dev": true, "requires": { "chalk": "^4.0.0", "diff-sequences": "^29.4.3", "jest-get-type": "^29.4.3", - "pretty-format": "^29.5.0" + "pretty-format": "^29.6.1" } }, "jest-docblock": { @@ -11285,30 +11269,30 @@ } }, "jest-each": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.5.0.tgz", - "integrity": "sha512-HM5kIJ1BTnVt+DQZ2ALp3rzXEl+g726csObrW/jpEGl+CDSSQpOJJX2KE/vEg8cxcMXdyEPu6U4QX5eruQv5hA==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.6.1.tgz", + "integrity": "sha512-n5eoj5eiTHpKQCAVcNTT7DRqeUmJ01hsAL0Q1SMiBHcBcvTKDELixQOGMCpqhbIuTcfC4kMfSnpmDqRgRJcLNQ==", "dev": true, "requires": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.1", "chalk": "^4.0.0", "jest-get-type": "^29.4.3", - "jest-util": "^29.5.0", - "pretty-format": "^29.5.0" + "jest-util": "^29.6.1", + "pretty-format": "^29.6.1" } }, "jest-environment-node": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.5.0.tgz", - "integrity": "sha512-ExxuIK/+yQ+6PRGaHkKewYtg6hto2uGCgvKdb2nfJfKXgZ17DfXjvbZ+jA1Qt9A8EQSfPnt5FKIfnOO3u1h9qw==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.6.1.tgz", + "integrity": "sha512-ZNIfAiE+foBog24W+2caIldl4Irh8Lx1PUhg/GZ0odM1d/h2qORAsejiFc7zb+SEmYPn1yDZzEDSU5PmDkmVLQ==", "dev": true, "requires": { - "@jest/environment": "^29.5.0", - "@jest/fake-timers": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/environment": "^29.6.1", + "@jest/fake-timers": "^29.6.1", + "@jest/types": "^29.6.1", "@types/node": "*", - "jest-mock": "^29.5.0", - "jest-util": "^29.5.0" + "jest-mock": "^29.6.1", + "jest-util": "^29.6.1" } }, "jest-get-type": { @@ -11318,12 +11302,12 @@ "dev": true }, "jest-haste-map": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.5.0.tgz", - "integrity": "sha512-IspOPnnBro8YfVYSw6yDRKh/TiCdRngjxeacCps1cQ9cgVN6+10JUcuJ1EabrgYLOATsIAigxA0rLR9x/YlrSA==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.6.1.tgz", + "integrity": "sha512-0m7f9PZXxOCk1gRACiVgX85knUKPKLPg4oRCjLoqIm9brTHXaorMA0JpmtmVkQiT8nmXyIVoZd/nnH1cfC33ig==", "dev": true, "requires": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.1", "@types/graceful-fs": "^4.1.3", "@types/node": "*", "anymatch": "^3.0.3", @@ -11331,47 +11315,47 @@ "fsevents": "^2.3.2", "graceful-fs": "^4.2.9", "jest-regex-util": "^29.4.3", - "jest-util": "^29.5.0", - "jest-worker": "^29.5.0", + "jest-util": "^29.6.1", + "jest-worker": "^29.6.1", "micromatch": "^4.0.4", "walker": "^1.0.8" } }, "jest-leak-detector": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.5.0.tgz", - "integrity": "sha512-u9YdeeVnghBUtpN5mVxjID7KbkKE1QU4f6uUwuxiY0vYRi9BUCLKlPEZfDGR67ofdFmDz9oPAy2G92Ujrntmow==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.6.1.tgz", + "integrity": "sha512-OrxMNyZirpOEwkF3UHnIkAiZbtkBWiye+hhBweCHkVbCgyEy71Mwbb5zgeTNYWJBi1qgDVfPC1IwO9dVEeTLwQ==", "dev": true, "requires": { "jest-get-type": "^29.4.3", - "pretty-format": "^29.5.0" + "pretty-format": "^29.6.1" } }, "jest-matcher-utils": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.5.0.tgz", - "integrity": "sha512-lecRtgm/rjIK0CQ7LPQwzCs2VwW6WAahA55YBuI+xqmhm7LAaxokSB8C97yJeYyT+HvQkH741StzpU41wohhWw==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.6.1.tgz", + "integrity": "sha512-SLaztw9d2mfQQKHmJXKM0HCbl2PPVld/t9Xa6P9sgiExijviSp7TnZZpw2Fpt+OI3nwUO/slJbOfzfUMKKC5QA==", "dev": true, "requires": { "chalk": "^4.0.0", - "jest-diff": "^29.5.0", + "jest-diff": "^29.6.1", "jest-get-type": "^29.4.3", - "pretty-format": "^29.5.0" + "pretty-format": "^29.6.1" } }, "jest-message-util": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.5.0.tgz", - "integrity": "sha512-Kijeg9Dag6CKtIDA7O21zNTACqD5MD/8HfIV8pdD94vFyFuer52SigdC3IQMhab3vACxXMiFk+yMHNdbqtyTGA==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.6.1.tgz", + "integrity": "sha512-KoAW2zAmNSd3Gk88uJ56qXUWbFk787QKmjjJVOjtGFmmGSZgDBrlIL4AfQw1xyMYPNVD7dNInfIbur9B2rd/wQ==", "dev": true, "requires": { "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.1", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", - "pretty-format": "^29.5.0", + "pretty-format": "^29.6.1", "slash": "^3.0.0", "stack-utils": "^2.0.3" }, @@ -11388,14 +11372,14 @@ } }, "jest-mock": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.5.0.tgz", - "integrity": "sha512-GqOzvdWDE4fAV2bWQLQCkujxYWL7RxjCnj71b5VhDAGOevB3qj3Ovg26A5NI84ZpODxyzaozXLOh2NCgkbvyaw==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.6.1.tgz", + "integrity": "sha512-brovyV9HBkjXAEdRooaTQK42n8usKoSRR3gihzUpYeV/vwqgSoNfrksO7UfSACnPmxasO/8TmHM3w9Hp3G1dgw==", "dev": true, "requires": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.1", "@types/node": "*", - "jest-util": "^29.5.0" + "jest-util": "^29.6.1" } }, "jest-pnp-resolver": { @@ -11412,57 +11396,57 @@ "dev": true }, "jest-resolve": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.5.0.tgz", - "integrity": "sha512-1TzxJ37FQq7J10jPtQjcc+MkCkE3GBpBecsSUWJ0qZNJpmg6m0D9/7II03yJulm3H/fvVjgqLh/k2eYg+ui52w==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.6.1.tgz", + "integrity": "sha512-AeRkyS8g37UyJiP9w3mmI/VXU/q8l/IH52vj/cDAyScDcemRbSBhfX/NMYIGilQgSVwsjxrCHf3XJu4f+lxCMg==", "dev": true, "requires": { "chalk": "^4.0.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.5.0", + "jest-haste-map": "^29.6.1", "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.5.0", - "jest-validate": "^29.5.0", + "jest-util": "^29.6.1", + "jest-validate": "^29.6.1", "resolve": "^1.20.0", "resolve.exports": "^2.0.0", "slash": "^3.0.0" } }, "jest-resolve-dependencies": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.5.0.tgz", - "integrity": "sha512-sjV3GFr0hDJMBpYeUuGduP+YeCRbd7S/ck6IvL3kQ9cpySYKqcqhdLLC2rFwrcL7tz5vYibomBrsFYWkIGGjOg==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.1.tgz", + "integrity": "sha512-BbFvxLXtcldaFOhNMXmHRWx1nXQO5LoXiKSGQcA1LxxirYceZT6ch8KTE1bK3X31TNG/JbkI7OkS/ABexVahiw==", "dev": true, "requires": { "jest-regex-util": "^29.4.3", - "jest-snapshot": "^29.5.0" + "jest-snapshot": "^29.6.1" } }, "jest-runner": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.5.0.tgz", - "integrity": "sha512-m7b6ypERhFghJsslMLhydaXBiLf7+jXy8FwGRHO3BGV1mcQpPbwiqiKUR2zU2NJuNeMenJmlFZCsIqzJCTeGLQ==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.6.1.tgz", + "integrity": "sha512-tw0wb2Q9yhjAQ2w8rHRDxteryyIck7gIzQE4Reu3JuOBpGp96xWgF0nY8MDdejzrLCZKDcp8JlZrBN/EtkQvPQ==", "dev": true, "requires": { - "@jest/console": "^29.5.0", - "@jest/environment": "^29.5.0", - "@jest/test-result": "^29.5.0", - "@jest/transform": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/console": "^29.6.1", + "@jest/environment": "^29.6.1", + "@jest/test-result": "^29.6.1", + "@jest/transform": "^29.6.1", + "@jest/types": "^29.6.1", "@types/node": "*", "chalk": "^4.0.0", "emittery": "^0.13.1", "graceful-fs": "^4.2.9", "jest-docblock": "^29.4.3", - "jest-environment-node": "^29.5.0", - "jest-haste-map": "^29.5.0", - "jest-leak-detector": "^29.5.0", - "jest-message-util": "^29.5.0", - "jest-resolve": "^29.5.0", - "jest-runtime": "^29.5.0", - "jest-util": "^29.5.0", - "jest-watcher": "^29.5.0", - "jest-worker": "^29.5.0", + "jest-environment-node": "^29.6.1", + "jest-haste-map": "^29.6.1", + "jest-leak-detector": "^29.6.1", + "jest-message-util": "^29.6.1", + "jest-resolve": "^29.6.1", + "jest-runtime": "^29.6.1", + "jest-util": "^29.6.1", + "jest-watcher": "^29.6.1", + "jest-worker": "^29.6.1", "p-limit": "^3.1.0", "source-map-support": "0.5.13" }, @@ -11479,31 +11463,31 @@ } }, "jest-runtime": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.5.0.tgz", - "integrity": "sha512-1Hr6Hh7bAgXQP+pln3homOiEZtCDZFqwmle7Ew2j8OlbkIu6uE3Y/etJQG8MLQs3Zy90xrp2C0BRrtPHG4zryw==", - "dev": true, - "requires": { - "@jest/environment": "^29.5.0", - "@jest/fake-timers": "^29.5.0", - "@jest/globals": "^29.5.0", - "@jest/source-map": "^29.4.3", - "@jest/test-result": "^29.5.0", - "@jest/transform": "^29.5.0", - "@jest/types": "^29.5.0", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.6.1.tgz", + "integrity": "sha512-D6/AYOA+Lhs5e5il8+5pSLemjtJezUr+8zx+Sn8xlmOux3XOqx4d8l/2udBea8CRPqqrzhsKUsN/gBDE/IcaPQ==", + "dev": true, + "requires": { + "@jest/environment": "^29.6.1", + "@jest/fake-timers": "^29.6.1", + "@jest/globals": "^29.6.1", + "@jest/source-map": "^29.6.0", + "@jest/test-result": "^29.6.1", + "@jest/transform": "^29.6.1", + "@jest/types": "^29.6.1", "@types/node": "*", "chalk": "^4.0.0", "cjs-module-lexer": "^1.0.0", "collect-v8-coverage": "^1.0.0", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.5.0", - "jest-message-util": "^29.5.0", - "jest-mock": "^29.5.0", + "jest-haste-map": "^29.6.1", + "jest-message-util": "^29.6.1", + "jest-mock": "^29.6.1", "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.5.0", - "jest-snapshot": "^29.5.0", - "jest-util": "^29.5.0", + "jest-resolve": "^29.6.1", + "jest-snapshot": "^29.6.1", + "jest-util": "^29.6.1", "slash": "^3.0.0", "strip-bom": "^4.0.0" }, @@ -11517,43 +11501,41 @@ } }, "jest-snapshot": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.5.0.tgz", - "integrity": "sha512-x7Wolra5V0tt3wRs3/ts3S6ciSQVypgGQlJpz2rsdQYoUKxMxPNaoHMGJN6qAuPJqS+2iQ1ZUn5kl7HCyls84g==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.6.1.tgz", + "integrity": "sha512-G4UQE1QQ6OaCgfY+A0uR1W2AY0tGXUPQpoUClhWHq1Xdnx1H6JOrC2nH5lqnOEqaDgbHFgIwZ7bNq24HpB180A==", "dev": true, "requires": { "@babel/core": "^7.11.6", "@babel/generator": "^7.7.2", "@babel/plugin-syntax-jsx": "^7.7.2", "@babel/plugin-syntax-typescript": "^7.7.2", - "@babel/traverse": "^7.7.2", "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.5.0", - "@jest/transform": "^29.5.0", - "@jest/types": "^29.5.0", - "@types/babel__traverse": "^7.0.6", + "@jest/expect-utils": "^29.6.1", + "@jest/transform": "^29.6.1", + "@jest/types": "^29.6.1", "@types/prettier": "^2.1.5", "babel-preset-current-node-syntax": "^1.0.0", "chalk": "^4.0.0", - "expect": "^29.5.0", + "expect": "^29.6.1", "graceful-fs": "^4.2.9", - "jest-diff": "^29.5.0", + "jest-diff": "^29.6.1", "jest-get-type": "^29.4.3", - "jest-matcher-utils": "^29.5.0", - "jest-message-util": "^29.5.0", - "jest-util": "^29.5.0", + "jest-matcher-utils": "^29.6.1", + "jest-message-util": "^29.6.1", + "jest-util": "^29.6.1", "natural-compare": "^1.4.0", - "pretty-format": "^29.5.0", - "semver": "^7.3.5" + "pretty-format": "^29.6.1", + "semver": "^7.5.3" } }, "jest-util": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.5.0.tgz", - "integrity": "sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.6.1.tgz", + "integrity": "sha512-NRFCcjc+/uO3ijUVyNOQJluf8PtGCe/W6cix36+M3cTFgiYqFOOW5MgN4JOOcvbUhcKTYVd1CvHz/LWi8d16Mg==", "dev": true, "requires": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.1", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", @@ -11570,17 +11552,17 @@ } }, "jest-validate": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.5.0.tgz", - "integrity": "sha512-pC26etNIi+y3HV8A+tUGr/lph9B18GnzSRAkPaaZJIE1eFdiYm6/CewuiJQ8/RlfHd1u/8Ioi8/sJ+CmbA+zAQ==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.6.1.tgz", + "integrity": "sha512-r3Ds69/0KCN4vx4sYAbGL1EVpZ7MSS0vLmd3gV78O+NAx3PDQQukRU5hNHPXlyqCgFY8XUk7EuTMLugh0KzahA==", "dev": true, "requires": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.1", "camelcase": "^6.2.0", "chalk": "^4.0.0", "jest-get-type": "^29.4.3", "leven": "^3.1.0", - "pretty-format": "^29.5.0" + "pretty-format": "^29.6.1" }, "dependencies": { "camelcase": { @@ -11592,29 +11574,29 @@ } }, "jest-watcher": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.5.0.tgz", - "integrity": "sha512-KmTojKcapuqYrKDpRwfqcQ3zjMlwu27SYext9pt4GlF5FUgB+7XE1mcCnSm6a4uUpFyQIkb6ZhzZvHl+jiBCiA==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.6.1.tgz", + "integrity": "sha512-d4wpjWTS7HEZPaaj8m36QiaP856JthRZkrgcIY/7ISoUWPIillrXM23WPboZVLbiwZBt4/qn2Jke84Sla6JhFA==", "dev": true, "requires": { - "@jest/test-result": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/test-result": "^29.6.1", + "@jest/types": "^29.6.1", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "emittery": "^0.13.1", - "jest-util": "^29.5.0", + "jest-util": "^29.6.1", "string-length": "^4.0.1" } }, "jest-worker": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.5.0.tgz", - "integrity": "sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.6.1.tgz", + "integrity": "sha512-U+Wrbca7S8ZAxAe9L6nb6g8kPdia5hj32Puu5iOqBCMTMWFHXuK6dOV2IFrpedbTV8fjMFLdWNttQTBL6u2MRA==", "dev": true, "requires": { "@types/node": "*", - "jest-util": "^29.5.0", + "jest-util": "^29.6.1", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" }, @@ -12169,9 +12151,9 @@ "dev": true }, "node-releases": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", - "integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==", + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.12.tgz", + "integrity": "sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==", "dev": true }, "normalize-package-data": { @@ -12301,17 +12283,17 @@ } }, "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", "dev": true, "requires": { + "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "type-check": "^0.4.0" } }, "p-limit": { @@ -12503,12 +12485,12 @@ "dev": true }, "pretty-format": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.5.0.tgz", - "integrity": "sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw==", + "version": "29.6.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", + "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", "dev": true, "requires": { - "@jest/schemas": "^29.4.3", + "@jest/schemas": "^29.6.0", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" }, @@ -12561,9 +12543,9 @@ "dev": true }, "pure-rand": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.1.tgz", - "integrity": "sha512-t+x1zEHDjBwkDGY5v5ApnZ/utcd4XYDiJsaQQoptTXgUXX95sDg1elCdJghzicm7n2mbCBJ3uYWr6M22SO19rg==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.2.tgz", + "integrity": "sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ==", "dev": true }, "queue-microtask": { @@ -12715,9 +12697,9 @@ "dev": true }, "resolve.exports": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.1.tgz", - "integrity": "sha512-OEJWVeimw8mgQuj3HfkNl4KqRevH7lzeQNaWRPfx0PPse7Jk6ozcsG4FKVgtzDsC1KUF+YlTHh17NcgHOPykLw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", "dev": true }, "restore-cursor": { @@ -13375,9 +13357,9 @@ } }, "update-browserslist-db": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", - "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", + "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", "dev": true, "requires": { "escalade": "^3.1.1", @@ -13476,12 +13458,6 @@ "is-typed-array": "^1.1.10" } }, - "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true - }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -13528,9 +13504,9 @@ "dev": true }, "yargs": { - "version": "17.7.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.1.tgz", - "integrity": "sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==", + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "requires": { "cliui": "^8.0.1", diff --git a/package.json b/package.json index 3d8161c..3f9023e 100644 --- a/package.json +++ b/package.json @@ -46,10 +46,10 @@ "devDependencies": { "@1password/front-end-style": "^6.0.1", "@types/jest": "^29.5.2", - "@types/node": "^20.3.3", + "@types/node": "^20.4.0", "@vercel/ncc": "^0.36.1", "husky": "^8.0.3", - "jest": "^29.5.0", + "jest": "^29.6.1", "lint-staged": "^13.2.3", "ts-jest": "^29.1.1", "typescript": "^5.1.6" From 6fea62bda4c754619889ec87399d5c781b7dce90 Mon Sep 17 00:00:00 2001 From: Dustin Ruetz Date: Thu, 6 Jul 2023 16:13:50 -0400 Subject: [PATCH 41/44] test: assertions for loadSecrets function --- src/utils.test.ts | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/src/utils.test.ts b/src/utils.test.ts index 9c3cc3d..d31b73a 100644 --- a/src/utils.test.ts +++ b/src/utils.test.ts @@ -1,6 +1,12 @@ import * as core from "@actions/core"; -import { read } from "@1password/op-js"; -import { extractSecret, unsetPrevious, validateAuth } from "./utils"; +import * as exec from "@actions/exec"; +import { read, setClientInfo } from "@1password/op-js"; +import { + extractSecret, + loadSecrets, + unsetPrevious, + validateAuth, +} from "./utils"; import { authErr, envConnectHost, @@ -10,6 +16,12 @@ import { } from "./constants"; jest.mock("@actions/core"); +jest.mock("@actions/exec", () => ({ + getExecOutput: jest.fn(() => ({ + stdout: "MOCK_SECRET", + })), +})); +jest.mock("@1password/op-js"); beforeEach(() => { jest.clearAllMocks(); @@ -113,6 +125,36 @@ describe("extractSecret", () => { }); }); +describe("loadSecrets", () => { + it("sets the client info and gets the executed output", async () => { + await loadSecrets(true); + + expect(setClientInfo).toHaveBeenCalledWith({ + name: "1Password GitHub Action", + id: "GHA", + }); + expect(exec.getExecOutput).toHaveBeenCalledWith('sh -c "op env ls"'); + expect(core.exportVariable).toHaveBeenCalledWith( + "OP_MANAGED_VARIABLES", + "MOCK_SECRET", + ); + }); + + describe("core.exportVariable", () => { + it("is called when shouldExportEnv is true", async () => { + await loadSecrets(true); + + expect(core.exportVariable).toHaveBeenCalledTimes(1); + }); + + it("is not called when shouldExportEnv is false", async () => { + await loadSecrets(false); + + expect(core.exportVariable).not.toHaveBeenCalled(); + }); + }); +}); + describe("unsetPrevious", () => { const testManagedEnv = "TEST_SECRET"; const testSecretValue = "MyS3cr#T"; From 62959c4f4e034ac09a80e3e9bbdec41686661483 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Fri, 7 Jul 2023 18:55:12 +0100 Subject: [PATCH 42/44] Improve loadSecrets function Return early if no env vars with valid secret references are found --- dist/index.js | 3 +++ src/utils.test.ts | 8 ++++++++ src/utils.ts | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/dist/index.js b/dist/index.js index 029f4e4..388e576 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4179,6 +4179,9 @@ const loadSecrets = async (shouldExportEnv) => { // Iterate over them to find 1Password references, extract the secret values, // and make them available in the next steps either as step outputs or as environment variables. const res = await exec.getExecOutput(`sh -c "op env ls"`); + if (res.stdout === "") { + return; + } const envs = res.stdout.replace(/\n+$/g, "").split(/\r?\n/); for (const envName of envs) { extractSecret(envName, shouldExportEnv); diff --git a/src/utils.test.ts b/src/utils.test.ts index d31b73a..ec003a6 100644 --- a/src/utils.test.ts +++ b/src/utils.test.ts @@ -140,6 +140,14 @@ describe("loadSecrets", () => { ); }); + it("return early if no env vars with secrets found", async () => { + (exec.getExecOutput as jest.Mock).mockReturnValueOnce({ stdout: "" }); + await loadSecrets(true); + + expect(exec.getExecOutput).toHaveBeenCalledWith('sh -c "op env ls"'); + expect(core.exportVariable).not.toHaveBeenCalled(); + }); + describe("core.exportVariable", () => { it("is called when shouldExportEnv is true", async () => { await loadSecrets(true); diff --git a/src/utils.ts b/src/utils.ts index a276408..02cd8cb 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -77,6 +77,11 @@ export const loadSecrets = async (shouldExportEnv: boolean): Promise => { // Iterate over them to find 1Password references, extract the secret values, // and make them available in the next steps either as step outputs or as environment variables. const res = await exec.getExecOutput(`sh -c "op env ls"`); + + if (res.stdout === "") { + return; + } + const envs = res.stdout.replace(/\n+$/g, "").split(/\r?\n/); for (const envName of envs) { extractSecret(envName, shouldExportEnv); From 54bdc9adc763fa2cf0f0d2a841aff54dee4ec695 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Mon, 19 Feb 2024 17:13:31 +0100 Subject: [PATCH 43/44] Update dependencies --- dist/index.js | 1071 +++++++++++++++++++++++++++++++++------------ package-lock.json | 315 +++++++------ package.json | 16 +- 3 files changed, 994 insertions(+), 408 deletions(-) diff --git a/dist/index.js b/dist/index.js index 64e77bc..d947cbb 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7276,6 +7276,7 @@ const MockAgent = __nccwpck_require__(6771) const MockPool = __nccwpck_require__(6193) const mockErrors = __nccwpck_require__(888) const ProxyAgent = __nccwpck_require__(7858) +const RetryHandler = __nccwpck_require__(2286) const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(1892) const DecoratorHandler = __nccwpck_require__(6930) const RedirectHandler = __nccwpck_require__(2860) @@ -7297,6 +7298,7 @@ module.exports.Pool = Pool module.exports.BalancedPool = BalancedPool module.exports.Agent = Agent module.exports.ProxyAgent = ProxyAgent +module.exports.RetryHandler = RetryHandler module.exports.DecoratorHandler = DecoratorHandler module.exports.RedirectHandler = RedirectHandler @@ -8193,6 +8195,7 @@ function request (opts, callback) { } module.exports = request +module.exports.RequestHandler = RequestHandler /***/ }), @@ -8571,6 +8574,8 @@ const kBody = Symbol('kBody') const kAbort = Symbol('abort') const kContentType = Symbol('kContentType') +const noop = () => {} + module.exports = class BodyReadable extends Readable { constructor ({ resume, @@ -8704,37 +8709,50 @@ module.exports = class BodyReadable extends Readable { return this[kBody] } - async dump (opts) { + dump (opts) { let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144 const signal = opts && opts.signal - const abortFn = () => { - this.destroy() - } - let signalListenerCleanup + if (signal) { - if (typeof signal !== 'object' || !('aborted' in signal)) { - throw new InvalidArgumentError('signal must be an AbortSignal') - } - util.throwIfAborted(signal) - signalListenerCleanup = util.addAbortListener(signal, abortFn) - } - try { - for await (const chunk of this) { - util.throwIfAborted(signal) - limit -= Buffer.byteLength(chunk) - if (limit < 0) { - return + try { + if (typeof signal !== 'object' || !('aborted' in signal)) { + throw new InvalidArgumentError('signal must be an AbortSignal') } + util.throwIfAborted(signal) + } catch (err) { + return Promise.reject(err) } - } catch { - util.throwIfAborted(signal) - } finally { - if (typeof signalListenerCleanup === 'function') { - signalListenerCleanup() - } else if (signalListenerCleanup) { - signalListenerCleanup[Symbol.dispose]() - } } + + if (this.closed) { + return Promise.resolve(null) + } + + return new Promise((resolve, reject) => { + const signalListenerCleanup = signal + ? util.addAbortListener(signal, () => { + this.destroy() + }) + : noop + + this + .on('close', function () { + signalListenerCleanup() + if (signal && signal.aborted) { + reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' })) + } else { + resolve(null) + } + }) + .on('error', noop) + .on('data', function (chunk) { + limit -= chunk.length + if (limit <= 0) { + this.destroy() + } + }) + .resume() + }) } } @@ -10111,12 +10129,12 @@ module.exports = { /***/ }), /***/ 9174: -/***/ ((module) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = { - kConstruct: Symbol('constructable') + kConstruct: (__nccwpck_require__(2785).kConstruct) } @@ -11100,11 +11118,9 @@ class Parser { socket[kReset] = true } - let pause - try { - pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false - } catch (err) { - util.destroy(socket, err) + const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false + + if (request.aborted) { return -1 } @@ -11151,13 +11167,8 @@ class Parser { this.bytesRead += buf.length - try { - if (request.onData(buf) === false) { - return constants.ERROR.PAUSED - } - } catch (err) { - util.destroy(socket, err) - return -1 + if (request.onData(buf) === false) { + return constants.ERROR.PAUSED } } @@ -11198,11 +11209,7 @@ class Parser { return -1 } - try { - request.onComplete(headers) - } catch (err) { - errorRequest(client, request, err) - } + request.onComplete(headers) client[kQueue][client[kRunningIdx]++] = null @@ -11366,7 +11373,7 @@ async function connect (client) { const idx = hostname.indexOf(']') assert(idx !== -1) - const ip = hostname.substr(1, idx - 1) + const ip = hostname.substring(1, idx) assert(net.isIP(ip)) hostname = ip @@ -11645,23 +11652,7 @@ function _resume (client, sync) { return } - if (util.isStream(request.body) && util.bodyLength(request.body) === 0) { - request.body - .on('data', /* istanbul ignore next */ function () { - /* istanbul ignore next */ - assert(false) - }) - .on('error', function (err) { - errorRequest(client, request, err) - }) - .on('end', function () { - util.destroy(this) - }) - - request.body = null - } - - if (client[kRunning] > 0 && + if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 && (util.isStream(request.body) || util.isAsyncIterable(request.body))) { // Request with stream or iterator body can error while other requests // are inflight and indirectly error those as well. @@ -11682,6 +11673,11 @@ function _resume (client, sync) { } } +// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2 +function shouldSendContentLength (method) { + return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT' +} + function write (client, request) { if (client[kHTTPConnVersion] === 'h2') { writeH2(client, client[kHTTP2Session], request) @@ -11710,7 +11706,9 @@ function write (client, request) { body.read(0) } - let contentLength = util.bodyLength(body) + const bodyLength = util.bodyLength(body) + + let contentLength = bodyLength if (contentLength === null) { contentLength = request.contentLength @@ -11725,7 +11723,9 @@ function write (client, request) { contentLength = null } - if (request.contentLength !== null && request.contentLength !== contentLength) { + // https://github.com/nodejs/undici/issues/2046 + // A user agent may send a Content-Length header with 0 value, this should be allowed. + if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) { if (client[kStrictContentLength]) { errorRequest(client, request, new RequestContentLengthMismatchError()) return false @@ -11806,7 +11806,7 @@ function write (client, request) { } /* istanbul ignore else: assertion */ - if (!body) { + if (!body || bodyLength === 0) { if (contentLength === 0) { socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1') } else { @@ -11872,6 +11872,7 @@ function writeH2 (client, session, request) { return false } + /** @type {import('node:http2').ClientHttp2Stream} */ let stream const h2State = client[kHTTP2SessionState] @@ -11946,7 +11947,9 @@ function writeH2 (client, session, request) { contentLength = null } - if (request.contentLength != null && request.contentLength !== contentLength) { + // https://github.com/nodejs/undici/issues/2046 + // A user agent may send a Content-Length header with 0 value, this should be allowed. + if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) { if (client[kStrictContentLength]) { errorRequest(client, request, new RequestContentLengthMismatchError()) return false @@ -11965,14 +11968,10 @@ function writeH2 (client, session, request) { const shouldEndStream = method === 'GET' || method === 'HEAD' if (expectContinue) { headers[HTTP2_HEADER_EXPECT] = '100-continue' - /** - * @type {import('node:http2').ClientHttp2Stream} - */ stream = session.request(headers, { endStream: shouldEndStream, signal }) stream.once('continue', writeBodyH2) } else { - /** @type {import('node:http2').ClientHttp2Stream} */ stream = session.request(headers, { endStream: shouldEndStream, signal @@ -11984,7 +11983,9 @@ function writeH2 (client, session, request) { ++h2State.openStreams stream.once('response', headers => { - if (request.onHeaders(Number(headers[HTTP2_HEADER_STATUS]), headers, stream.resume.bind(stream), '') === false) { + const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers + + if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) { stream.pause() } }) @@ -11994,13 +11995,17 @@ function writeH2 (client, session, request) { }) stream.on('data', (chunk) => { - if (request.onData(chunk) === false) stream.pause() + if (request.onData(chunk) === false) { + stream.pause() + } }) stream.once('close', () => { h2State.openStreams -= 1 // TODO(HTTP/2): unref only if current streams count is 0 - if (h2State.openStreams === 0) session.unref() + if (h2State.openStreams === 0) { + session.unref() + } }) stream.once('error', function (err) { @@ -12160,7 +12165,11 @@ function writeStream ({ h2stream, body, client, request, socket, contentLength, } } const onAbort = function () { - onFinished(new RequestAbortedError()) + if (finished) { + return + } + const err = new RequestAbortedError() + queueMicrotask(() => onFinished(err)) } const onFinished = function (err) { if (finished) { @@ -13758,6 +13767,19 @@ class ResponseExceededMaxSizeError extends UndiciError { } } +class RequestRetryError extends UndiciError { + constructor (message, code, { headers, data }) { + super(message) + Error.captureStackTrace(this, RequestRetryError) + this.name = 'RequestRetryError' + this.message = message || 'Request retry error' + this.code = 'UND_ERR_REQ_RETRY' + this.statusCode = code + this.data = data + this.headers = headers + } +} + module.exports = { HTTPParserError, UndiciError, @@ -13777,7 +13799,8 @@ module.exports = { NotSupportedError, ResponseContentLengthMismatchError, BalancedPoolMissingUpstreamError, - ResponseExceededMaxSizeError + ResponseExceededMaxSizeError, + RequestRetryError } @@ -13900,10 +13923,29 @@ class Request { this.method = method + this.abort = null + if (body == null) { this.body = null } else if (util.isStream(body)) { this.body = body + + const rState = this.body._readableState + if (!rState || !rState.autoDestroy) { + this.endHandler = function autoDestroy () { + util.destroy(this) + } + this.body.on('end', this.endHandler) + } + + this.errorHandler = err => { + if (this.abort) { + this.abort(err) + } else { + this.error = err + } + } + this.body.on('error', this.errorHandler) } else if (util.isBuffer(body)) { this.body = body.byteLength ? body : null } else if (ArrayBuffer.isView(body)) { @@ -13999,9 +14041,9 @@ class Request { onBodySent (chunk) { if (this[kHandler].onBodySent) { try { - this[kHandler].onBodySent(chunk) + return this[kHandler].onBodySent(chunk) } catch (err) { - this.onError(err) + this.abort(err) } } } @@ -14010,13 +14052,26 @@ class Request { if (channels.bodySent.hasSubscribers) { channels.bodySent.publish({ request: this }) } + + if (this[kHandler].onRequestSent) { + try { + return this[kHandler].onRequestSent() + } catch (err) { + this.abort(err) + } + } } onConnect (abort) { assert(!this.aborted) assert(!this.completed) - return this[kHandler].onConnect(abort) + if (this.error) { + abort(this.error) + } else { + this.abort = abort + return this[kHandler].onConnect(abort) + } } onHeaders (statusCode, headers, resume, statusText) { @@ -14027,14 +14082,23 @@ class Request { channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }) } - return this[kHandler].onHeaders(statusCode, headers, resume, statusText) + try { + return this[kHandler].onHeaders(statusCode, headers, resume, statusText) + } catch (err) { + this.abort(err) + } } onData (chunk) { assert(!this.aborted) assert(!this.completed) - return this[kHandler].onData(chunk) + try { + return this[kHandler].onData(chunk) + } catch (err) { + this.abort(err) + return false + } } onUpgrade (statusCode, headers, socket) { @@ -14045,16 +14109,26 @@ class Request { } onComplete (trailers) { + this.onFinally() + assert(!this.aborted) this.completed = true if (channels.trailers.hasSubscribers) { channels.trailers.publish({ request: this, trailers }) } - return this[kHandler].onComplete(trailers) + + try { + return this[kHandler].onComplete(trailers) + } catch (err) { + // TODO (fix): This might be a bad idea? + this.onError(err) + } } onError (error) { + this.onFinally() + if (channels.error.hasSubscribers) { channels.error.publish({ request: this, error }) } @@ -14063,9 +14137,22 @@ class Request { return } this.aborted = true + return this[kHandler].onError(error) } + onFinally () { + if (this.errorHandler) { + this.body.off('error', this.errorHandler) + this.errorHandler = null + } + + if (this.endHandler) { + this.body.off('end', this.endHandler) + this.endHandler = null + } + } + // TODO: adjust to support H2 addHeader (key, value) { processHeader(this, key, value) @@ -14287,7 +14374,9 @@ module.exports = { kHTTP2BuildRequest: Symbol('http2 build request'), kHTTP1BuildRequest: Symbol('http1 build request'), kHTTP2CopyHeaders: Symbol('http2 copy headers'), - kHTTPConnVersion: Symbol('http connection version') + kHTTPConnVersion: Symbol('http connection version'), + kRetryHandlerDefaultRetry: Symbol('retry agent default retry'), + kConstruct: Symbol('constructable') } @@ -14423,13 +14512,13 @@ function getHostname (host) { const idx = host.indexOf(']') assert(idx !== -1) - return host.substr(1, idx - 1) + return host.substring(1, idx) } const idx = host.indexOf(':') if (idx === -1) return host - return host.substr(0, idx) + return host.substring(0, idx) } // IP addresses are not valid server names per RFC6066 @@ -14488,7 +14577,7 @@ function isReadableAborted (stream) { } function destroy (stream, err) { - if (!isStream(stream) || isDestroyed(stream)) { + if (stream == null || !isStream(stream) || isDestroyed(stream)) { return } @@ -14526,7 +14615,7 @@ function parseHeaders (headers, obj = {}) { if (!val) { if (Array.isArray(headers[i + 1])) { - obj[key] = headers[i + 1] + obj[key] = headers[i + 1].map(x => x.toString('utf8')) } else { obj[key] = headers[i + 1].toString('utf8') } @@ -14729,16 +14818,7 @@ function throwIfAborted (signal) { } } -let events function addAbortListener (signal, listener) { - if (typeof Symbol.dispose === 'symbol') { - if (!events) { - events = __nccwpck_require__(2361) - } - if (typeof events.addAbortListener === 'function' && 'aborted' in signal) { - return events.addAbortListener(signal, listener) - } - } if ('addEventListener' in signal) { signal.addEventListener('abort', listener, { once: true }) return () => signal.removeEventListener('abort', listener) @@ -14762,6 +14842,21 @@ function toUSVString (val) { return `${val}` } +// Parsed accordingly to RFC 9110 +// https://www.rfc-editor.org/rfc/rfc9110#field.content-range +function parseRangeHeader (range) { + if (range == null || range === '') return { start: 0, end: null, size: null } + + const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null + return m + ? { + start: parseInt(m[1]), + end: m[2] ? parseInt(m[2]) : null, + size: m[3] ? parseInt(m[3]) : null + } + : null +} + const kEnumerableProperty = Object.create(null) kEnumerableProperty.enumerable = true @@ -14795,9 +14890,11 @@ module.exports = { buildURL, throwIfAborted, addAbortListener, + parseRangeHeader, nodeMajor, nodeMinor, - nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13) + nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13), + safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE'] } @@ -15059,6 +15156,8 @@ let ReadableStream = globalThis.ReadableStream /** @type {globalThis['File']} */ const File = NativeFile ?? UndiciFile +const textEncoder = new TextEncoder() +const textDecoder = new TextDecoder() // https://fetch.spec.whatwg.org/#concept-bodyinit-extract function extractBody (object, keepalive = false) { @@ -15082,7 +15181,7 @@ function extractBody (object, keepalive = false) { stream = new ReadableStream({ async pull (controller) { controller.enqueue( - typeof source === 'string' ? new TextEncoder().encode(source) : source + typeof source === 'string' ? textEncoder.encode(source) : source ) queueMicrotask(() => readableStreamClose(controller)) }, @@ -15152,7 +15251,6 @@ function extractBody (object, keepalive = false) { // - That the content-length is calculated in advance. // - And that all parts are pre-encoded and ready to be sent. - const enc = new TextEncoder() const blobParts = [] const rn = new Uint8Array([13, 10]) // '\r\n' length = 0 @@ -15160,13 +15258,13 @@ function extractBody (object, keepalive = false) { for (const [name, value] of object) { if (typeof value === 'string') { - const chunk = enc.encode(prefix + + const chunk = textEncoder.encode(prefix + `; name="${escape(normalizeLinefeeds(name))}"` + `\r\n\r\n${normalizeLinefeeds(value)}\r\n`) blobParts.push(chunk) length += chunk.byteLength } else { - const chunk = enc.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` + + const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` + (value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' + `Content-Type: ${ value.type || 'application/octet-stream' @@ -15180,7 +15278,7 @@ function extractBody (object, keepalive = false) { } } - const chunk = enc.encode(`--${boundary}--`) + const chunk = textEncoder.encode(`--${boundary}--`) blobParts.push(chunk) length += chunk.byteLength if (hasUnknownSizeValue) { @@ -15476,14 +15574,16 @@ function bodyMixinMethods (instance) { let text = '' // application/x-www-form-urlencoded parser will keep the BOM. // https://url.spec.whatwg.org/#concept-urlencoded-parser - const textDecoder = new TextDecoder('utf-8', { ignoreBOM: true }) + // Note that streaming decoder is stateful and cannot be reused + const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true }) + for await (const chunk of consumeBody(this[kState].body)) { if (!isUint8Array(chunk)) { throw new TypeError('Expected Uint8Array chunk') } - text += textDecoder.decode(chunk, { stream: true }) + text += streamingDecoder.decode(chunk, { stream: true }) } - text += textDecoder.decode() + text += streamingDecoder.decode() entries = new URLSearchParams(text) } catch (err) { // istanbul ignore next: Unclear when new URLSearchParams can fail on a string. @@ -15598,7 +15698,7 @@ function utf8DecodeBytes (buffer) { // 3. Process a queue with an instance of UTF-8’s // decoder, ioQueue, output, and "replacement". - const output = new TextDecoder().decode(buffer) + const output = textDecoder.decode(buffer) // 4. Return output. return output @@ -15645,10 +15745,12 @@ module.exports = { const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(1267) const corsSafeListedMethods = ['GET', 'HEAD', 'POST'] +const corsSafeListedMethodsSet = new Set(corsSafeListedMethods) const nullBodyStatus = [101, 204, 205, 304] const redirectStatus = [301, 302, 303, 307, 308] +const redirectStatusSet = new Set(redirectStatus) // https://fetch.spec.whatwg.org/#block-bad-port const badPorts = [ @@ -15660,6 +15762,8 @@ const badPorts = [ '10080' ] +const badPortsSet = new Set(badPorts) + // https://w3c.github.io/webappsec-referrer-policy/#referrer-policies const referrerPolicy = [ '', @@ -15672,10 +15776,12 @@ const referrerPolicy = [ 'strict-origin-when-cross-origin', 'unsafe-url' ] +const referrerPolicySet = new Set(referrerPolicy) const requestRedirect = ['follow', 'manual', 'error'] const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE'] +const safeMethodsSet = new Set(safeMethods) const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors'] @@ -15710,6 +15816,7 @@ const requestDuplex = [ // http://fetch.spec.whatwg.org/#forbidden-method const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK'] +const forbiddenMethodsSet = new Set(forbiddenMethods) const subresource = [ 'audio', @@ -15725,6 +15832,7 @@ const subresource = [ 'xslt', '' ] +const subresourceSet = new Set(subresource) /** @type {globalThis['DOMException']} */ const DOMException = globalThis.DOMException ?? (() => { @@ -15774,7 +15882,14 @@ module.exports = { nullBodyStatus, safeMethods, badPorts, - requestDuplex + requestDuplex, + subresourceSet, + badPortsSet, + redirectStatusSet, + corsSafeListedMethodsSet, + safeMethodsSet, + forbiddenMethodsSet, + referrerPolicySet } @@ -15904,17 +16019,14 @@ function dataURLProcessor (dataURL) { * @param {boolean} excludeFragment */ function URLSerializer (url, excludeFragment = false) { - const href = url.href - if (!excludeFragment) { - return href + return url.href } - const hash = href.lastIndexOf('#') - if (hash === -1) { - return href - } - return href.slice(0, hash) + const href = url.href + const hashLength = url.hash.length + + return hashLength === 0 ? href : href.substring(0, href.length - hashLength) } // https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points @@ -16429,6 +16541,7 @@ const { isBlobLike } = __nccwpck_require__(2538) const { webidl } = __nccwpck_require__(1744) const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685) const { kEnumerableProperty } = __nccwpck_require__(3983) +const encoder = new TextEncoder() class File extends Blob { constructor (fileBits, fileName, options = {}) { @@ -16702,7 +16815,7 @@ function processBlobParts (parts, options) { } // 3. Append the result of UTF-8 encoding s to bytes. - bytes.push(new TextEncoder().encode(s)) + bytes.push(encoder.encode(s)) } else if ( types.isAnyArrayBuffer(element) || types.isTypedArray(element) @@ -17093,7 +17206,7 @@ module.exports = { -const { kHeadersList } = __nccwpck_require__(2785) +const { kHeadersList, kConstruct } = __nccwpck_require__(2785) const { kGuard } = __nccwpck_require__(5861) const { kEnumerableProperty } = __nccwpck_require__(3983) const { @@ -17107,6 +17220,13 @@ const assert = __nccwpck_require__(9491) const kHeadersMap = Symbol('headers map') const kHeadersSortedMap = Symbol('headers map sorted') +/** + * @param {number} code + */ +function isHTTPWhiteSpaceCharCode (code) { + return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020 +} + /** * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize * @param {string} potentialValue @@ -17115,12 +17235,12 @@ function headerValueNormalize (potentialValue) { // To normalize a byte sequence potentialValue, remove // any leading and trailing HTTP whitespace bytes from // potentialValue. + let i = 0; let j = potentialValue.length + + while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j + while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i - // Trimming the end with `.replace()` and a RegExp is typically subject to - // ReDoS. This is safer and faster. - let i = potentialValue.length - while (/[\r\n\t ]/.test(potentialValue.charAt(--i))); - return potentialValue.slice(0, i + 1).replace(/^[\r\n\t ]+/, '') + return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j) } function fill (headers, object) { @@ -17129,7 +17249,8 @@ function fill (headers, object) { // 1. If object is a sequence, then for each header in object: // Note: webidl conversion to array has already been done. if (Array.isArray(object)) { - for (const header of object) { + for (let i = 0; i < object.length; ++i) { + const header = object[i] // 1. If header does not contain exactly two items, then throw a TypeError. if (header.length !== 2) { throw webidl.errors.exception({ @@ -17139,15 +17260,16 @@ function fill (headers, object) { } // 2. Append (header’s first item, header’s second item) to headers. - headers.append(header[0], header[1]) + appendHeader(headers, header[0], header[1]) } } else if (typeof object === 'object' && object !== null) { // Note: null should throw // 2. Otherwise, object is a record, then for each key → value in object, // append (key, value) to headers - for (const [key, value] of Object.entries(object)) { - headers.append(key, value) + const keys = Object.keys(object) + for (let i = 0; i < keys.length; ++i) { + appendHeader(headers, keys[i], object[keys[i]]) } } else { throw webidl.errors.conversionFailed({ @@ -17158,6 +17280,50 @@ function fill (headers, object) { } } +/** + * @see https://fetch.spec.whatwg.org/#concept-headers-append + */ +function appendHeader (headers, name, value) { + // 1. Normalize value. + value = headerValueNormalize(value) + + // 2. If name is not a header name or value is not a + // header value, then throw a TypeError. + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.append', + value: name, + type: 'header name' + }) + } else if (!isValidHeaderValue(value)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.append', + value, + type: 'header value' + }) + } + + // 3. If headers’s guard is "immutable", then throw a TypeError. + // 4. Otherwise, if headers’s guard is "request" and name is a + // forbidden header name, return. + // Note: undici does not implement forbidden header names + if (headers[kGuard] === 'immutable') { + throw new TypeError('immutable') + } else if (headers[kGuard] === 'request-no-cors') { + // 5. Otherwise, if headers’s guard is "request-no-cors": + // TODO + } + + // 6. Otherwise, if headers’s guard is "response" and name is a + // forbidden response-header name, return. + + // 7. Append (name, value) to headers’s header list. + return headers[kHeadersList].append(name, value) + + // 8. If headers’s guard is "request-no-cors", then remove + // privileged no-CORS request headers from headers +} + class HeadersList { /** @type {[string, string][]|null} */ cookies = null @@ -17166,7 +17332,7 @@ class HeadersList { if (init instanceof HeadersList) { this[kHeadersMap] = new Map(init[kHeadersMap]) this[kHeadersSortedMap] = init[kHeadersSortedMap] - this.cookies = init.cookies + this.cookies = init.cookies === null ? null : [...init.cookies] } else { this[kHeadersMap] = new Map(init) this[kHeadersSortedMap] = null @@ -17228,7 +17394,7 @@ class HeadersList { // the first such header to value and remove the // others. // 2. Otherwise, append header (name, value) to list. - return this[kHeadersMap].set(lowercaseName, { name, value }) + this[kHeadersMap].set(lowercaseName, { name, value }) } // https://fetch.spec.whatwg.org/#concept-header-list-delete @@ -17241,20 +17407,18 @@ class HeadersList { this.cookies = null } - return this[kHeadersMap].delete(name) + this[kHeadersMap].delete(name) } // https://fetch.spec.whatwg.org/#concept-header-list-get get (name) { - // 1. If list does not contain name, then return null. - if (!this.contains(name)) { - return null - } + const value = this[kHeadersMap].get(name.toLowerCase()) + // 1. If list does not contain name, then return null. // 2. Return the values of all headers in list whose name // is a byte-case-insensitive match for name, // separated from each other by 0x2C 0x20, in order. - return this[kHeadersMap].get(name.toLowerCase())?.value ?? null + return value === undefined ? null : value.value } * [Symbol.iterator] () { @@ -17280,6 +17444,9 @@ class HeadersList { // https://fetch.spec.whatwg.org/#headers-class class Headers { constructor (init = undefined) { + if (init === kConstruct) { + return + } this[kHeadersList] = new HeadersList() // The new Headers(init) constructor steps are: @@ -17303,43 +17470,7 @@ class Headers { name = webidl.converters.ByteString(name) value = webidl.converters.ByteString(value) - // 1. Normalize value. - value = headerValueNormalize(value) - - // 2. If name is not a header name or value is not a - // header value, then throw a TypeError. - if (!isValidHeaderName(name)) { - throw webidl.errors.invalidArgument({ - prefix: 'Headers.append', - value: name, - type: 'header name' - }) - } else if (!isValidHeaderValue(value)) { - throw webidl.errors.invalidArgument({ - prefix: 'Headers.append', - value, - type: 'header value' - }) - } - - // 3. If headers’s guard is "immutable", then throw a TypeError. - // 4. Otherwise, if headers’s guard is "request" and name is a - // forbidden header name, return. - // Note: undici does not implement forbidden header names - if (this[kGuard] === 'immutable') { - throw new TypeError('immutable') - } else if (this[kGuard] === 'request-no-cors') { - // 5. Otherwise, if headers’s guard is "request-no-cors": - // TODO - } - - // 6. Otherwise, if headers’s guard is "response" and name is a - // forbidden response-header name, return. - - // 7. Append (name, value) to headers’s header list. - // 8. If headers’s guard is "request-no-cors", then remove - // privileged no-CORS request headers from headers - return this[kHeadersList].append(name, value) + return appendHeader(this, name, value) } // https://fetch.spec.whatwg.org/#dom-headers-delete @@ -17384,7 +17515,7 @@ class Headers { // 7. Delete name from this’s header list. // 8. If this’s guard is "request-no-cors", then remove // privileged no-CORS request headers from this. - return this[kHeadersList].delete(name) + this[kHeadersList].delete(name) } // https://fetch.spec.whatwg.org/#dom-headers-get @@ -17477,7 +17608,7 @@ class Headers { // 7. Set (name, value) in this’s header list. // 8. If this’s guard is "request-no-cors", then remove // privileged no-CORS request headers from this - return this[kHeadersList].set(name, value) + this[kHeadersList].set(name, value) } // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie @@ -17513,7 +17644,8 @@ class Headers { const cookies = this[kHeadersList].cookies // 3. For each name of names: - for (const [name, value] of names) { + for (let i = 0; i < names.length; ++i) { + const [name, value] = names[i] // 1. If name is `set-cookie`, then: if (name === 'set-cookie') { // 1. Let values be a list of all values of headers in list whose name @@ -17521,8 +17653,8 @@ class Headers { // 2. For each value of values: // 1. Append (name, value) to headers. - for (const value of cookies) { - headers.push([name, value]) + for (let j = 0; j < cookies.length; ++j) { + headers.push([name, cookies[j]]) } } else { // 2. Otherwise: @@ -17546,6 +17678,12 @@ class Headers { keys () { webidl.brandCheck(this, Headers) + if (this[kGuard] === 'immutable') { + const value = this[kHeadersSortedMap] + return makeIterator(() => value, 'Headers', + 'key') + } + return makeIterator( () => [...this[kHeadersSortedMap].values()], 'Headers', @@ -17556,6 +17694,12 @@ class Headers { values () { webidl.brandCheck(this, Headers) + if (this[kGuard] === 'immutable') { + const value = this[kHeadersSortedMap] + return makeIterator(() => value, 'Headers', + 'value') + } + return makeIterator( () => [...this[kHeadersSortedMap].values()], 'Headers', @@ -17566,6 +17710,12 @@ class Headers { entries () { webidl.brandCheck(this, Headers) + if (this[kGuard] === 'immutable') { + const value = this[kHeadersSortedMap] + return makeIterator(() => value, 'Headers', + 'key+value') + } + return makeIterator( () => [...this[kHeadersSortedMap].values()], 'Headers', @@ -17696,11 +17846,11 @@ const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861) const assert = __nccwpck_require__(9491) const { safelyExtractBody } = __nccwpck_require__(1472) const { - redirectStatus, + redirectStatusSet, nullBodyStatus, - safeMethods, + safeMethodsSet, requestBodyHeader, - subresource, + subresourceSet, DOMException } = __nccwpck_require__(1037) const { kHeadersList } = __nccwpck_require__(2785) @@ -17712,6 +17862,7 @@ const { TransformStream } = __nccwpck_require__(5356) const { getGlobalDispatcher } = __nccwpck_require__(1892) const { webidl } = __nccwpck_require__(1744) const { STATUS_CODES } = __nccwpck_require__(3685) +const GET_OR_HEAD = ['GET', 'HEAD'] /** @type {import('buffer').resolveObjectURL} */ let resolveObjectURL @@ -17935,7 +18086,7 @@ function finalizeAndReportTiming (response, initiatorType = 'other') { } // 8. If response’s timing allow passed flag is not set, then: - if (!timingInfo.timingAllowPassed) { + if (!response.timingAllowPassed) { // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo. timingInfo = createOpaqueTimingInfo({ startTime: timingInfo.startTime @@ -18159,7 +18310,7 @@ function fetching ({ } // 15. If request is a subresource request, then: - if (subresource.includes(request.destination)) { + if (subresourceSet.has(request.destination)) { // TODO } @@ -18713,7 +18864,7 @@ async function httpFetch (fetchParams) { } // 8. If actualResponse’s status is a redirect status, then: - if (redirectStatus.includes(actualResponse.status)) { + if (redirectStatusSet.has(actualResponse.status)) { // 1. If actualResponse’s status is not 303, request’s body is not null, // and the connection uses HTTP/2, then user agents may, and are even // encouraged to, transmit an RST_STREAM frame. @@ -18831,7 +18982,7 @@ function httpRedirectFetch (fetchParams, response) { if ( ([301, 302].includes(actualResponse.status) && request.method === 'POST') || (actualResponse.status === 303 && - !['GET', 'HEAD'].includes(request.method)) + !GET_OR_HEAD.includes(request.method)) ) { // then: // 1. Set request’s method to `GET` and request’s body to null. @@ -18852,6 +19003,9 @@ function httpRedirectFetch (fetchParams, response) { // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name request.headersList.delete('authorization') + // https://fetch.spec.whatwg.org/#authentication-entries + request.headersList.delete('proxy-authorization', true) + // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement. request.headersList.delete('cookie') request.headersList.delete('host') @@ -19115,7 +19269,7 @@ async function httpNetworkOrCacheFetch ( // responses in httpCache, as per the "Invalidation" chapter of HTTP // Caching, and set storedResponse to null. [HTTP-CACHING] if ( - !safeMethods.includes(httpRequest.method) && + !safeMethodsSet.has(httpRequest.method) && forwardResponse.status >= 200 && forwardResponse.status <= 399 ) { @@ -19606,7 +19760,7 @@ async function httpNetworkFetch ( path: url.pathname + url.search, origin: url.origin, method: request.method, - body: fetchParams.controller.dispatcher.isMockActive ? request.body && request.body.source : body, + body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body, headers: request.headersList.entries, maxRedirections: 0, upgrade: request.mode === 'websocket' ? 'websocket' : undefined @@ -19651,7 +19805,7 @@ async function httpNetworkFetch ( location = val } - headers.append(key, val) + headers[kHeadersList].append(key, val) } } else { const keys = Object.keys(headersList) @@ -19665,7 +19819,7 @@ async function httpNetworkFetch ( location = val } - headers.append(key, val) + headers[kHeadersList].append(key, val) } } @@ -19675,7 +19829,7 @@ async function httpNetworkFetch ( const willFollow = request.redirect === 'follow' && location && - redirectStatus.includes(status) + redirectStatusSet.has(status) // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) { @@ -19769,7 +19923,7 @@ async function httpNetworkFetch ( const key = headersList[n + 0].toString('latin1') const val = headersList[n + 1].toString('latin1') - headers.append(key, val) + headers[kHeadersList].append(key, val) } resolve({ @@ -19811,11 +19965,12 @@ const { isValidHTTPToken, sameOrigin, normalizeMethod, - makePolicyContainer + makePolicyContainer, + normalizeMethodRecord } = __nccwpck_require__(2538) const { - forbiddenMethods, - corsSafeListedMethods, + forbiddenMethodsSet, + corsSafeListedMethodsSet, referrerPolicy, requestRedirect, requestMode, @@ -19828,13 +19983,12 @@ const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(5861) const { webidl } = __nccwpck_require__(1744) const { getGlobalOrigin } = __nccwpck_require__(1246) const { URLSerializer } = __nccwpck_require__(685) -const { kHeadersList } = __nccwpck_require__(2785) +const { kHeadersList, kConstruct } = __nccwpck_require__(2785) const assert = __nccwpck_require__(9491) const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(2361) let TransformStream = globalThis.TransformStream -const kInit = Symbol('init') const kAbortController = Symbol('abortController') const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { @@ -19845,7 +19999,7 @@ const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { class Request { // https://fetch.spec.whatwg.org/#dom-request constructor (input, init = {}) { - if (input === kInit) { + if (input === kConstruct) { return } @@ -19984,8 +20138,10 @@ class Request { urlList: [...request.urlList] }) + const initHasKey = Object.keys(init).length !== 0 + // 13. If init is not empty, then: - if (Object.keys(init).length > 0) { + if (initHasKey) { // 1. If request’s mode is "navigate", then set it to "same-origin". if (request.mode === 'navigate') { request.mode = 'same-origin' @@ -20100,7 +20256,7 @@ class Request { } // 23. If init["integrity"] exists, then set request’s integrity metadata to it. - if (init.integrity !== undefined && init.integrity != null) { + if (init.integrity != null) { request.integrity = String(init.integrity) } @@ -20116,16 +20272,16 @@ class Request { // 2. If method is not a method or method is a forbidden method, then // throw a TypeError. - if (!isValidHTTPToken(init.method)) { - throw TypeError(`'${init.method}' is not a valid HTTP method.`) + if (!isValidHTTPToken(method)) { + throw new TypeError(`'${method}' is not a valid HTTP method.`) } - if (forbiddenMethods.indexOf(method.toUpperCase()) !== -1) { - throw TypeError(`'${init.method}' HTTP method is unsupported.`) + if (forbiddenMethodsSet.has(method.toUpperCase())) { + throw new TypeError(`'${method}' HTTP method is unsupported.`) } // 3. Normalize method. - method = normalizeMethod(init.method) + method = normalizeMethodRecord[method] ?? normalizeMethod(method) // 4. Set request’s method to method. request.method = method @@ -20196,7 +20352,7 @@ class Request { // 30. Set this’s headers to a new Headers object with this’s relevant // Realm, whose header list is request’s header list and guard is // "request". - this[kHeaders] = new Headers() + this[kHeaders] = new Headers(kConstruct) this[kHeaders][kHeadersList] = request.headersList this[kHeaders][kGuard] = 'request' this[kHeaders][kRealm] = this[kRealm] @@ -20205,7 +20361,7 @@ class Request { if (mode === 'no-cors') { // 1. If this’s request’s method is not a CORS-safelisted method, // then throw a TypeError. - if (!corsSafeListedMethods.includes(request.method)) { + if (!corsSafeListedMethodsSet.has(request.method)) { throw new TypeError( `'${request.method} is unsupported in no-cors mode.` ) @@ -20216,25 +20372,25 @@ class Request { } // 32. If init is not empty, then: - if (Object.keys(init).length !== 0) { + if (initHasKey) { + /** @type {HeadersList} */ + const headersList = this[kHeaders][kHeadersList] // 1. Let headers be a copy of this’s headers and its associated header // list. - let headers = new Headers(this[kHeaders]) - // 2. If init["headers"] exists, then set headers to init["headers"]. - if (init.headers !== undefined) { - headers = init.headers - } + const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList) // 3. Empty this’s headers’s header list. - this[kHeaders][kHeadersList].clear() + headersList.clear() // 4. If headers is a Headers object, then for each header in its header // list, append header’s name/header’s value to this’s headers. - if (headers.constructor.name === 'Headers') { + if (headers instanceof HeadersList) { for (const [key, val] of headers) { - this[kHeaders].append(key, val) + headersList.append(key, val) } + // Note: Copy the `set-cookie` meta-data. + headersList.cookies = headers.cookies } else { // 5. Otherwise, fill this’s headers with headers. fillHeaders(this[kHeaders], headers) @@ -20523,10 +20679,10 @@ class Request { // 3. Let clonedRequestObject be the result of creating a Request object, // given clonedRequest, this’s headers’s guard, and this’s relevant Realm. - const clonedRequestObject = new Request(kInit) + const clonedRequestObject = new Request(kConstruct) clonedRequestObject[kState] = clonedRequest clonedRequestObject[kRealm] = this[kRealm] - clonedRequestObject[kHeaders] = new Headers() + clonedRequestObject[kHeaders] = new Headers(kConstruct) clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard] clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm] @@ -20766,7 +20922,7 @@ const { isomorphicEncode } = __nccwpck_require__(2538) const { - redirectStatus, + redirectStatusSet, nullBodyStatus, DOMException } = __nccwpck_require__(1037) @@ -20775,11 +20931,12 @@ const { webidl } = __nccwpck_require__(1744) const { FormData } = __nccwpck_require__(2015) const { getGlobalOrigin } = __nccwpck_require__(1246) const { URLSerializer } = __nccwpck_require__(685) -const { kHeadersList } = __nccwpck_require__(2785) +const { kHeadersList, kConstruct } = __nccwpck_require__(2785) const assert = __nccwpck_require__(9491) const { types } = __nccwpck_require__(3837) const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(5356).ReadableStream) +const textEncoder = new TextEncoder('utf-8') // https://fetch.spec.whatwg.org/#response-class class Response { @@ -20809,7 +20966,7 @@ class Response { } // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data. - const bytes = new TextEncoder('utf-8').encode( + const bytes = textEncoder.encode( serializeJavascriptValueToJSONString(data) ) @@ -20854,7 +21011,7 @@ class Response { } // 3. If status is not a redirect status, then throw a RangeError. - if (!redirectStatus.includes(status)) { + if (!redirectStatusSet.has(status)) { throw new RangeError('Invalid status code ' + status) } @@ -20895,7 +21052,7 @@ class Response { // 2. Set this’s headers to a new Headers object with this’s relevant // Realm, whose header list is this’s response’s header list and guard // is "response". - this[kHeaders] = new Headers() + this[kHeaders] = new Headers(kConstruct) this[kHeaders][kGuard] = 'response' this[kHeaders][kHeadersList] = this[kState].headersList this[kHeaders][kRealm] = this[kRealm] @@ -21265,11 +21422,7 @@ webidl.converters.XMLHttpRequestBodyInit = function (V) { return webidl.converters.Blob(V, { strict: false }) } - if ( - types.isAnyArrayBuffer(V) || - types.isTypedArray(V) || - types.isDataView(V) - ) { + if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) { return webidl.converters.BufferSource(V) } @@ -21350,7 +21503,7 @@ module.exports = { -const { redirectStatus, badPorts, referrerPolicy: referrerPolicyTokens } = __nccwpck_require__(1037) +const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1037) const { getGlobalOrigin } = __nccwpck_require__(1246) const { performance } = __nccwpck_require__(4074) const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3983) @@ -21379,7 +21532,7 @@ function responseURL (response) { // https://fetch.spec.whatwg.org/#concept-response-location-url function responseLocationURL (response, requestFragment) { // 1. If response’s status is not a redirect status, then return null. - if (!redirectStatus.includes(response.status)) { + if (!redirectStatusSet.has(response.status)) { return null } @@ -21414,7 +21567,7 @@ function requestBadPort (request) { // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port, // then return blocked. - if (urlIsHttpHttpsScheme(url) && badPorts.includes(url.port)) { + if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) { return 'blocked' } @@ -21453,52 +21606,57 @@ function isValidReasonPhrase (statusText) { return true } -function isTokenChar (c) { - return !( - c >= 0x7f || - c <= 0x20 || - c === '(' || - c === ')' || - c === '<' || - c === '>' || - c === '@' || - c === ',' || - c === ';' || - c === ':' || - c === '\\' || - c === '"' || - c === '/' || - c === '[' || - c === ']' || - c === '?' || - c === '=' || - c === '{' || - c === '}' - ) +/** + * @see https://tools.ietf.org/html/rfc7230#section-3.2.6 + * @param {number} c + */ +function isTokenCharCode (c) { + switch (c) { + case 0x22: + case 0x28: + case 0x29: + case 0x2c: + case 0x2f: + case 0x3a: + case 0x3b: + case 0x3c: + case 0x3d: + case 0x3e: + case 0x3f: + case 0x40: + case 0x5b: + case 0x5c: + case 0x5d: + case 0x7b: + case 0x7d: + // DQUOTE and "(),/:;<=>?@[\]{}" + return false + default: + // VCHAR %x21-7E + return c >= 0x21 && c <= 0x7e + } } -// See RFC 7230, Section 3.2.6. -// https://github.com/chromium/chromium/blob/d7da0240cae77824d1eda25745c4022757499131/third_party/blink/renderer/platform/network/http_parsers.cc#L321 +/** + * @param {string} characters + */ function isValidHTTPToken (characters) { - if (!characters || typeof characters !== 'string') { + if (characters.length === 0) { return false } for (let i = 0; i < characters.length; ++i) { - const c = characters.charCodeAt(i) - if (c > 0x7f || !isTokenChar(c)) { + if (!isTokenCharCode(characters.charCodeAt(i))) { return false } } return true } -// https://fetch.spec.whatwg.org/#header-name -// https://github.com/chromium/chromium/blob/b3d37e6f94f87d59e44662d6078f6a12de845d17/net/http/http_util.cc#L342 +/** + * @see https://fetch.spec.whatwg.org/#header-name + * @param {string} potentialValue + */ function isValidHeaderName (potentialValue) { - if (potentialValue.length === 0) { - return false - } - return isValidHTTPToken(potentialValue) } @@ -21556,7 +21714,7 @@ function setRequestReferrerPolicyOnRedirect (request, actualResponse) { // The left-most policy is the fallback. for (let i = policyHeader.length; i !== 0; i--) { const token = policyHeader[i - 1].trim() - if (referrerPolicyTokens.includes(token)) { + if (referrerPolicyTokens.has(token)) { policy = token break } @@ -22043,11 +22201,30 @@ function isCancelled (fetchParams) { fetchParams.controller.state === 'terminated' } -// https://fetch.spec.whatwg.org/#concept-method-normalize +const normalizeMethodRecord = { + delete: 'DELETE', + DELETE: 'DELETE', + get: 'GET', + GET: 'GET', + head: 'HEAD', + HEAD: 'HEAD', + options: 'OPTIONS', + OPTIONS: 'OPTIONS', + post: 'POST', + POST: 'POST', + put: 'PUT', + PUT: 'PUT' +} + +// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`. +Object.setPrototypeOf(normalizeMethodRecord, null) + +/** + * @see https://fetch.spec.whatwg.org/#concept-method-normalize + * @param {string} method + */ function normalizeMethod (method) { - return /^(DELETE|GET|HEAD|OPTIONS|POST|PUT)$/i.test(method) - ? method.toUpperCase() - : method + return normalizeMethodRecord[method.toLowerCase()] ?? method } // https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string @@ -22392,7 +22569,8 @@ module.exports = { urlIsLocal, urlHasHttpsScheme, urlIsHttpHttpsScheme, - readAllBytes + readAllBytes, + normalizeMethodRecord } @@ -22830,12 +23008,10 @@ webidl.converters.ByteString = function (V) { // 2. If the value of any element of x is greater than // 255, then throw a TypeError. for (let index = 0; index < x.length; index++) { - const charCode = x.charCodeAt(index) - - if (charCode > 255) { + if (x.charCodeAt(index) > 255) { throw new TypeError( 'Cannot convert argument to a ByteString because the character at ' + - `index ${index} has a value of ${charCode} which is greater than 255.` + `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.` ) } } @@ -24504,6 +24680,349 @@ function cleanRequestHeaders (headers, removeContent, unknownOrigin) { module.exports = RedirectHandler +/***/ }), + +/***/ 2286: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const assert = __nccwpck_require__(9491) + +const { kRetryHandlerDefaultRetry } = __nccwpck_require__(2785) +const { RequestRetryError } = __nccwpck_require__(8045) +const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(3983) + +function calculateRetryAfterHeader (retryAfter) { + const current = Date.now() + const diff = new Date(retryAfter).getTime() - current + + return diff +} + +class RetryHandler { + constructor (opts, handlers) { + const { retryOptions, ...dispatchOpts } = opts + const { + // Retry scoped + retry: retryFn, + maxRetries, + maxTimeout, + minTimeout, + timeoutFactor, + // Response scoped + methods, + errorCodes, + retryAfter, + statusCodes + } = retryOptions ?? {} + + this.dispatch = handlers.dispatch + this.handler = handlers.handler + this.opts = dispatchOpts + this.abort = null + this.aborted = false + this.retryOpts = { + retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry], + retryAfter: retryAfter ?? true, + maxTimeout: maxTimeout ?? 30 * 1000, // 30s, + timeout: minTimeout ?? 500, // .5s + timeoutFactor: timeoutFactor ?? 2, + maxRetries: maxRetries ?? 5, + // What errors we should retry + methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'], + // Indicates which errors to retry + statusCodes: statusCodes ?? [500, 502, 503, 504, 429], + // List of errors to retry + errorCodes: errorCodes ?? [ + 'ECONNRESET', + 'ECONNREFUSED', + 'ENOTFOUND', + 'ENETDOWN', + 'ENETUNREACH', + 'EHOSTDOWN', + 'EHOSTUNREACH', + 'EPIPE' + ] + } + + this.retryCount = 0 + this.start = 0 + this.end = null + this.etag = null + this.resume = null + + // Handle possible onConnect duplication + this.handler.onConnect(reason => { + this.aborted = true + if (this.abort) { + this.abort(reason) + } else { + this.reason = reason + } + }) + } + + onRequestSent () { + if (this.handler.onRequestSent) { + this.handler.onRequestSent() + } + } + + onUpgrade (statusCode, headers, socket) { + if (this.handler.onUpgrade) { + this.handler.onUpgrade(statusCode, headers, socket) + } + } + + onConnect (abort) { + if (this.aborted) { + abort(this.reason) + } else { + this.abort = abort + } + } + + onBodySent (chunk) { + if (this.handler.onBodySent) return this.handler.onBodySent(chunk) + } + + static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) { + const { statusCode, code, headers } = err + const { method, retryOptions } = opts + const { + maxRetries, + timeout, + maxTimeout, + timeoutFactor, + statusCodes, + errorCodes, + methods + } = retryOptions + let { counter, currentTimeout } = state + + currentTimeout = + currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout + + // Any code that is not a Undici's originated and allowed to retry + if ( + code && + code !== 'UND_ERR_REQ_RETRY' && + code !== 'UND_ERR_SOCKET' && + !errorCodes.includes(code) + ) { + cb(err) + return + } + + // If a set of method are provided and the current method is not in the list + if (Array.isArray(methods) && !methods.includes(method)) { + cb(err) + return + } + + // If a set of status code are provided and the current status code is not in the list + if ( + statusCode != null && + Array.isArray(statusCodes) && + !statusCodes.includes(statusCode) + ) { + cb(err) + return + } + + // If we reached the max number of retries + if (counter > maxRetries) { + cb(err) + return + } + + let retryAfterHeader = headers != null && headers['retry-after'] + if (retryAfterHeader) { + retryAfterHeader = Number(retryAfterHeader) + retryAfterHeader = isNaN(retryAfterHeader) + ? calculateRetryAfterHeader(retryAfterHeader) + : retryAfterHeader * 1e3 // Retry-After is in seconds + } + + const retryTimeout = + retryAfterHeader > 0 + ? Math.min(retryAfterHeader, maxTimeout) + : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout) + + state.currentTimeout = retryTimeout + + setTimeout(() => cb(null), retryTimeout) + } + + onHeaders (statusCode, rawHeaders, resume, statusMessage) { + const headers = parseHeaders(rawHeaders) + + this.retryCount += 1 + + if (statusCode >= 300) { + this.abort( + new RequestRetryError('Request failed', statusCode, { + headers, + count: this.retryCount + }) + ) + return false + } + + // Checkpoint for resume from where we left it + if (this.resume != null) { + this.resume = null + + if (statusCode !== 206) { + return true + } + + const contentRange = parseRangeHeader(headers['content-range']) + // If no content range + if (!contentRange) { + this.abort( + new RequestRetryError('Content-Range mismatch', statusCode, { + headers, + count: this.retryCount + }) + ) + return false + } + + // Let's start with a weak etag check + if (this.etag != null && this.etag !== headers.etag) { + this.abort( + new RequestRetryError('ETag mismatch', statusCode, { + headers, + count: this.retryCount + }) + ) + return false + } + + const { start, size, end = size } = contentRange + + assert(this.start === start, 'content-range mismatch') + assert(this.end == null || this.end === end, 'content-range mismatch') + + this.resume = resume + return true + } + + if (this.end == null) { + if (statusCode === 206) { + // First time we receive 206 + const range = parseRangeHeader(headers['content-range']) + + if (range == null) { + return this.handler.onHeaders( + statusCode, + rawHeaders, + resume, + statusMessage + ) + } + + const { start, size, end = size } = range + + assert( + start != null && Number.isFinite(start) && this.start !== start, + 'content-range mismatch' + ) + assert(Number.isFinite(start)) + assert( + end != null && Number.isFinite(end) && this.end !== end, + 'invalid content-length' + ) + + this.start = start + this.end = end + } + + // We make our best to checkpoint the body for further range headers + if (this.end == null) { + const contentLength = headers['content-length'] + this.end = contentLength != null ? Number(contentLength) : null + } + + assert(Number.isFinite(this.start)) + assert( + this.end == null || Number.isFinite(this.end), + 'invalid content-length' + ) + + this.resume = resume + this.etag = headers.etag != null ? headers.etag : null + + return this.handler.onHeaders( + statusCode, + rawHeaders, + resume, + statusMessage + ) + } + + const err = new RequestRetryError('Request failed', statusCode, { + headers, + count: this.retryCount + }) + + this.abort(err) + + return false + } + + onData (chunk) { + this.start += chunk.length + + return this.handler.onData(chunk) + } + + onComplete (rawTrailers) { + this.retryCount = 0 + return this.handler.onComplete(rawTrailers) + } + + onError (err) { + if (this.aborted || isDisturbed(this.opts.body)) { + return this.handler.onError(err) + } + + this.retryOpts.retry( + err, + { + state: { counter: this.retryCount++, currentTimeout: this.retryAfter }, + opts: { retryOptions: this.retryOpts, ...this.opts } + }, + onRetry.bind(this) + ) + + function onRetry (err) { + if (err != null || this.aborted || isDisturbed(this.opts.body)) { + return this.handler.onError(err) + } + + if (this.start !== 0) { + this.opts = { + ...this.opts, + headers: { + ...this.opts.headers, + range: `bytes=${this.start}-${this.end ?? ''}` + } + } + } + + try { + this.dispatch(this.opts, this) + } catch (err) { + this.handler.onError(err) + } + } + } +} + +module.exports = RetryHandler + + /***/ }), /***/ 8861: @@ -26301,7 +26820,7 @@ class Pool extends PoolBase { maxCachedSessions, allowH2, socketPath, - timeout: connectTimeout == null ? 10e3 : connectTimeout, + timeout: connectTimeout, ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined), ...connect }) @@ -26410,6 +26929,9 @@ class ProxyAgent extends DispatcherBase { this[kProxyTls] = opts.proxyTls this[kProxyHeaders] = opts.headers || {} + const resolvedUrl = new URL(opts.uri) + const { origin, port, host, username, password } = resolvedUrl + if (opts.auth && opts.token) { throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token') } else if (opts.auth) { @@ -26417,11 +26939,10 @@ class ProxyAgent extends DispatcherBase { this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}` } else if (opts.token) { this[kProxyHeaders]['proxy-authorization'] = opts.token + } else if (username && password) { + this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}` } - const resolvedUrl = new URL(opts.uri) - const { origin, port, host } = resolvedUrl - const connect = buildConnector({ ...opts.proxyTls }) this[kConnectEndpoint] = buildConnector({ ...opts.requestTls }) this[kClient] = clientFactory(resolvedUrl, { connect }) @@ -26445,7 +26966,7 @@ class ProxyAgent extends DispatcherBase { }) if (statusCode !== 200) { socket.on('error', () => {}).destroy() - callback(new RequestAbortedError('Proxy response !== 200 when HTTP Tunneling')) + callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`)) } if (opts.protocol !== 'https:') { callback(null, socket) diff --git a/package-lock.json b/package-lock.json index 5412b12..db0d4e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,20 +9,20 @@ "version": "1.2.0", "license": "MIT", "dependencies": { - "@1password/op-js": "^0.1.9", + "@1password/op-js": "^0.1.11", "@actions/core": "^1.10.1", "@actions/exec": "^1.1.1" }, "devDependencies": { "@1password/front-end-style": "^6.0.1", - "@types/jest": "^29.5.6", - "@types/node": "^20.4.0", - "@vercel/ncc": "^0.36.1", - "husky": "^8.0.3", + "@types/jest": "^29.5.12", + "@types/node": "^20.11.19", + "@vercel/ncc": "^0.38.1", + "husky": "^9.0.11", "jest": "^29.7.0", - "lint-staged": "^13.3.0", - "ts-jest": "^29.1.1", - "typescript": "~5.1.6" + "lint-staged": "^15.2.2", + "ts-jest": "^29.1.2", + "typescript": "^5.3.3" } }, "node_modules/@1password/front-end-style": { @@ -1591,9 +1591,9 @@ } }, "node_modules/@types/jest": { - "version": "29.5.6", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.6.tgz", - "integrity": "sha512-/t9NnzkOpXb4Nfvg17ieHE6EeSjDS2SGSpNYfoLbUAeL/EOueU/RSdOWFpfQTXBEM7BguYW1XQ0EbM+6RlIh6w==", + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", "dev": true, "dependencies": { "expect": "^29.0.0", @@ -1952,9 +1952,9 @@ } }, "node_modules/@vercel/ncc": { - "version": "0.36.1", - "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.36.1.tgz", - "integrity": "sha512-S4cL7Taa9yb5qbv+6wLgiKVZ03Qfkc4jGRuiUQMQ8HGBD5pcNRnHeYM33zBvJE4/zJGjJJ8GScB+WmTsn9mORw==", + "version": "0.38.1", + "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.1.tgz", + "integrity": "sha512-IBBb+iI2NLu4VQn3Vwldyi2QwaXt5+hTyh58ggAMoCGE6DJmPvwL3KPBWcJl1m9LYPChBLE980Jw+CS4Wokqxw==", "dev": true, "bin": { "ncc": "dist/ncc/cli.js" @@ -2594,16 +2594,16 @@ } }, "node_modules/cli-truncate": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", - "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz", + "integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==", "dev": true, "dependencies": { "slice-ansi": "^5.0.0", - "string-width": "^5.0.0" + "string-width": "^7.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -2716,9 +2716,9 @@ "dev": true }, "node_modules/commander": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", - "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", "dev": true, "engines": { "node": ">=16" @@ -2979,12 +2979,6 @@ "node": ">=6.0.0" } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, "node_modules/electron-to-chromium": { "version": "1.4.565", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.565.tgz", @@ -3004,9 +2998,9 @@ } }, "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", + "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==", "dev": true }, "node_modules/enquirer": { @@ -3996,6 +3990,18 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-east-asian-width": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz", + "integrity": "sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-intrinsic": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", @@ -4325,15 +4331,15 @@ } }, "node_modules/husky": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", - "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", + "version": "9.0.11", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz", + "integrity": "sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==", "dev": true, "bin": { - "husky": "lib/bin.js" + "husky": "bin.mjs" }, "engines": { - "node": ">=14" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/typicode" @@ -5730,12 +5736,12 @@ } }, "node_modules/lilconfig": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", - "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz", + "integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==", "dev": true, "engines": { - "node": ">=10" + "node": ">=14" } }, "node_modules/lines-and-columns": { @@ -5745,27 +5751,27 @@ "dev": true }, "node_modules/lint-staged": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.3.0.tgz", - "integrity": "sha512-mPRtrYnipYYv1FEE134ufbWpeggNTo+O/UPzngoaKzbzHAthvR55am+8GfHTnqNRQVRRrYQLGW9ZyUoD7DsBHQ==", + "version": "15.2.2", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.2.tgz", + "integrity": "sha512-TiTt93OPh1OZOsb5B7k96A/ATl2AjIZo+vnzFZ6oHK5FuTk63ByDtxGQpHm+kFETjEWqgkF95M8FRXKR/LEBcw==", "dev": true, "dependencies": { "chalk": "5.3.0", - "commander": "11.0.0", + "commander": "11.1.0", "debug": "4.3.4", - "execa": "7.2.0", - "lilconfig": "2.1.0", - "listr2": "6.6.1", + "execa": "8.0.1", + "lilconfig": "3.0.0", + "listr2": "8.0.1", "micromatch": "4.0.5", "pidtree": "0.6.0", "string-argv": "0.3.2", - "yaml": "2.3.1" + "yaml": "2.3.4" }, "bin": { "lint-staged": "bin/lint-staged.js" }, "engines": { - "node": "^16.14.0 || >=18.0.0" + "node": ">=18.12.0" }, "funding": { "url": "https://opencollective.com/lint-staged" @@ -5784,35 +5790,47 @@ } }, "node_modules/lint-staged/node_modules/execa": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-7.2.0.tgz", - "integrity": "sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", "dev": true, "dependencies": { "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^4.3.0", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", "is-stream": "^3.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^5.1.0", "onetime": "^6.0.0", - "signal-exit": "^3.0.7", + "signal-exit": "^4.1.0", "strip-final-newline": "^3.0.0" }, "engines": { - "node": "^14.18.0 || ^16.14.0 || >=18.0.0" + "node": ">=16.17" }, "funding": { "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/lint-staged/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/lint-staged/node_modules/human-signals": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", - "integrity": "sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", "dev": true, "engines": { - "node": ">=14.18.0" + "node": ">=16.17.0" } }, "node_modules/lint-staged/node_modules/is-stream": { @@ -5840,9 +5858,9 @@ } }, "node_modules/lint-staged/node_modules/npm-run-path": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", + "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", "dev": true, "dependencies": { "path-key": "^4.0.0" @@ -5881,6 +5899,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lint-staged/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/lint-staged/node_modules/strip-final-newline": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", @@ -5894,28 +5924,20 @@ } }, "node_modules/listr2": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-6.6.1.tgz", - "integrity": "sha512-+rAXGHh0fkEWdXBmX+L6mmfmXmXvDGEKzkjxO+8mP3+nI/r/CWznVBvsibXdxda9Zz0OW2e2ikphN3OwCT/jSg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.0.1.tgz", + "integrity": "sha512-ovJXBXkKGfq+CwmKTjluEqFi3p4h8xvkxGQQAQan22YCgef4KZ1mKGjzfGh6PL6AW5Csw0QiQPNuQyH+6Xk3hA==", "dev": true, "dependencies": { - "cli-truncate": "^3.1.0", + "cli-truncate": "^4.0.0", "colorette": "^2.0.20", "eventemitter3": "^5.0.1", - "log-update": "^5.0.1", + "log-update": "^6.0.0", "rfdc": "^1.3.0", - "wrap-ansi": "^8.1.0" + "wrap-ansi": "^9.0.0" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "enquirer": ">= 2.3.0 < 3" - }, - "peerDependenciesMeta": { - "enquirer": { - "optional": true - } + "node": ">=18.0.0" } }, "node_modules/locate-path": { @@ -5967,34 +5989,34 @@ "dev": true }, "node_modules/log-update": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/log-update/-/log-update-5.0.1.tgz", - "integrity": "sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.0.0.tgz", + "integrity": "sha512-niTvB4gqvtof056rRIrTZvjNYE4rCUzO6X/X+kYjd7WFxXeJ0NwEFnRxX6ehkvv3jTwrXnNdtAak5XYZuIyPFw==", "dev": true, "dependencies": { - "ansi-escapes": "^5.0.0", + "ansi-escapes": "^6.2.0", "cli-cursor": "^4.0.0", - "slice-ansi": "^5.0.0", - "strip-ansi": "^7.0.1", - "wrap-ansi": "^8.0.1" + "slice-ansi": "^7.0.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/log-update/node_modules/ansi-escapes": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", - "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.0.tgz", + "integrity": "sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==", "dev": true, "dependencies": { - "type-fest": "^1.0.2" + "type-fest": "^3.0.0" }, "engines": { - "node": ">=12" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -6012,6 +6034,49 @@ "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, + "node_modules/log-update/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-update/node_modules/is-fullwidth-code-point": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz", + "integrity": "sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==", + "dev": true, + "dependencies": { + "get-east-asian-width": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.0.tgz", + "integrity": "sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, "node_modules/log-update/node_modules/strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", @@ -6028,12 +6093,12 @@ } }, "node_modules/log-update/node_modules/type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", "dev": true, "engines": { - "node": ">=10" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -7203,9 +7268,9 @@ } }, "node_modules/rfdc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.1.tgz", + "integrity": "sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==", "dev": true }, "node_modules/rimraf": { @@ -7540,17 +7605,17 @@ } }, "node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.1.0.tgz", + "integrity": "sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==", "dev": true, "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -8007,9 +8072,9 @@ } }, "node_modules/ts-jest": { - "version": "29.1.1", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.1.tgz", - "integrity": "sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==", + "version": "29.1.2", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.2.tgz", + "integrity": "sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==", "dev": true, "dependencies": { "bs-logger": "0.x", @@ -8025,7 +8090,7 @@ "ts-jest": "cli.js" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^16.10.0 || ^18.0.0 || >=20.0.0" }, "peerDependencies": { "@babel/core": ">=7.0.0-beta.0 <8", @@ -8225,9 +8290,9 @@ } }, "node_modules/typescript": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -8253,9 +8318,9 @@ } }, "node_modules/undici": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.26.5.tgz", - "integrity": "sha512-cSb4bPFd5qgR7qr2jYAi0hlX9n5YKK2ONKkLFkxl+v/9BvC0sOpZjBHDBSXc5lWAf5ty9oZdRXytBIHzgUcerw==", + "version": "5.28.3", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.3.tgz", + "integrity": "sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA==", "dependencies": { "@fastify/busboy": "^2.0.0" }, @@ -8453,17 +8518,17 @@ } }, "node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", + "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", "dev": true, "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" @@ -8543,9 +8608,9 @@ "dev": true }, "node_modules/yaml": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz", - "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", + "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", "dev": true, "engines": { "node": ">= 14" diff --git a/package.json b/package.json index ae897ce..b6c4d55 100644 --- a/package.json +++ b/package.json @@ -39,20 +39,20 @@ }, "homepage": "https://github.com/1Password/load-secrets-action#readme", "dependencies": { - "@1password/op-js": "^0.1.9", + "@1password/op-js": "^0.1.11", "@actions/core": "^1.10.1", "@actions/exec": "^1.1.1" }, "devDependencies": { "@1password/front-end-style": "^6.0.1", - "@types/jest": "^29.5.6", - "@types/node": "^20.4.0", - "@vercel/ncc": "^0.36.1", - "husky": "^8.0.3", + "@types/jest": "^29.5.12", + "@types/node": "^20.11.19", + "@vercel/ncc": "^0.38.1", + "husky": "^9.0.11", "jest": "^29.7.0", - "lint-staged": "^13.3.0", - "ts-jest": "^29.1.1", - "typescript": "~5.1.6" + "lint-staged": "^15.2.2", + "ts-jest": "^29.1.2", + "typescript": "^5.3.3" }, "eslintConfig": { "extends": "./node_modules/@1password/front-end-style/eslintrc.yml", From b6d91a56d9003b91b827af4f6d73e4a1b93a6d0c Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Wed, 21 Feb 2024 17:11:17 +0100 Subject: [PATCH 44/44] Upgrade action to use Node20 --- .github/workflows/test.yml | 2 +- action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bfd8e40..5ca9977 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - run: npm ci - run: npm test diff --git a/action.yml b/action.yml index 08ea960..53f309b 100644 --- a/action.yml +++ b/action.yml @@ -12,5 +12,5 @@ inputs: description: Export the secrets as environment variables default: "true" runs: - using: "node16" + using: "node20" main: "dist/index.js"