From 9dabb60412d3d2d967a8d682f7ce01317af40514 Mon Sep 17 00:00:00 2001 From: Pavel Zwerschke Date: Tue, 6 Oct 2026 18:15:30 +0200 Subject: [PATCH] feat!: Add auth-logout input and run pixi auth status after login (#291) --- .github/workflows/test.yml | 57 +- README.md | 69 ++- action.yml | 14 +- dist/index.js | 30 +- dist/post.js | 1189 ++++++++++++++++++++++++++++++------ package.json | 2 +- src/main.ts | 3 +- src/options.ts | 34 +- src/post.ts | 25 +- 9 files changed, 1151 insertions(+), 272 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f8e22b5..38f213e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -651,7 +651,7 @@ jobs: # https://github.com/prefix-dev/pixi/issues/330 if: matrix.os == 'ubuntu-latest' - persist-credentials-false: + auth-logout-after-install: env: # We must set this environment variable explicitly to force all # operating systems to use the same storage mechanism. @@ -668,27 +668,13 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Move pixi.toml run: mv test/default/* . - # Sanity check: Login with default persist-credentials behavior + # auth-logout: post and never are tested in auth-logout-post-never - uses: ./ with: cache: false auth-host: https://custom-conda-registry.com auth-token: custom-token - - name: Assert that the credentials are stored - run: | - # For human log readers - cat "${RATTLER_AUTH_FILE}" - # Actual test - [ $(jq '."*.custom-conda-registry.com".BearerToken' -r "${RATTLER_AUTH_FILE}") = "custom-token" ] - - name: Clean up credentials file - run: rm "${RATTLER_AUTH_FILE}" - # Actual test: Login with persist-credentials: false - - uses: ./ - with: - cache: false - auth-host: https://custom-conda-registry.com - auth-token: custom-token - persist-credentials: false + auth-logout: after-install - name: Assert that the credentials are not stored anymore run: | # For human log readers @@ -697,6 +683,43 @@ jobs: # Actual test ! grep -q '"*.custom-conda-registry.com"' "${RATTLER_AUTH_FILE}" + auth-logout-post-never: + env: + # We must set this environment variable explicitly to force all + # operating systems to use the same storage mechanism. + # Otherwise, mac will use the keychain, which is more cumbersome to test. + RATTLER_AUTH_FILE: .rattler-credentials.json + strategy: + matrix: + # action-post-run doesn't support bash on windows + os: [ubuntu-latest, macos-latest] + auth-logout: [post, never] + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Move pixi.toml + run: mv test/default/* . + # post steps run in reverse order, so this runs after the post step of setup-pixi + - uses: lisanna-dettwyler/action-post-run@d053b9b43d788b87a409f6cdb3b6fc87c6c8a4fe # v3.1.0 + with: + run: | + set -euxo pipefail + cat "${RATTLER_AUTH_FILE}" + ${{ matrix.auth-logout == 'post' && '! ' || '' }}grep -q '"*.custom-conda-registry.com"' "${RATTLER_AUTH_FILE}" + - uses: ./ + with: + cache: false + auth-host: https://custom-conda-registry.com + auth-token: custom-token + auth-logout: ${{ matrix.auth-logout }} + - name: Assert that the credentials are still stored + run: | + cat "${RATTLER_AUTH_FILE}" + [ $(jq '."*.custom-conda-registry.com".BearerToken' -r "${RATTLER_AUTH_FILE}") = "custom-token" ] + auth-token-install: strategy: matrix: diff --git a/README.md b/README.md index 56441b9..596df0b 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ GitHub Action to set up the [pixi](https://github.com/prefix-dev/pixi) package m ## Usage ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: pixi-version: v0.66.0 @@ -35,7 +35,7 @@ GitHub Action to set up the [pixi](https://github.com/prefix-dev/pixi) package m > [!WARNING] > Since pixi is not yet stable, the API of this action may change between minor versions. -> Please pin the versions of this action to a specific version (i.e., `prefix-dev/setup-pixi@v0.10.2`) to avoid breaking changes. +> Please pin the versions of this action to a specific version (i.e., `prefix-dev/setup-pixi@v0.11.0`) to avoid breaking changes. > You can automatically update the version of this action by using [Dependabot](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot). > > Put the following in your `.github/dependabot.yml` file to enable Dependabot for your GitHub Actions: @@ -79,7 +79,7 @@ In order to not exceed the [10 GB cache size limit](https://docs.github.com/en/a This can be done by setting the `cache-write` argument. ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: cache: true cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} @@ -124,7 +124,7 @@ test: environment: [py311, py312] steps: - uses: actions/checkout@v4 - - uses: prefix-dev/setup-pixi@v0.10.2 + - uses: prefix-dev/setup-pixi@v0.11.0 with: environments: ${{ matrix.environment }} ``` @@ -134,7 +134,7 @@ test: The following example will install both the `py311` and the `py312` environment on the runner. ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: # separated by spaces environments: >- @@ -157,7 +157,7 @@ For instance, the `keyring`, or `gcloud` executables. The following example show By default, global environments are not cached. You can enable caching by setting the `global-cache` input to `true`. ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: global-environments: | google-cloud-sdk @@ -190,7 +190,7 @@ Specify the token using the `auth-token` input argument. This form of authentication (bearer token in the request headers) is mainly used at [prefix.dev](https://prefix.dev). ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: auth-host: prefix.dev auth-token: ${{ secrets.PREFIX_DEV_TOKEN }} @@ -202,7 +202,7 @@ Specify the username and password using the `auth-username` and `auth-password` This form of authentication (HTTP Basic Auth) is used in some enterprise environments with [artifactory](https://jfrog.com/artifactory) for example. ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: auth-host: custom-artifactory.com auth-username: ${{ secrets.PIXI_USERNAME }} @@ -215,7 +215,7 @@ Specify the conda-token using the `auth-conda-token` input argument. This form of authentication (token is encoded in URL: `https://my-quetz-instance.com/t//get/custom-channel`) is used at [anaconda.org](https://anaconda.org) or with [quetz instances](https://github.com/mamba-org/quetz). ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: auth-host: anaconda.org # or my-quetz-instance.com auth-conda-token: ${{ secrets.CONDA_TOKEN }} @@ -227,7 +227,7 @@ Specify the S3 key pair using the `auth-access-key-id` and `auth-secret-access-k You can also specify the session token using the `auth-session-token` input argument. ```yaml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: auth-host: s3://my-s3-bucket auth-s3-access-key-id: ${{ secrets.ACCESS_KEY_ID }} @@ -238,27 +238,36 @@ You can also specify the session token using the `auth-session-token` input argu See the [pixi documentation](https://pixi.sh/latest/advanced/s3) for more information about S3 authentication. -#### Restricting credentials to the install step +#### Logging out -If you only want pixi to use the authenticated remote channel during the action's own install step -(and not in any subsequent step of the workflow), set `persist-credentials: false`. The action will -then run `pixi auth logout ` after `pixi install` has completed but before the action -returns, so that later steps cannot reach the private channel anymore. +By default, the credentials stay available to all subsequent steps of the job and the action runs +`pixi auth logout ` in its post step at the end of the job. +You can change this behavior with the `auth-logout` input: + +- `post` (default): log out in the post step at the end of the job. +- `after-install`: log out at the end of the action, after `pixi install` has completed. + Use this if you only want pixi to use the authenticated remote channel during the action's own install step, + so that later steps cannot reach the private channel anymore. +- `never`: never log out, for example on self-hosted runners where the credentials should persist between jobs. ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: auth-host: prefix.dev auth-token: ${{ secrets.PREFIX_DEV_TOKEN }} - persist-credentials: false + auth-logout: after-install ``` +> [!NOTE] +> `auth-logout` replaces the removed `persist-credentials` input. +> Use `auth-logout: after-install` instead of `persist-credentials: false` and `auth-logout: never` instead of `persist-credentials: true`. + #### PyPI keyring provider You can specify whether to use keyring to look up credentials for PyPI. ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: pypi-keyring-provider: subprocess # one of 'subprocess', 'disabled' ``` @@ -326,7 +335,7 @@ To this end, `setup-pixi` adds all environment variables set when executing `pix As a result, all installed binaries can be accessed without having to call `pixi run`. ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: activate-environment: true ``` @@ -334,7 +343,7 @@ As a result, all installed binaries can be accessed without having to call `pixi If you are installing multiple environments, you will need to specify the name of the environment that you want to be activated. ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: environments: >- py311 @@ -351,7 +360,7 @@ You can specify whether `setup-pixi` should run `pixi install --frozen` or `pixi See the [official documentation](https://pixi.sh/latest/reference/cli/pixi/install/#update-options) for more information about the `--frozen` and `--locked` flags. ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: locked: true # or @@ -370,7 +379,7 @@ The first one is the debug logging of the action itself. This can be enabled by running the action with the `RUNNER_DEBUG` environment variable set to `true`. ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 env: RUNNER_DEBUG: true ``` @@ -388,7 +397,7 @@ The second type is the debug logging of the pixi executable. This can be specified by setting the `log-level` input. ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: # one of `q`, `default`, `v`, `vv`, or `vvv`. log-level: vvv @@ -414,7 +423,7 @@ If nothing is specified, `post-cleanup` will default to `false`. On self-hosted runners, you also might want to alter the default pixi install location to a temporary location. You can use `pixi-bin-path: ${{ runner.temp }}/bin/pixi` to do this. ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: post-cleanup: true # ${{ runner.temp }}\Scripts\pixi.exe on Windows @@ -430,7 +439,7 @@ You can also use a preinstalled local version of pixi on the runner by not setti This can be overwritten by setting the `manifest-path` input argument. ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: manifest-path: pyproject.toml ``` @@ -440,7 +449,7 @@ This can be overwritten by setting the `manifest-path` input argument. If you're working with a monorepo where your pixi project is in a subdirectory, you can use the `working-directory` input to specify where pixi should look for manifest files (`pixi.toml` or `pyproject.toml`). ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: working-directory: ./packages/my-project ``` @@ -459,7 +468,7 @@ This will make pixi look for `pixi.toml` or `pyproject.toml` in the `./packages/ You can combine `working-directory` with `manifest-path` if needed: ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: working-directory: ./packages/my-project manifest-path: custom-pixi.toml @@ -470,7 +479,7 @@ You can combine `working-directory` with `manifest-path` if needed: If you only want to install pixi and not install the current project, you can use the `run-install` option. ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: run-install: false ``` @@ -481,7 +490,7 @@ You can also download pixi from a custom URL by setting the `pixi-url` input arg Optionally, you can combine this with the `pixi-url-headers` input argument to supply additional headers for the download request, such as a bearer token. ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: pixi-url: https://pixi-mirror.example.com/releases/download/v0.48.0/pixi-x86_64-unknown-linux-musl pixi-url-headers: '{"Authorization": "Bearer ${{ secrets.PIXI_MIRROR_BEARER_TOKEN }}"}' @@ -497,7 +506,7 @@ It will be rendered with the following variables: By default, `pixi-url` is equivalent to the following template: ```yml -- uses: prefix-dev/setup-pixi@v0.10.2 +- uses: prefix-dev/setup-pixi@v0.11.0 with: pixi-url: | {{#if latest~}} diff --git a/action.yml b/action.yml index ff0b869..3ac6d65 100644 --- a/action.yml +++ b/action.yml @@ -78,12 +78,16 @@ inputs: description: Secret access key to use for S3 authentication. auth-s3-session-token: description: Session token to use for S3 authentication. - persist-credentials: + auth-logout: description: | - Whether to keep the credentials configured by `auth-host` available to subsequent workflow - steps. Defaults to `true`. If set to `false`, the action runs `pixi auth logout ` - after install, so that later steps cannot reach the private channel anymore. Requires - `auth-host`. + When to run `pixi auth logout `. Requires `auth-host`. + options: post, after-install, never + - `post` (default): The credentials stay available to all subsequent steps and are removed in the post step at the end of the job. + - `after-install`: The credentials are removed at the end of this action, so that later steps cannot reach the private channel anymore. + - `never`: The credentials are never removed. + persist-credentials: + description: Removed, use `auth-logout` instead. + deprecationMessage: '`persist-credentials` has been removed, use `auth-logout: after-install` (instead of `false`) or `auth-logout: never` (instead of `true`).' pypi-keyring-provider: description: | Specifies whether to use keyring to look up credentials for PyPI. diff --git a/dist/index.js b/dist/index.js index bfa2180..c65a024 100644 --- a/dist/index.js +++ b/dist/index.js @@ -38212,6 +38212,7 @@ var pixiCmd = (command, withManifestPath = true) => { var pixiPath = "pixi.toml"; var pyprojectPath = "pyproject.toml"; var logLevelSchema = _enum(["q", "default", "v", "vv", "vvv"]); +var authLogoutSchema = _enum(["post", "after-install", "never"]); var pypiKeyringProviderSchema = _enum(["disabled", "subprocess"]); var PATHS = { pixiBin: import_path.default.join(import_os4.default.homedir(), ".pixi", "bin", `pixi${import_os4.default.platform() === "win32" ? ".exe" : ""}`) @@ -38328,8 +38329,8 @@ var validateInputs = (inputs) => { if (inputs.authToken || inputs.authUsername || inputs.authCondaToken || inputs.authS3AccessKeyId) { throw new Error("You need to specify auth-host"); } - if (inputs.persistCredentials === false) { - throw new Error("Cannot use persist-credentials without specifying auth-host"); + if (inputs.authLogout) { + throw new Error("Cannot use auth-logout without specifying auth-host"); } } if (inputs.runInstall === false && inputs.environments) { @@ -38423,26 +38424,26 @@ var inferOptions = (inputs) => { } : void 0; const frozen = inputs.frozen ?? false; const locked = inputs.locked ?? (lockFileAvailable && !frozen); - const persistCredentials = inputs.persistCredentials ?? true; + const authLogout = inputs.authLogout ?? "post"; const auth = !inputs.authHost ? void 0 : inputs.authToken ? { host: inputs.authHost, token: inputs.authToken, - persistCredentials + logout: authLogout } : inputs.authCondaToken ? { host: inputs.authHost, condaToken: inputs.authCondaToken, - persistCredentials + logout: authLogout } : inputs.authUsername ? { host: inputs.authHost, username: inputs.authUsername, password: inputs.authPassword, - persistCredentials + logout: authLogout } : { host: inputs.authHost, s3AccessKeyId: inputs.authS3AccessKeyId, s3SecretAccessKey: inputs.authS3SecretAccessKey, s3SessionToken: inputs.authS3SessionToken, - persistCredentials + logout: authLogout }; const postCleanup = inputs.postCleanup ?? false; const pypiKeyringProvider = inputs.pypiKeyringProvider; @@ -38464,13 +38465,17 @@ var inferOptions = (inputs) => { globalCache, pixiBinPath, auth, - persistCredentials, postCleanup }; }; var assertOptions = (_options2) => { }; var getOptions = () => { + if (inputOrEnvironmentVariable("persist-credentials") !== void 0) { + throw new Error( + "`persist-credentials` has been removed, use `auth-logout: after-install` (instead of `false`) or `auth-logout: never` (instead of `true`)." + ); + } const inputs = { pixiVersion: parseOrUndefined( "pixi-version", @@ -38505,7 +38510,11 @@ var getOptions = () => { authS3AccessKeyId: parseOrUndefined("auth-s3-access-key-id", string2()), authS3SecretAccessKey: parseOrUndefined("auth-s3-secret-access-key", string2()), authS3SessionToken: parseOrUndefined("auth-s3-session-token", string2()), - persistCredentials: parseOrUndefinedJSON("persist-credentials", boolean2()), + authLogout: parseOrUndefined( + "auth-logout", + authLogoutSchema, + "auth-logout must be one of `post`, `after-install`, `never`." + ), pypiKeyringProvider: parseOrUndefined("pypi-keyring-provider", pypiKeyringProviderSchema), globalEnvironments: parseOrUndefinedMultilineList("global-environments", string2()), postCleanup: parseOrUndefinedJSON("post-cleanup", boolean2()) @@ -81290,11 +81299,12 @@ var pixiLogin = async () => { debug(`Logging in to ${auth.host} with conda token`); await execute(pixiCmd(`auth login --conda-token ${auth.condaToken} ${auth.host}`, false)); } + await execute(pixiCmd("auth status", false)); }); }; var pixiLogout = async () => { const auth = options.auth; - if (!auth || auth.persistCredentials) { + if (auth?.logout !== "after-install") { debug("Skipping pixi logout."); return; } diff --git a/dist/post.js b/dist/post.js index 19e9b75..209ddc3 100644 --- a/dist/post.js +++ b/dist/post.js @@ -59,7 +59,7 @@ var require_tunnel = __commonJS({ var tls = require("tls"); var http = require("http"); var https = require("https"); - var events = require("events"); + var events2 = require("events"); var assert2 = require("assert"); var util = require("util"); exports2.httpOverHttp = httpOverHttp2; @@ -111,7 +111,7 @@ var require_tunnel = __commonJS({ self.removeSocket(socket); }); } - util.inherits(TunnelingAgent, events.EventEmitter); + util.inherits(TunnelingAgent, events2.EventEmitter); TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { var self = this; var options2 = mergeOptions({ request: req }, self.options, toOptions(host, port, localAddress)); @@ -1123,14 +1123,14 @@ var require_util = __commonJS({ } const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80; let origin = url.origin != null ? url.origin : `${url.protocol || ""}//${url.hostname || ""}:${port}`; - let path3 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; + let path6 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } - if (path3 && path3[0] !== "/") { - path3 = `/${path3}`; + if (path6 && path6[0] !== "/") { + path6 = `/${path6}`; } - return new URL(`${origin}${path3}`); + return new URL(`${origin}${path6}`); } if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); @@ -1582,39 +1582,39 @@ var require_diagnostics = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path3, origin } + request: { method, path: path6, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path3); + debuglog("sending request to %s %s/%s", method, origin, path6); }); diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { const { - request: { method, path: path3, origin }, + request: { method, path: path6, origin }, response: { statusCode } } = evt; debuglog( "received response to %s %s/%s - HTTP %d", method, origin, - path3, + path6, statusCode ); }); diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { const { - request: { method, path: path3, origin } + request: { method, path: path6, origin } } = evt; - debuglog("trailers received from %s %s/%s", method, origin, path3); + debuglog("trailers received from %s %s/%s", method, origin, path6); }); diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { - request: { method, path: path3, origin }, + request: { method, path: path6, origin }, error: error3 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, - path3, + path6, error3.message ); }); @@ -1663,9 +1663,9 @@ var require_diagnostics = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path3, origin } + request: { method, path: path6, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path3); + debuglog("sending request to %s %s/%s", method, origin, path6); }); } diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { @@ -1729,7 +1729,7 @@ var require_request = __commonJS({ var kHandler = Symbol("handler"); var Request = class { constructor(origin, { - path: path3, + path: path6, method, body, headers, @@ -1744,11 +1744,11 @@ var require_request = __commonJS({ expectContinue, servername }, handler) { - if (typeof path3 !== "string") { + if (typeof path6 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path3[0] !== "/" && !(path3.startsWith("http://") || path3.startsWith("https://")) && method !== "CONNECT") { + } else if (path6[0] !== "/" && !(path6.startsWith("http://") || path6.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path3)) { + } else if (invalidPathRegex.test(path6)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -1814,7 +1814,7 @@ var require_request = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? buildURL(path3, query) : path3; + this.path = query ? buildURL(path6, query) : path6; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -2045,8 +2045,8 @@ var require_dispatcher = __commonJS({ "node_modules/.pnpm/undici@6.28.0/node_modules/undici/lib/dispatcher/dispatcher.js"(exports2, module2) { "use strict"; init_cjs_shims(); - var EventEmitter = require("events"); - var Dispatcher = class extends EventEmitter { + var EventEmitter2 = require("events"); + var Dispatcher = class extends EventEmitter2 { dispatch() { throw new Error("not implemented"); } @@ -2152,9 +2152,9 @@ var require_dispatcher_base = __commonJS({ } close(callback) { if (callback === void 0) { - return new Promise((resolve, reject) => { + return new Promise((resolve2, reject) => { this.close((err, data) => { - return err ? reject(err) : resolve(data); + return err ? reject(err) : resolve2(data); }); }); } @@ -2192,12 +2192,12 @@ var require_dispatcher_base = __commonJS({ err = null; } if (callback === void 0) { - return new Promise((resolve, reject) => { + return new Promise((resolve2, reject) => { this.destroy(err, (err2, data) => { return err2 ? ( /* istanbul ignore next: should never error */ reject(err2) - ) : resolve(data); + ) : resolve2(data); }); }); } @@ -4477,8 +4477,8 @@ var require_util2 = __commonJS({ function createDeferredPromise() { let res; let rej; - const promise = new Promise((resolve, reject) => { - res = resolve; + const promise = new Promise((resolve2, reject) => { + res = resolve2; rej = reject; }); return { promise, resolve: res, reject: rej }; @@ -6478,7 +6478,7 @@ var require_client_h1 = __commonJS({ return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request) { - const { method, path: path3, host, upgrade, blocking, reset } = request; + const { method, path: path6, host, upgrade, blocking, reset } = request; let { body, headers, contentLength } = request; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; if (util.isFormDataLike(body)) { @@ -6553,7 +6553,7 @@ var require_client_h1 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path3} HTTP/1.1\r + let header = `${method} ${path6} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -6740,12 +6740,12 @@ upgrade: ${upgrade}\r cb(); } } - const waitForDrain = () => new Promise((resolve, reject) => { + const waitForDrain = () => new Promise((resolve2, reject) => { assert2(callback === null); if (socket[kError]) { reject(socket[kError]); } else { - callback = resolve; + callback = resolve2; } }); socket.on("close", onDrain).on("drain", onDrain); @@ -7080,7 +7080,7 @@ var require_client_h2 = __commonJS({ } function writeH2(client, request) { const session = client[kHTTP2Session]; - const { method, path: path3, host, upgrade, expectContinue, signal, headers: reqHeaders } = request; + const { method, path: path6, host, upgrade, expectContinue, signal, headers: reqHeaders } = request; let { body } = request; if (upgrade) { util.errorRequest(client, request, new Error("Upgrade not supported for H2")); @@ -7147,7 +7147,7 @@ var require_client_h2 = __commonJS({ }); return true; } - headers[HTTP2_HEADER_PATH] = path3; + headers[HTTP2_HEADER_PATH] = path6; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -7383,12 +7383,12 @@ var require_client_h2 = __commonJS({ cb(); } } - const waitForDrain = () => new Promise((resolve, reject) => { + const waitForDrain = () => new Promise((resolve2, reject) => { assert2(callback === null); if (socket[kError]) { reject(socket[kError]); } else { - callback = resolve; + callback = resolve2; } }); h2stream.on("close", onDrain).on("drain", onDrain); @@ -7501,9 +7501,9 @@ var require_redirect_handler = __commonJS({ return this.handler.onHeaders(statusCode, headers, resume, statusText); } const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path3 = search ? `${pathname}${search}` : pathname; + const path6 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path3; + this.opts.path = path6; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -7869,16 +7869,16 @@ var require_client = __commonJS({ return this[kNeedDrain] < 2; } async [kClose]() { - return new Promise((resolve) => { + return new Promise((resolve2) => { if (this[kSize]) { - this[kClosedResolve] = resolve; + this[kClosedResolve] = resolve2; } else { - resolve(null); + resolve2(null); } }); } async [kDestroy](err) { - return new Promise((resolve) => { + return new Promise((resolve2) => { const requests = this[kQueue].splice(this[kPendingIdx]); for (let i = 0; i < requests.length; i++) { const request = requests[i]; @@ -7889,7 +7889,7 @@ var require_client = __commonJS({ this[kClosedResolve](); this[kClosedResolve] = null; } - resolve(null); + resolve2(null); }; if (this[kHTTPContext]) { this[kHTTPContext].destroy(err, callback); @@ -7940,7 +7940,7 @@ var require_client = __commonJS({ }); } try { - const socket = await new Promise((resolve, reject) => { + const socket = await new Promise((resolve2, reject) => { client[kConnector]({ host, hostname, @@ -7952,7 +7952,7 @@ var require_client = __commonJS({ if (err) { reject(err); } else { - resolve(socket2); + resolve2(socket2); } }); }); @@ -8292,8 +8292,8 @@ var require_pool_base = __commonJS({ if (this[kQueue].isEmpty()) { await Promise.all(this[kClients].map((c) => c.close())); } else { - await new Promise((resolve) => { - this[kClosedResolve] = resolve; + await new Promise((resolve2) => { + this[kClosedResolve] = resolve2; }); } } @@ -8749,10 +8749,10 @@ var require_proxy_agent = __commonJS({ }; const { origin, - path: path3 = "/", + path: path6 = "/", headers = {} } = opts; - opts.path = origin + path3; + opts.path = origin + path6; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL2(origin); headers.host = host; @@ -9558,7 +9558,7 @@ var require_readable = __commonJS({ if (this._readableState.closeEmitted) { return null; } - return await new Promise((resolve, reject) => { + return await new Promise((resolve2, reject) => { if (this[kContentLength] > limit) { this.destroy(new AbortError()); } @@ -9571,7 +9571,7 @@ var require_readable = __commonJS({ if (signal?.aborted) { reject(signal.reason ?? new AbortError()); } else { - resolve(null); + resolve2(null); } }).on("error", noop).on("data", function(chunk) { limit -= chunk.length; @@ -9590,7 +9590,7 @@ var require_readable = __commonJS({ } async function consume(stream, type) { assert2(!stream[kConsume]); - return new Promise((resolve, reject) => { + return new Promise((resolve2, reject) => { if (isUnusable(stream)) { const rState = stream._readableState; if (rState.destroyed && rState.closeEmitted === false) { @@ -9607,7 +9607,7 @@ var require_readable = __commonJS({ stream[kConsume] = { type, stream, - resolve, + resolve: resolve2, reject, length: 0, body: [] @@ -9677,18 +9677,18 @@ var require_readable = __commonJS({ return buffer; } function consumeEnd(consume2) { - const { type, body, resolve, stream, length } = consume2; + const { type, body, resolve: resolve2, stream, length } = consume2; try { if (type === "text") { - resolve(chunksDecode(body, length)); + resolve2(chunksDecode(body, length)); } else if (type === "json") { - resolve(JSON.parse(chunksDecode(body, length))); + resolve2(JSON.parse(chunksDecode(body, length))); } else if (type === "arrayBuffer") { - resolve(chunksConcat(body, length).buffer); + resolve2(chunksConcat(body, length).buffer); } else if (type === "blob") { - resolve(new Blob(body, { type: stream[kContentType] })); + resolve2(new Blob(body, { type: stream[kContentType] })); } else if (type === "bytes") { - resolve(chunksConcat(body, length)); + resolve2(chunksConcat(body, length)); } consumeFinish(consume2); } catch (err) { @@ -9948,9 +9948,9 @@ var require_api_request = __commonJS({ }; function request(opts, callback) { if (callback === void 0) { - return new Promise((resolve, reject) => { + return new Promise((resolve2, reject) => { request.call(this, opts, (err, data) => { - return err ? reject(err) : resolve(data); + return err ? reject(err) : resolve2(data); }); }); } @@ -10176,9 +10176,9 @@ var require_api_stream = __commonJS({ }; function stream(opts, factory, callback) { if (callback === void 0) { - return new Promise((resolve, reject) => { + return new Promise((resolve2, reject) => { stream.call(this, opts, factory, (err, data) => { - return err ? reject(err) : resolve(data); + return err ? reject(err) : resolve2(data); }); }); } @@ -10465,9 +10465,9 @@ var require_api_upgrade = __commonJS({ }; function upgrade(opts, callback) { if (callback === void 0) { - return new Promise((resolve, reject) => { + return new Promise((resolve2, reject) => { upgrade.call(this, opts, (err, data) => { - return err ? reject(err) : resolve(data); + return err ? reject(err) : resolve2(data); }); }); } @@ -10560,9 +10560,9 @@ var require_api_connect = __commonJS({ }; function connect(opts, callback) { if (callback === void 0) { - return new Promise((resolve, reject) => { + return new Promise((resolve2, reject) => { connect.call(this, opts, (err, data) => { - return err ? reject(err) : resolve(data); + return err ? reject(err) : resolve2(data); }); }); } @@ -10732,20 +10732,20 @@ var require_mock_utils = __commonJS({ } return true; } - function safeUrl(path3) { - if (typeof path3 !== "string") { - return path3; + function safeUrl(path6) { + if (typeof path6 !== "string") { + return path6; } - const pathSegments = path3.split("?"); + const pathSegments = path6.split("?"); if (pathSegments.length !== 2) { - return path3; + return path6; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path3, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path3); + function matchKey(mockDispatch2, { path: path6, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path6); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -10767,7 +10767,7 @@ var require_mock_utils = __commonJS({ function getMockDispatch(mockDispatches, key) { const basePath = key.query ? buildURL(key.path, key.query) : key.path; const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path3 }) => matchValue(safeUrl(path3), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path6 }) => matchValue(safeUrl(path6), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -10805,9 +10805,9 @@ var require_mock_utils = __commonJS({ } } function buildKey(opts) { - const { path: path3, method, body, headers, query } = opts; + const { path: path6, method, body, headers, query } = opts; return { - path: path3, + path: path6, method, body, headers, @@ -11275,10 +11275,10 @@ var require_pending_interceptors_formatter = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path3, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path6, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path3, + Path: path6, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, @@ -12072,10 +12072,10 @@ var require_headers = __commonJS({ const lowercaseName = isLowerCase ? name : name.toLowerCase(); const exists2 = this[kHeadersMap].get(lowercaseName); if (exists2) { - const delimiter = lowercaseName === "cookie" ? "; " : ", "; + const delimiter2 = lowercaseName === "cookie" ? "; " : ", "; this[kHeadersMap].set(lowercaseName, { name: exists2.name, - value: `${exists2.value}${delimiter}${value}` + value: `${exists2.value}${delimiter2}${value}` }); } else { this[kHeadersMap].set(lowercaseName, { name, value }); @@ -14473,7 +14473,7 @@ var require_fetch = __commonJS({ function dispatch({ body }) { const url = requestCurrentURL(request); const agent = fetchParams.controller.dispatcher; - return new Promise((resolve, reject) => agent.dispatch( + return new Promise((resolve2, reject) => agent.dispatch( { path: url.pathname + url.search, origin: url.origin, @@ -14549,7 +14549,7 @@ var require_fetch = __commonJS({ } } const onError = this.onError.bind(this); - resolve({ + resolve2({ status, statusText, headersList, @@ -14595,7 +14595,7 @@ var require_fetch = __commonJS({ for (let i = 0; i < rawHeaders.length; i += 2) { headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString("latin1"), true); } - resolve({ + resolve2({ status, statusText: STATUS_CODES[status], headersList, @@ -16217,9 +16217,9 @@ var require_util6 = __commonJS({ } } } - function validateCookiePath(path3) { - for (let i = 0; i < path3.length; ++i) { - const code = path3.charCodeAt(i); + function validateCookiePath(path6) { + for (let i = 0; i < path6.length; ++i) { + const code = path6.charCodeAt(i); if (code < 32 || // exclude CTLs (0-31) code > 126 || // exclude DEL and non-ascii code === 59) { @@ -18403,8 +18403,8 @@ var require_util8 = __commonJS({ return true; } function delay(ms) { - return new Promise((resolve) => { - setTimeout(resolve, ms).unref(); + return new Promise((resolve2) => { + setTimeout(resolve2, ms).unref(); }); } module2.exports = { @@ -19020,11 +19020,11 @@ var require_undici = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path3 = opts.path; + let path6 = opts.path; if (!opts.path.startsWith("/")) { - path3 = `/${path3}`; + path6 = `/${path6}`; } - url = new URL(util.parseOrigin(url).origin + path3); + url = new URL(util.parseOrigin(url).origin + path6); } else { if (!opts) { opts = typeof url === "object" ? url : {}; @@ -19226,15 +19226,15 @@ var require_lib = __commonJS({ "use strict"; init_cjs_shims(); var { isexe, sync: isexeSync } = require_index_min(); - var { join, delimiter, sep, posix } = require("path"); + var { join: join3, delimiter: delimiter2, sep: sep2, posix } = require("path"); var isWindows = process.platform === "win32"; - var rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? "" : sep}]`.replace(/(\\)/g, "\\$1")); + var rSlash = new RegExp(`[${posix.sep}${sep2 === posix.sep ? "" : sep2}]`.replace(/(\\)/g, "\\$1")); var rRel = new RegExp(`^\\.${rSlash.source}`); var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }); var getPathInfo = (cmd, { path: optPath = process.env.PATH, pathExt: optPathExt = process.env.PATHEXT, - delimiter: optDelimiter = delimiter + delimiter: optDelimiter = delimiter2 }) => { const pathEnv = cmd.match(rSlash) ? [""] : [ // windows always checks the cwd first @@ -19255,7 +19255,7 @@ var require_lib = __commonJS({ var getPathPart = (raw, cmd) => { const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw; const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : ""; - return prefix + join(pathPart, cmd); + return prefix + join3(pathPart, cmd); }; var which3 = async (cmd, opt = {}) => { const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); @@ -20488,13 +20488,13 @@ var require_ast = __commonJS({ helperExpression: function helperExpression(node2) { return node2.type === "SubExpression" || (node2.type === "MustacheStatement" || node2.type === "BlockStatement") && !!(node2.params && node2.params.length || node2.hash); }, - scopedId: function scopedId(path3) { - return /^\.|this\b/.test(path3.original); + scopedId: function scopedId(path6) { + return /^\.|this\b/.test(path6.original); }, // an ID is simple if it only has one part, and that part is not // `..` or `this`. - simpleId: function simpleId(path3) { - return path3.parts.length === 1 && !AST.helpers.scopedId(path3) && !path3.depth; + simpleId: function simpleId(path6) { + return path6.parts.length === 1 && !AST.helpers.scopedId(path6) && !path6.depth; } } }; @@ -21568,12 +21568,12 @@ var require_helpers2 = __commonJS({ loc }; } - function prepareMustache(path3, params, hash, open3, strip, locInfo) { + function prepareMustache(path6, params, hash, open3, strip, locInfo) { var escapeFlag = open3.charAt(3) || open3.charAt(2), escaped = escapeFlag !== "{" && escapeFlag !== "&"; var decorator = /\*/.test(open3); return { type: decorator ? "Decorator" : "MustacheStatement", - path: path3, + path: path6, params, hash, escaped, @@ -21893,9 +21893,9 @@ var require_compiler = __commonJS({ }, DecoratorBlock: function DecoratorBlock(decorator) { var program = decorator.program && this.compileProgram(decorator.program); - var params = this.setupFullMustacheParams(decorator, program, void 0), path3 = decorator.path; + var params = this.setupFullMustacheParams(decorator, program, void 0), path6 = decorator.path; this.useDecorators = true; - this.opcode("registerDecorator", params.length, path3.original); + this.opcode("registerDecorator", params.length, path6.original); }, PartialStatement: function PartialStatement(partial2) { this.usePartial = true; @@ -21959,46 +21959,46 @@ var require_compiler = __commonJS({ } }, ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) { - var path3 = sexpr.path, name = path3.parts[0], isBlock = program != null || inverse != null; - this.opcode("getContext", path3.depth); + var path6 = sexpr.path, name = path6.parts[0], isBlock = program != null || inverse != null; + this.opcode("getContext", path6.depth); this.opcode("pushProgram", program); this.opcode("pushProgram", inverse); - path3.strict = true; - this.accept(path3); + path6.strict = true; + this.accept(path6); this.opcode("invokeAmbiguous", name, isBlock); }, simpleSexpr: function simpleSexpr(sexpr) { - var path3 = sexpr.path; - path3.strict = true; - this.accept(path3); + var path6 = sexpr.path; + path6.strict = true; + this.accept(path6); this.opcode("resolvePossibleLambda"); }, helperSexpr: function helperSexpr(sexpr, program, inverse) { - var params = this.setupFullMustacheParams(sexpr, program, inverse), path3 = sexpr.path, name = path3.parts[0]; + var params = this.setupFullMustacheParams(sexpr, program, inverse), path6 = sexpr.path, name = path6.parts[0]; if (this.options.knownHelpers[name]) { this.opcode("invokeKnownHelper", params.length, name); } else if (this.options.knownHelpersOnly) { throw new _exception2["default"]("You specified knownHelpersOnly, but used the unknown helper " + name, sexpr); } else { - path3.strict = true; - path3.falsy = true; - this.accept(path3); - this.opcode("invokeHelper", params.length, path3.original, _ast2["default"].helpers.simpleId(path3)); + path6.strict = true; + path6.falsy = true; + this.accept(path6); + this.opcode("invokeHelper", params.length, path6.original, _ast2["default"].helpers.simpleId(path6)); } }, - PathExpression: function PathExpression(path3) { - this.addDepth(path3.depth); - this.opcode("getContext", path3.depth); - var name = path3.parts[0], scoped = _ast2["default"].helpers.scopedId(path3), blockParamId = !path3.depth && !scoped && this.blockParamIndex(name); + PathExpression: function PathExpression(path6) { + this.addDepth(path6.depth); + this.opcode("getContext", path6.depth); + var name = path6.parts[0], scoped = _ast2["default"].helpers.scopedId(path6), blockParamId = !path6.depth && !scoped && this.blockParamIndex(name); if (blockParamId) { - this.opcode("lookupBlockParam", blockParamId, path3.parts); + this.opcode("lookupBlockParam", blockParamId, path6.parts); } else if (!name) { this.opcode("pushContext"); - } else if (path3.data) { + } else if (path6.data) { this.options.data = true; - this.opcode("lookupData", path3.depth, path3.parts, path3.strict); + this.opcode("lookupData", path6.depth, path6.parts, path6.strict); } else { - this.opcode("lookupOnContext", path3.parts, path3.falsy, path3.strict, scoped); + this.opcode("lookupOnContext", path6.parts, path6.falsy, path6.strict, scoped); } }, StringLiteral: function StringLiteral(string3) { @@ -22354,16 +22354,16 @@ var require_util9 = __commonJS({ } exports2.urlGenerate = urlGenerate; function normalize(aPath) { - var path3 = aPath; + var path6 = aPath; var url = urlParse(aPath); if (url) { if (!url.path) { return aPath; } - path3 = url.path; + path6 = url.path; } - var isAbsolute = exports2.isAbsolute(path3); - var parts = path3.split(/\/+/); + var isAbsolute = exports2.isAbsolute(path6); + var parts = path6.split(/\/+/); for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { part = parts[i]; if (part === ".") { @@ -22380,18 +22380,18 @@ var require_util9 = __commonJS({ } } } - path3 = parts.join("/"); - if (path3 === "") { - path3 = isAbsolute ? "/" : "."; + path6 = parts.join("/"); + if (path6 === "") { + path6 = isAbsolute ? "/" : "."; } if (url) { - url.path = path3; + url.path = path6; return urlGenerate(url); } - return path3; + return path6; } exports2.normalize = normalize; - function join(aRoot, aPath) { + function join3(aRoot, aPath) { if (aRoot === "") { aRoot = "."; } @@ -22423,11 +22423,11 @@ var require_util9 = __commonJS({ } return joined; } - exports2.join = join; + exports2.join = join3; exports2.isAbsolute = function(aPath) { return aPath.charAt(0) === "/" || urlRegexp.test(aPath); }; - function relative(aRoot, aPath) { + function relative2(aRoot, aPath) { if (aRoot === "") { aRoot = "."; } @@ -22446,7 +22446,7 @@ var require_util9 = __commonJS({ } return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); } - exports2.relative = relative; + exports2.relative = relative2; var supportsNullProto = (function() { var obj = /* @__PURE__ */ Object.create(null); return !("__proto__" in obj); @@ -22596,7 +22596,7 @@ var require_util9 = __commonJS({ parsed.path = parsed.path.substring(0, index + 1); } } - sourceURL = join(urlGenerate(parsed), sourceURL); + sourceURL = join3(urlGenerate(parsed), sourceURL); } return normalize(sourceURL); } @@ -24744,9 +24744,9 @@ var require_javascript_compiler = __commonJS({ } hash.values[key] = value; }, - pushId: function pushId(type, name, child) { + pushId: function pushId(type, name, child2) { if (type === "BlockParam") { - this.pushStackLiteral("blockParams[" + name[0] + "].path[" + name[1] + "]" + (child ? " + " + JSON.stringify("." + child) : "")); + this.pushStackLiteral("blockParams[" + name[0] + "].path[" + name[1] + "]" + (child2 ? " + " + JSON.stringify("." + child2) : "")); } else if (type === "PathExpression") { this.pushString(name); } else if (type === "SubExpression") { @@ -24758,40 +24758,40 @@ var require_javascript_compiler = __commonJS({ // HELPERS compiler: JavaScriptCompiler, compileChildren: function compileChildren(environment, options2) { - var children = environment.children, child = void 0, compiler = void 0; + var children = environment.children, child2 = void 0, compiler = void 0; for (var i = 0, l = children.length; i < l; i++) { - child = children[i]; + child2 = children[i]; compiler = new this.compiler(); - var existing = this.matchExistingProgram(child); + var existing = this.matchExistingProgram(child2); if (existing == null) { var index = this.context.programs.push("") - 1; - child.index = index; - child.name = "program" + index; - this.context.programs[index] = compiler.compile(child, options2, this.context, !this.precompile); + child2.index = index; + child2.name = "program" + index; + this.context.programs[index] = compiler.compile(child2, options2, this.context, !this.precompile); this.context.decorators[index] = compiler.decorators; - this.context.environments[index] = child; + this.context.environments[index] = child2; this.useDepths = this.useDepths || compiler.useDepths; this.useBlockParams = this.useBlockParams || compiler.useBlockParams; - child.useDepths = this.useDepths; - child.useBlockParams = this.useBlockParams; + child2.useDepths = this.useDepths; + child2.useBlockParams = this.useBlockParams; } else { - child.index = existing.index; - child.name = "program" + existing.index; + child2.index = existing.index; + child2.name = "program" + existing.index; this.useDepths = this.useDepths || existing.useDepths; this.useBlockParams = this.useBlockParams || existing.useBlockParams; } } }, - matchExistingProgram: function matchExistingProgram(child) { + matchExistingProgram: function matchExistingProgram(child2) { for (var i = 0, len = this.context.environments.length; i < len; i++) { var environment = this.context.environments[i]; - if (environment && environment.equals(child)) { + if (environment && environment.equals(child2)) { return environment; } } }, programExpression: function programExpression(guid2) { - var child = this.environment.children[guid2], programParams = [child.index, "data", child.blockParams]; + var child2 = this.environment.children[guid2], programParams = [child2.index, "data", child2.blockParams]; if (this.useBlockParams || this.useDepths) { programParams.push("blockParams"); } @@ -25191,8 +25191,8 @@ var require_printer = __commonJS({ return this.accept(sexpr.path) + " " + params + hash; }; PrintVisitor.prototype.PathExpression = function(id) { - var path3 = id.parts.join("/"); - return (id.data ? "@" : "") + "PATH:" + path3; + var path6 = id.parts.join("/"); + return (id.data ? "@" : "") + "PATH:" + path6; }; PrintVisitor.prototype.StringLiteral = function(string3) { return '"' + string3.value + '"'; @@ -25288,6 +25288,9 @@ function issueCommand(command, properties, message) { const cmd = new Command(command, properties, message); process.stdout.write(cmd.toString() + os.EOL); } +function issue(name, message = "") { + issueCommand(name, {}, message); +} var CMD_STRING = "::"; var Command = class { constructor(command, properties, message) { @@ -25332,7 +25335,7 @@ function escapeProperty(s) { init_cjs_shims(); // node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/core.js -var os3 = __toESM(require("os"), 1); +var os4 = __toESM(require("os"), 1); // node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/oidc-utils.js init_cjs_shims(); @@ -25407,11 +25410,11 @@ var import_os = require("os"); var import_fs = require("fs"); var __awaiter = function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve) { - resolve(value); + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); }); } - return new (P || (P = Promise))(function(resolve, reject) { + return new (P || (P = Promise))(function(resolve2, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -25427,7 +25430,7 @@ var __awaiter = function(thisArg, _arguments, P, generator) { } } function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -25698,25 +25701,754 @@ init_cjs_shims(); // node_modules/.pnpm/@actions+exec@3.0.0/node_modules/@actions/exec/lib/toolrunner.js init_cjs_shims(); +var os2 = __toESM(require("os"), 1); +var events = __toESM(require("events"), 1); +var child = __toESM(require("child_process"), 1); +var path3 = __toESM(require("path"), 1); // node_modules/.pnpm/@actions+io@3.0.2/node_modules/@actions/io/lib/io.js init_cjs_shims(); +var path2 = __toESM(require("path"), 1); // node_modules/.pnpm/@actions+io@3.0.2/node_modules/@actions/io/lib/io-util.js init_cjs_shims(); var fs = __toESM(require("fs"), 1); +var path = __toESM(require("path"), 1); +var __awaiter2 = function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; var { chmod, copyFile, lstat, mkdir, open, readdir, rename, rm, rmdir, stat, symlink, unlink } = fs.promises; var IS_WINDOWS = process.platform === "win32"; var READONLY = fs.constants.O_RDONLY; +function exists(fsPath) { + return __awaiter2(this, void 0, void 0, function* () { + try { + yield stat(fsPath); + } catch (err) { + if (err.code === "ENOENT") { + return false; + } + throw err; + } + return true; + }); +} +function isRooted(p) { + p = normalizeSeparators(p); + if (!p) { + throw new Error('isRooted() parameter "p" cannot be empty'); + } + if (IS_WINDOWS) { + return p.startsWith("\\") || /^[A-Z]:/i.test(p); + } + return p.startsWith("/"); +} +function tryGetExecutablePath(filePath, extensions) { + return __awaiter2(this, void 0, void 0, function* () { + let stats = void 0; + try { + stats = yield stat(filePath); + } catch (err) { + if (err.code !== "ENOENT") { + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } + } + if (stats && stats.isFile()) { + if (IS_WINDOWS) { + const upperExt = path.extname(filePath).toUpperCase(); + if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { + return filePath; + } + } else { + if (isUnixExecutable(stats)) { + return filePath; + } + } + } + const originalFilePath = filePath; + for (const extension of extensions) { + filePath = originalFilePath + extension; + stats = void 0; + try { + stats = yield stat(filePath); + } catch (err) { + if (err.code !== "ENOENT") { + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } + } + if (stats && stats.isFile()) { + if (IS_WINDOWS) { + try { + const directory = path.dirname(filePath); + const upperName = path.basename(filePath).toUpperCase(); + for (const actualName of yield readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path.join(directory, actualName); + break; + } + } + } catch (err) { + console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); + } + return filePath; + } else { + if (isUnixExecutable(stats)) { + return filePath; + } + } + } + } + return ""; + }); +} +function normalizeSeparators(p) { + p = p || ""; + if (IS_WINDOWS) { + p = p.replace(/\//g, "\\"); + return p.replace(/\\\\+/g, "\\"); + } + return p.replace(/\/\/+/g, "/"); +} +function isUnixExecutable(stats) { + return (stats.mode & 1) > 0 || (stats.mode & 8) > 0 && process.getgid !== void 0 && stats.gid === process.getgid() || (stats.mode & 64) > 0 && process.getuid !== void 0 && stats.uid === process.getuid(); +} + +// node_modules/.pnpm/@actions+io@3.0.2/node_modules/@actions/io/lib/io.js +var __awaiter3 = function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function which(tool, check) { + return __awaiter3(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + if (check) { + const result = yield which(tool, false); + if (!result) { + if (IS_WINDOWS) { + throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); + } else { + throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); + } + } + return result; + } + const matches = yield findInPath(tool); + if (matches && matches.length > 0) { + return matches[0]; + } + return ""; + }); +} +function findInPath(tool) { + return __awaiter3(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + const extensions = []; + if (IS_WINDOWS && process.env["PATHEXT"]) { + for (const extension of process.env["PATHEXT"].split(path2.delimiter)) { + if (extension) { + extensions.push(extension); + } + } + } + if (isRooted(tool)) { + const filePath = yield tryGetExecutablePath(tool, extensions); + if (filePath) { + return [filePath]; + } + return []; + } + if (tool.includes(path2.sep)) { + return []; + } + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path2.delimiter)) { + if (p) { + directories.push(p); + } + } + } + const matches = []; + for (const directory of directories) { + const filePath = yield tryGetExecutablePath(path2.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); + } + } + return matches; + }); +} // node_modules/.pnpm/@actions+exec@3.0.0/node_modules/@actions/exec/lib/toolrunner.js +var import_timers = require("timers"); +var __awaiter4 = function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; var IS_WINDOWS2 = process.platform === "win32"; +var ToolRunner = class extends events.EventEmitter { + constructor(toolPath, args, options2) { + super(); + if (!toolPath) { + throw new Error("Parameter 'toolPath' cannot be null or empty."); + } + this.toolPath = toolPath; + this.args = args || []; + this.options = options2 || {}; + } + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } + } + _getCommandString(options2, noPrefix) { + const toolPath = this._getSpawnFileName(); + const args = this._getSpawnArgs(options2); + let cmd = noPrefix ? "" : "[command]"; + if (IS_WINDOWS2) { + if (this._isCmdFile()) { + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } else if (options2.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; + } + } else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; + } + } + } else { + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } + return cmd; + } + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os2.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os2.EOL.length); + n = s.indexOf(os2.EOL); + } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; + } + } + _getSpawnFileName() { + if (IS_WINDOWS2) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } + } + return this.toolPath; + } + _getSpawnArgs(options2) { + if (IS_WINDOWS2) { + if (this._isCmdFile()) { + let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; + for (const a of this.args) { + argline += " "; + argline += options2.windowsVerbatimArguments ? a : this._windowsQuoteCmdArg(a); + } + argline += '"'; + return [argline]; + } + } + return this.args; + } + _endsWith(str, end) { + return str.endsWith(end); + } + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); + } + _windowsQuoteCmdArg(arg) { + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); + } + if (!arg) { + return '""'; + } + const cmdSpecialChars = [ + " ", + " ", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", + "'", + "+", + ",", + "`", + "~", + "|", + "<", + ">", + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some((x) => x === char)) { + needsQuotes = true; + break; + } + } + if (!needsQuotes) { + return arg; + } + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === "\\") { + reverse += "\\"; + } else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '"'; + } else { + quoteHit = false; + } + } + reverse += '"'; + return reverse.split("").reverse().join(""); + } + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; + } + if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { + return arg; + } + if (!arg.includes('"') && !arg.includes("\\")) { + return `"${arg}"`; + } + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === "\\") { + reverse += "\\"; + } else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += "\\"; + } else { + quoteHit = false; + } + } + reverse += '"'; + return reverse.split("").reverse().join(""); + } + _cloneExecOptions(options2) { + options2 = options2 || {}; + const result = { + cwd: options2.cwd || process.cwd(), + env: options2.env || process.env, + silent: options2.silent || false, + windowsVerbatimArguments: options2.windowsVerbatimArguments || false, + failOnStdErr: options2.failOnStdErr || false, + ignoreReturnCode: options2.ignoreReturnCode || false, + delay: options2.delay || 1e4 + }; + result.outStream = options2.outStream || process.stdout; + result.errStream = options2.errStream || process.stderr; + return result; + } + _getSpawnOptions(options2, toolPath) { + options2 = options2 || {}; + const result = {}; + result.cwd = options2.cwd; + result.env = options2.env; + result["windowsVerbatimArguments"] = options2.windowsVerbatimArguments || this._isCmdFile(); + if (options2.windowsVerbatimArguments) { + result.argv0 = `"${toolPath}"`; + } + return result; + } + /** + * Exec a tool. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param tool path to tool to exec + * @param options optional exec options. See ExecOptions + * @returns number + */ + exec() { + return __awaiter4(this, void 0, void 0, function* () { + if (!isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS2 && this.toolPath.includes("\\"))) { + this.toolPath = path3.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield which(this.toolPath, true); + return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { + this._debug(`exec tool: ${this.toolPath}`); + this._debug("arguments:"); + for (const arg of this.args) { + this._debug(` ${arg}`); + } + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os2.EOL); + } + const state = new ExecState(optionsNonNull, this.toolPath); + state.on("debug", (message) => { + this._debug(message); + }); + if (this.options.cwd && !(yield exists(this.options.cwd))) { + return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`)); + } + const fileName = this._getSpawnFileName(); + const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); + let stdbuffer = ""; + if (cp.stdout) { + cp.stdout.on("data", (data) => { + if (this.options.listeners && this.options.listeners.stdout) { + this.options.listeners.stdout(data); + } + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(data); + } + stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => { + if (this.options.listeners && this.options.listeners.stdline) { + this.options.listeners.stdline(line); + } + }); + }); + } + let errbuffer = ""; + if (cp.stderr) { + cp.stderr.on("data", (data) => { + state.processStderr = true; + if (this.options.listeners && this.options.listeners.stderr) { + this.options.listeners.stderr(data); + } + if (!optionsNonNull.silent && optionsNonNull.errStream && optionsNonNull.outStream) { + const s = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream; + s.write(data); + } + errbuffer = this._processLineBuffer(data, errbuffer, (line) => { + if (this.options.listeners && this.options.listeners.errline) { + this.options.listeners.errline(line); + } + }); + }); + } + cp.on("error", (err) => { + state.processError = err.message; + state.processExited = true; + state.processClosed = true; + state.CheckComplete(); + }); + cp.on("exit", (code) => { + state.processExitCode = code; + state.processExited = true; + this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); + state.CheckComplete(); + }); + cp.on("close", (code) => { + state.processExitCode = code; + state.processExited = true; + state.processClosed = true; + this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); + state.CheckComplete(); + }); + state.on("done", (error3, exitCode) => { + if (stdbuffer.length > 0) { + this.emit("stdline", stdbuffer); + } + if (errbuffer.length > 0) { + this.emit("errline", errbuffer); + } + cp.removeAllListeners(); + if (error3) { + reject(error3); + } else { + resolve2(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); + } + })); + }); + } +}; +function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; + } + arg += c; + escaped = false; + } + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } else { + append(c); + } + continue; + } + if (c === "\\" && escaped) { + append(c); + continue; + } + if (c === "\\" && inQuotes) { + escaped = true; + continue; + } + if (c === " " && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ""; + } + continue; + } + append(c); + } + if (arg.length > 0) { + args.push(arg.trim()); + } + return args; +} +var ExecState = class _ExecState extends events.EventEmitter { + constructor(options2, toolPath) { + super(); + this.processClosed = false; + this.processError = ""; + this.processExitCode = 0; + this.processExited = false; + this.processStderr = false; + this.delay = 1e4; + this.done = false; + this.timeout = null; + if (!toolPath) { + throw new Error("toolPath must not be empty"); + } + this.options = options2; + this.toolPath = toolPath; + if (options2.delay) { + this.delay = options2.delay; + } + } + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = (0, import_timers.setTimeout)(_ExecState.HandleTimeout, this.delay, this); + } + } + _debug(message) { + this.emit("debug", message); + } + _setResult() { + let error3; + if (this.processExited) { + if (this.processError) { + error3 = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); + } else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { + error3 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + } else if (this.processStderr && this.options.failOnStdErr) { + error3 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + } + } + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; + } + this.done = true; + this.emit("done", error3, this.processExitCode); + } + static HandleTimeout(state) { + if (state.done) { + return; + } + if (!state.processClosed && state.processExited) { + const message = `The STDIO streams did not close within ${state.delay / 1e3} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; + state._debug(message); + } + state._setResult(); + } +}; + +// node_modules/.pnpm/@actions+exec@3.0.0/node_modules/@actions/exec/lib/exec.js +var __awaiter5 = function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function exec(commandLine, args, options2) { + return __awaiter5(this, void 0, void 0, function* () { + const commandArgs = argStringToArray(commandLine); + if (commandArgs.length === 0) { + throw new Error(`Parameter 'commandLine' cannot be null or empty.`); + } + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new ToolRunner(toolPath, args, options2); + return runner.exec(); + }); +} // node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/platform.js var platform = import_os2.default.platform(); var arch = import_os2.default.arch(); // node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/core.js +var __awaiter6 = function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; var ExitCode; (function(ExitCode2) { ExitCode2[ExitCode2["Success"] = 0] = "Success"; @@ -25749,7 +26481,25 @@ function warning(message, properties = {}) { issueCommand("warning", toCommandProperties(properties), message instanceof Error ? message.toString() : message); } function info(message) { - process.stdout.write(message + os3.EOL); + process.stdout.write(message + os4.EOL); +} +function startGroup(name) { + issue("group", name); +} +function endGroup() { + issue("endgroup"); +} +function group(name, fn) { + return __awaiter6(this, void 0, void 0, function* () { + startGroup(name); + let result; + try { + result = yield fn(); + } finally { + endGroup(); + } + return result; + }); } // src/options.ts @@ -26002,10 +26752,10 @@ function mergeDefs(...defs) { function cloneDef(schema) { return mergeDefs(schema._zod.def); } -function getElementAtPath(obj, path3) { - if (!path3) +function getElementAtPath(obj, path6) { + if (!path6) return obj; - return path3.reduce((acc, key) => acc?.[key], obj); + return path6.reduce((acc, key) => acc?.[key], obj); } function promiseAllObject(promisesObj) { const keys = Object.keys(promisesObj); @@ -26345,11 +27095,11 @@ function explicitlyAborted(x, startIndex = 0) { } return false; } -function prefixIssues(path3, issues) { +function prefixIssues(path6, issues) { return issues.map((iss) => { var _a3; (_a3 = iss).path ?? (_a3.path = []); - iss.path.unshift(path3); + iss.path.unshift(path6); return iss; }); } @@ -26799,16 +27549,16 @@ function flattenError(error3, mapper = (issue3) => issue3.message) { } function formatError(error3, mapper = (issue3) => issue3.message) { const fieldErrors = { _errors: [] }; - const processError = (error4, path3 = []) => { + const processError = (error4, path6 = []) => { for (const issue3 of error4.issues) { if (issue3.code === "invalid_union" && issue3.errors.length) { - issue3.errors.map((issues) => processError({ issues }, [...path3, ...issue3.path])); + issue3.errors.map((issues) => processError({ issues }, [...path6, ...issue3.path])); } else if (issue3.code === "invalid_key") { - processError({ issues: issue3.issues }, [...path3, ...issue3.path]); + processError({ issues: issue3.issues }, [...path6, ...issue3.path]); } else if (issue3.code === "invalid_element") { - processError({ issues: issue3.issues }, [...path3, ...issue3.path]); + processError({ issues: issue3.issues }, [...path6, ...issue3.path]); } else { - const fullpath = [...path3, ...issue3.path]; + const fullpath = [...path6, ...issue3.path]; if (fullpath.length === 0) { fieldErrors._errors.push(mapper(issue3)); } else { @@ -28464,7 +29214,7 @@ var recursive = /* @__PURE__ */ new WeakMap(); var NONE = 0; var ASSUMED = 1; var PROVEN = 2; -function isRecursive(inst, stack, resolve) { +function isRecursive(inst, stack, resolve2) { const cached2 = recursive.get(inst); if (cached2 !== void 0) return cached2 ? PROVEN : NONE; @@ -28472,9 +29222,9 @@ function isRecursive(inst, stack, resolve) { return PROVEN; stack.add(inst); let result = NONE; - const check = (child) => { - if (result !== PROVEN && child?._zod) { - const answer = isRecursive(child, stack, resolve); + const check = (child2) => { + if (result !== PROVEN && child2?._zod) { + const answer = isRecursive(child2, stack, resolve2); if (answer > result) result = answer; } @@ -28485,9 +29235,9 @@ function isRecursive(inst, stack, resolve) { const desc = Object.getOwnPropertyDescriptor(sh, key); if (spread && !desc.enumerable) continue; - const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE; - if (child > answer) - answer = child; + const child2 = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve2) : NONE; + if (child2 > answer) + answer = child2; } return answer; }; @@ -28549,7 +29299,7 @@ function isRecursive(inst, stack, resolve) { break; // `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly case "lazy": { - const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : void 0); + const inner = def._cachedInner ?? (resolve2 ? inst._zod.innerType : void 0); merge2(inner ? isRecursive(inner, stack, false) : ASSUMED); break; } @@ -31948,11 +32698,40 @@ https://github.com/prefix-dev/pixi/releases/latest/download/{{pixiFile}} {{~else~}} https://github.com/prefix-dev/pixi/releases/download/{{version}}/{{pixiFile}} {{~/if}}`; +var execute = (cmd) => { + debug(`Executing: \`${cmd.toString()}\``); + return exec(`"${cmd[0]}"`, cmd.slice(1), { cwd: options.workingDirectory }); +}; +var pixiCmd = (command, withManifestPath = true) => { + let commandArray = [options.pixiBinPath].concat(command.split(" ").filter((x) => x !== "")); + if (withManifestPath) { + commandArray = commandArray.concat(["--manifest-path", options.manifestPath]); + } + commandArray = commandArray.concat(["--color", "always"]); + switch (options.logLevel) { + case "vvv": + commandArray = commandArray.concat(["-vvv"]); + break; + case "vv": + commandArray = commandArray.concat(["-vv"]); + break; + case "v": + commandArray = commandArray.concat(["-v"]); + break; + case "default": + break; + case "q": + commandArray = commandArray.concat(["-q"]); + break; + } + return commandArray; +}; // src/options.ts var pixiPath = "pixi.toml"; var pyprojectPath = "pyproject.toml"; var logLevelSchema = _enum(["q", "default", "v", "vv", "vvv"]); +var authLogoutSchema = _enum(["post", "after-install", "never"]); var pypiKeyringProviderSchema = _enum(["disabled", "subprocess"]); var PATHS = { pixiBin: import_path.default.join(import_os3.default.homedir(), ".pixi", "bin", `pixi${import_os3.default.platform() === "win32" ? ".exe" : ""}`) @@ -32069,8 +32848,8 @@ var validateInputs = (inputs) => { if (inputs.authToken || inputs.authUsername || inputs.authCondaToken || inputs.authS3AccessKeyId) { throw new Error("You need to specify auth-host"); } - if (inputs.persistCredentials === false) { - throw new Error("Cannot use persist-credentials without specifying auth-host"); + if (inputs.authLogout) { + throw new Error("Cannot use auth-logout without specifying auth-host"); } } if (inputs.runInstall === false && inputs.environments) { @@ -32164,26 +32943,26 @@ var inferOptions = (inputs) => { } : void 0; const frozen = inputs.frozen ?? false; const locked = inputs.locked ?? (lockFileAvailable && !frozen); - const persistCredentials = inputs.persistCredentials ?? true; + const authLogout = inputs.authLogout ?? "post"; const auth = !inputs.authHost ? void 0 : inputs.authToken ? { host: inputs.authHost, token: inputs.authToken, - persistCredentials + logout: authLogout } : inputs.authCondaToken ? { host: inputs.authHost, condaToken: inputs.authCondaToken, - persistCredentials + logout: authLogout } : inputs.authUsername ? { host: inputs.authHost, username: inputs.authUsername, password: inputs.authPassword, - persistCredentials + logout: authLogout } : { host: inputs.authHost, s3AccessKeyId: inputs.authS3AccessKeyId, s3SecretAccessKey: inputs.authS3SecretAccessKey, s3SessionToken: inputs.authS3SessionToken, - persistCredentials + logout: authLogout }; const postCleanup = inputs.postCleanup ?? false; const pypiKeyringProvider = inputs.pypiKeyringProvider; @@ -32205,13 +32984,17 @@ var inferOptions = (inputs) => { globalCache, pixiBinPath, auth, - persistCredentials, postCleanup }; }; var assertOptions = (_options2) => { }; var getOptions = () => { + if (inputOrEnvironmentVariable("persist-credentials") !== void 0) { + throw new Error( + "`persist-credentials` has been removed, use `auth-logout: after-install` (instead of `false`) or `auth-logout: never` (instead of `true`)." + ); + } const inputs = { pixiVersion: parseOrUndefined( "pixi-version", @@ -32246,7 +33029,11 @@ var getOptions = () => { authS3AccessKeyId: parseOrUndefined("auth-s3-access-key-id", string2()), authS3SecretAccessKey: parseOrUndefined("auth-s3-secret-access-key", string2()), authS3SessionToken: parseOrUndefined("auth-s3-session-token", string2()), - persistCredentials: parseOrUndefinedJSON("persist-credentials", boolean2()), + authLogout: parseOrUndefined( + "auth-logout", + authLogoutSchema, + "auth-logout must be one of `post`, `after-install`, `never`." + ), pypiKeyringProvider: parseOrUndefined("pypi-keyring-provider", pypiKeyringProviderSchema), globalEnvironments: parseOrUndefinedMultilineList("global-environments", string2()), postCleanup: parseOrUndefinedJSON("post-cleanup", boolean2()) @@ -32336,13 +33123,29 @@ var cleanupRattler = () => { import_promises.default.rm(rattlerCachePath, { recursive: true, force: true }) ]); }; -var run = () => { +var pixiLogout = async () => { + const auth = options.auth; + if (auth?.logout !== "post") { + debug("Skipping pixi logout."); + return; + } + if (!(0, import_fs3.existsSync)(options.pixiBinPath)) { + debug(`Skipping pixi logout, pixi binary ${options.pixiBinPath} does not exist.`); + return; + } + await group("Logging out of private channel", async () => { + debug(`Logging out of ${auth.host}`); + await execute(pixiCmd(`auth logout ${auth.host}`, false)); + }); +}; +var run = async () => { + await pixiLogout(); const postCleanup = options.postCleanup; if (postCleanup) { - return Promise.all([cleanupPixiBin(), cleanupEnv(), cleanupRattler()]); + await Promise.all([cleanupPixiBin(), cleanupEnv(), cleanupRattler()]); + return; } debug("Skipping post-cleanup."); - return Promise.resolve(); }; run().then(() => (0, import_process2.exit)(0)).catch((error3) => { if (isDebug()) { diff --git a/package.json b/package.json index df5f891..8ab098b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "setup-pixi", - "version": "0.10.2", + "version": "0.11.0", "private": true, "description": "Action to set up the pixi package manager.", "scripts": { diff --git a/src/main.ts b/src/main.ts index d065188..6d2222d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -48,12 +48,13 @@ const pixiLogin = async () => { core.debug(`Logging in to ${auth.host} with conda token`) await execute(pixiCmd(`auth login --conda-token ${auth.condaToken} ${auth.host}`, false)) } + await execute(pixiCmd('auth status', false)) }) } const pixiLogout = async () => { const auth = options.auth - if (!auth || auth.persistCredentials) { + if (auth?.logout !== 'after-install') { core.debug('Skipping pixi logout.') return } diff --git a/src/options.ts b/src/options.ts index ad93775..7cfa4eb 100644 --- a/src/options.ts +++ b/src/options.ts @@ -35,7 +35,7 @@ type Inputs = Readonly<{ authS3AccessKeyId?: string authS3SecretAccessKey?: string authS3SessionToken?: string - persistCredentials?: boolean + authLogout?: AuthLogout pypiKeyringProvider?: 'disabled' | 'subprocess' postCleanup?: boolean globalEnvironments?: string[] @@ -49,7 +49,7 @@ export interface PixiSource { type Auth = { host: string - persistCredentials: boolean + logout: AuthLogout } & ( | { token: string @@ -93,7 +93,6 @@ export type Options = Readonly<{ globalCache?: GlobalCache pixiBinPath: string auth?: Auth - persistCredentials: boolean pypiKeyringProvider?: 'disabled' | 'subprocess' postCleanup: boolean activatedEnvironment?: string @@ -105,6 +104,9 @@ const pyprojectPath = 'pyproject.toml' const logLevelSchema = z.enum(['q', 'default', 'v', 'vv', 'vvv']) export type LogLevel = z.infer +const authLogoutSchema = z.enum(['post', 'after-install', 'never']) +export type AuthLogout = z.infer + const pypiKeyringProviderSchema = z.enum(['disabled', 'subprocess']) export type PypiKeyringProvider = z.infer @@ -243,8 +245,8 @@ const validateInputs = (inputs: Inputs): void => { if (inputs.authToken || inputs.authUsername || inputs.authCondaToken || inputs.authS3AccessKeyId) { throw new Error('You need to specify auth-host') } - if (inputs.persistCredentials === false) { - throw new Error('Cannot use persist-credentials without specifying auth-host') + if (inputs.authLogout) { + throw new Error('Cannot use auth-logout without specifying auth-host') } } if (inputs.runInstall === false && inputs.environments) { @@ -361,34 +363,34 @@ const inferOptions = (inputs: Inputs): Options => { : undefined const frozen = inputs.frozen ?? false const locked = inputs.locked ?? (lockFileAvailable && !frozen) - const persistCredentials = inputs.persistCredentials ?? true + const authLogout = inputs.authLogout ?? 'post' const auth = !inputs.authHost ? undefined : ((inputs.authToken ? { host: inputs.authHost, token: inputs.authToken, - persistCredentials: persistCredentials + logout: authLogout } : inputs.authCondaToken ? { host: inputs.authHost, condaToken: inputs.authCondaToken, - persistCredentials: persistCredentials + logout: authLogout } : inputs.authUsername ? { host: inputs.authHost, username: inputs.authUsername, password: inputs.authPassword, - persistCredentials: persistCredentials + logout: authLogout } : { host: inputs.authHost, s3AccessKeyId: inputs.authS3AccessKeyId, s3SecretAccessKey: inputs.authS3SecretAccessKey, s3SessionToken: inputs.authS3SessionToken, - persistCredentials: persistCredentials + logout: authLogout }) as Auth) const postCleanup = inputs.postCleanup ?? false const pypiKeyringProvider = inputs.pypiKeyringProvider @@ -410,7 +412,6 @@ const inferOptions = (inputs: Inputs): Options => { globalCache, pixiBinPath, auth, - persistCredentials, postCleanup } } @@ -425,6 +426,11 @@ const assertOptions = (_options: Options) => { } const getOptions = () => { + if (inputOrEnvironmentVariable('persist-credentials') !== undefined) { + throw new Error( + '`persist-credentials` has been removed, use `auth-logout: after-install` (instead of `false`) or `auth-logout: never` (instead of `true`).' + ) + } const inputs: Inputs = { pixiVersion: parseOrUndefined( 'pixi-version', @@ -459,7 +465,11 @@ const getOptions = () => { authS3AccessKeyId: parseOrUndefined('auth-s3-access-key-id', z.string()), authS3SecretAccessKey: parseOrUndefined('auth-s3-secret-access-key', z.string()), authS3SessionToken: parseOrUndefined('auth-s3-session-token', z.string()), - persistCredentials: parseOrUndefinedJSON('persist-credentials', z.boolean()), + authLogout: parseOrUndefined( + 'auth-logout', + authLogoutSchema, + 'auth-logout must be one of `post`, `after-install`, `never`.' + ), pypiKeyringProvider: parseOrUndefined('pypi-keyring-provider', pypiKeyringProviderSchema), globalEnvironments: parseOrUndefinedMultilineList('global-environments', z.string()), postCleanup: parseOrUndefinedJSON('post-cleanup', z.boolean()) diff --git a/src/post.ts b/src/post.ts index 099ad91..8215890 100644 --- a/src/post.ts +++ b/src/post.ts @@ -5,6 +5,7 @@ import os from 'os' import { exit } from 'process' import * as core from '@actions/core' import { options } from './options' +import { execute, pixiCmd } from './util' const removeEmptyParentDirs = (dirPath: string): Promise => { if (existsSync(dirPath)) { @@ -71,13 +72,31 @@ const cleanupRattler = () => { ]) } -const run = () => { +const pixiLogout = async () => { + const auth = options.auth + if (auth?.logout !== 'post') { + core.debug('Skipping pixi logout.') + return + } + if (!existsSync(options.pixiBinPath)) { + core.debug(`Skipping pixi logout, pixi binary ${options.pixiBinPath} does not exist.`) + return + } + await core.group('Logging out of private channel', async () => { + core.debug(`Logging out of ${auth.host}`) + await execute(pixiCmd(`auth logout ${auth.host}`, false)) + }) +} + +const run = async () => { + // needs to happen before the cleanup since that removes the pixi binary + await pixiLogout() const postCleanup = options.postCleanup if (postCleanup) { - return Promise.all([cleanupPixiBin(), cleanupEnv(), cleanupRattler()]) + await Promise.all([cleanupPixiBin(), cleanupEnv(), cleanupRattler()]) + return } core.debug('Skipping post-cleanup.') - return Promise.resolve() } run()