diff --git a/dist/index.js b/dist/index.js index a906b99..0227efd 100644 --- a/dist/index.js +++ b/dist/index.js @@ -79,23 +79,28 @@ function run() { const client = new sdk_napi_1.BitwardenClient(settings, 2 /* LogLevel.Info */); const result = yield client.loginWithAccessToken(accessToken); if (!result.success) { - throw Error("Authentication to Bitwarden failed"); + throw Error("Authentication with Bitwarden failed"); } core.info("Setting Secrets"); - for (const secretInput of secretInputs) { - const secretResponse = yield client.secrets().get(secretInput.id); - if (secretResponse.data) { - core.setSecret(secretResponse.data.value); - core.exportVariable(secretInput.outputEnvName, secretResponse.data.value); - core.setOutput(secretInput.outputEnvName, secretResponse.data.value); - } - else { - let errorMessage = `The secret ${secretInput.id} could not be found `; - if (secretResponse.errorMessage) { - errorMessage = errorMessage + "error message was: " + secretResponse.errorMessage; + const secretIds = secretInputs.map((secretInput) => secretInput.id); + const secretResponse = yield client.secrets().getByIds(secretIds); + if (secretResponse.data) { + const secrets = secretResponse.data.data; + secrets.forEach((secret) => { + const secretInput = secretInputs.find((secretInput) => secretInput.id === secret.id); + if (secretInput) { + core.setSecret(secret.value); + core.exportVariable(secretInput.outputEnvName, secret.value); + core.setOutput(secretInput.outputEnvName, secret.value); } - throw Error(errorMessage); + }); + } + else { + let errorMessage = "The secrets provided could not be found. Please check the service account has access to the secret UUIDs provided."; + if (secretResponse.errorMessage) { + errorMessage = errorMessage + `\n\n` + secretResponse.errorMessage; } + throw Error(errorMessage); } core.info("Completed setting secrets as environment variables."); } diff --git a/dist/index.js.map b/dist/index.js.map index 9f98c2b..c7c925e 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5lBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC3EA;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpBA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC7BA;AACA;;;;AEDA;AACA;AACA;AACA","sources":["../webpack://@bitwarden/sm-action/./lib/main.js","../webpack://@bitwarden/sm-action/./lib/parser.js","../webpack://@bitwarden/sm-action/./lib/validators.js","../webpack://@bitwarden/sm-action/./node_modules/@actions/core/lib/command.js","../webpack://@bitwarden/sm-action/./node_modules/@actions/core/lib/core.js","../webpack://@bitwarden/sm-action/./node_modules/@actions/core/lib/file-command.js","../webpack://@bitwarden/sm-action/./node_modules/@actions/core/lib/oidc-utils.js","../webpack://@bitwarden/sm-action/./node_modules/@actions/core/lib/path-utils.js","../webpack://@bitwarden/sm-action/./node_modules/@actions/core/lib/summary.js","../webpack://@bitwarden/sm-action/./node_modules/@actions/core/lib/utils.js","../webpack://@bitwarden/sm-action/./node_modules/@actions/http-client/lib/auth.js","../webpack://@bitwarden/sm-action/./node_modules/@actions/http-client/lib/index.js","../webpack://@bitwarden/sm-action/./node_modules/@actions/http-client/lib/proxy.js","../webpack://@bitwarden/sm-action/./node_modules/tunnel/index.js","../webpack://@bitwarden/sm-action/./node_modules/tunnel/lib/tunnel.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/index.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/md5.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/nil.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/parse.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/regex.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/rng.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/sha1.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/stringify.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/v1.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/v3.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/v35.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/v4.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/v5.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/validate.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/version.js","../webpack://@bitwarden/sm-action/external node-commonjs \"@bitwarden/sdk-napi\"","../webpack://@bitwarden/sm-action/external node-commonjs \"assert\"","../webpack://@bitwarden/sm-action/external node-commonjs \"crypto\"","../webpack://@bitwarden/sm-action/external node-commonjs \"events\"","../webpack://@bitwarden/sm-action/external node-commonjs \"fs\"","../webpack://@bitwarden/sm-action/external node-commonjs \"http\"","../webpack://@bitwarden/sm-action/external node-commonjs \"https\"","../webpack://@bitwarden/sm-action/external node-commonjs \"net\"","../webpack://@bitwarden/sm-action/external node-commonjs \"os\"","../webpack://@bitwarden/sm-action/external node-commonjs \"path\"","../webpack://@bitwarden/sm-action/external node-commonjs \"tls\"","../webpack://@bitwarden/sm-action/external node-commonjs \"util\"","../webpack://@bitwarden/sm-action/webpack/bootstrap","../webpack://@bitwarden/sm-action/webpack/runtime/compat","../webpack://@bitwarden/sm-action/webpack/before-startup","../webpack://@bitwarden/sm-action/webpack/startup","../webpack://@bitwarden/sm-action/webpack/after-startup"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core = __importStar(require(\"@actions/core\"));\nconst sdk_napi_1 = require(\"@bitwarden/sdk-napi\");\nconst parser_1 = require(\"./parser\");\nconst validators_1 = require(\"./validators\");\nfunction run() {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const accessToken = core.getInput(\"access_token\");\n const secrets = core.getMultilineInput(\"secrets\", {\n required: true,\n });\n const baseUrl = core.getInput(\"base_url\");\n let identityUrl = core.getInput(\"identity_url\");\n let apiUrl = core.getInput(\"api_url\");\n core.info(\"Validating bitwarden/sm-action inputs...\");\n if (baseUrl) {\n if (!(0, validators_1.isValidUrl)(baseUrl)) {\n throw TypeError(\"input provided for base_url not in expected format\");\n }\n identityUrl = baseUrl + \"/identity\";\n apiUrl = baseUrl + \"/api\";\n }\n if (!(0, validators_1.isValidUrl)(identityUrl)) {\n throw TypeError(\"input provided for identity_url not in expected format\");\n }\n if (!(0, validators_1.isValidUrl)(apiUrl)) {\n throw TypeError(\"input provided for api_url not in expected format\");\n }\n core.info(\"Parsing secrets input\");\n const secretInputs = (0, parser_1.parseSecretInput)(secrets);\n core.info(\"Authenticating to Bitwarden\");\n const settings = {\n apiUrl: apiUrl,\n identityUrl: identityUrl,\n userAgent: \"bitwarden/sm-action\",\n deviceType: sdk_napi_1.DeviceType.SDK,\n };\n const client = new sdk_napi_1.BitwardenClient(settings, 2 /* LogLevel.Info */);\n const result = yield client.loginWithAccessToken(accessToken);\n if (!result.success) {\n throw Error(\"Authentication to Bitwarden failed\");\n }\n core.info(\"Setting Secrets\");\n for (const secretInput of secretInputs) {\n const secretResponse = yield client.secrets().get(secretInput.id);\n if (secretResponse.data) {\n core.setSecret(secretResponse.data.value);\n core.exportVariable(secretInput.outputEnvName, secretResponse.data.value);\n core.setOutput(secretInput.outputEnvName, secretResponse.data.value);\n }\n else {\n let errorMessage = `The secret ${secretInput.id} could not be found `;\n if (secretResponse.errorMessage) {\n errorMessage = errorMessage + \"error message was: \" + secretResponse.errorMessage;\n }\n throw Error(errorMessage);\n }\n }\n core.info(\"Completed setting secrets as environment variables.\");\n }\n catch (error) {\n if (error instanceof Error) {\n core.setFailed(error.message);\n }\n }\n });\n}\nrun();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseSecretInput = exports.SecretInput = void 0;\nconst validators_1 = require(\"./validators\");\nclass SecretInput {\n constructor(id, outputEnvName) {\n this.id = id;\n this.outputEnvName = outputEnvName;\n }\n}\nexports.SecretInput = SecretInput;\nfunction parseSecretInput(secrets) {\n const results = secrets.map((secret) => {\n try {\n let [id, envName] = secret.split(\">\", 2);\n id = id.trim();\n envName = envName.trim();\n if ((0, validators_1.isValidGuid)(id) && (0, validators_1.isValidEnvName)(envName)) {\n return new SecretInput(id, envName);\n }\n else {\n throw TypeError();\n }\n }\n catch (_a) {\n throw TypeError(`Error occurred when attempting to parse ${secret}`);\n }\n });\n if (!(0, validators_1.isUniqueEnvNames)(results)) {\n throw TypeError(\"Environmental variable names provided are not unique, names must be unique\");\n }\n return results;\n}\nexports.parseSecretInput = parseSecretInput;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isUniqueEnvNames = exports.isValidGuid = exports.isValidEnvName = exports.isValidUrl = void 0;\nconst ENV_NAME_REGEX = /^[a-zA-Z_]+[a-zA-Z0-9_]*$/;\nconst GUID_REGEX = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;\nfunction isValidUrl(url) {\n try {\n const tempUrl = new URL(url);\n if (tempUrl.protocol === \"https:\") {\n return true;\n }\n }\n catch (_a) {\n return false;\n }\n return false;\n}\nexports.isValidUrl = isValidUrl;\nfunction isValidEnvName(name) {\n return ENV_NAME_REGEX.test(name);\n}\nexports.isValidEnvName = isValidEnvName;\nfunction isValidGuid(value) {\n return GUID_REGEX.test(value);\n}\nexports.isValidGuid = isValidGuid;\nfunction isUniqueEnvNames(secretInputs) {\n const envNames = [...new Set(secretInputs.map((s) => s.outputEnvName))];\n return envNames.length === secretInputs.length;\n}\nexports.isUniqueEnvNames = isUniqueEnvNames;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issue = exports.issueCommand = void 0;\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst oidc_utils_1 = require(\"./oidc-utils\");\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));\n }\n command_1.issueCommand('set-env', { name }, convertedVal);\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueFileCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nfunction getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n if (options && options.trimWhitespace === false) {\n return inputs;\n }\n return inputs.map(input => input.trim());\n}\nexports.getMultilineInput = getMultilineInput;\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nfunction getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\nexports.getBooleanInput = getBooleanInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction error(message, properties = {}) {\n command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction warning(message, properties = {}) {\n command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction notice(message, properties = {}) {\n command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.notice = notice;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n const filePath = process.env['GITHUB_STATE'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));\n }\n command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\nfunction getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield oidc_utils_1.OidcClient.getIDToken(aud);\n });\n}\nexports.getIDToken = getIDToken;\n/**\n * Summary exports\n */\nvar summary_1 = require(\"./summary\");\nObject.defineProperty(exports, \"summary\", { enumerable: true, get: function () { return summary_1.summary; } });\n/**\n * @deprecated use core.summary\n */\nvar summary_2 = require(\"./summary\");\nObject.defineProperty(exports, \"markdownSummary\", { enumerable: true, get: function () { return summary_2.markdownSummary; } });\n/**\n * Path exports\n */\nvar path_utils_1 = require(\"./path-utils\");\nObject.defineProperty(exports, \"toPosixPath\", { enumerable: true, get: function () { return path_utils_1.toPosixPath; } });\nObject.defineProperty(exports, \"toWin32Path\", { enumerable: true, get: function () { return path_utils_1.toWin32Path; } });\nObject.defineProperty(exports, \"toPlatformPath\", { enumerable: true, get: function () { return path_utils_1.toPlatformPath; } });\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.prepareKeyValueMessage = exports.issueFileCommand = void 0;\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst uuid_1 = require(\"uuid\");\nconst utils_1 = require(\"./utils\");\nfunction issueFileCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueFileCommand = issueFileCommand;\nfunction prepareKeyValueMessage(key, value) {\n const delimiter = `ghadelimiter_${uuid_1.v4()}`;\n const convertedValue = utils_1.toCommandValue(value);\n // These should realistically never happen, but just in case someone finds a\n // way to exploit uuid generation let's not allow keys or values that contain\n // the delimiter.\n if (key.includes(delimiter)) {\n throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n }\n if (convertedValue.includes(delimiter)) {\n throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n }\n return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;\n}\nexports.prepareKeyValueMessage = prepareKeyValueMessage;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OidcClient = void 0;\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/lib/auth\");\nconst core_1 = require(\"./core\");\nclass OidcClient {\n static createHttpClient(allowRetry = true, maxRetry = 10) {\n const requestOptions = {\n allowRetries: allowRetry,\n maxRetries: maxRetry\n };\n return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n }\n static getRequestToken() {\n const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n }\n return token;\n }\n static getIDTokenUrl() {\n const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n }\n return runtimeUrl;\n }\n static getCall(id_token_url) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const httpclient = OidcClient.createHttpClient();\n const res = yield httpclient\n .getJson(id_token_url)\n .catch(error => {\n throw new Error(`Failed to get ID Token. \\n \n Error Code : ${error.statusCode}\\n \n Error Message: ${error.result.message}`);\n });\n const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n if (!id_token) {\n throw new Error('Response json body do not have ID Token field');\n }\n return id_token;\n });\n }\n static getIDToken(audience) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // New ID Token is requested from action service\n let id_token_url = OidcClient.getIDTokenUrl();\n if (audience) {\n const encodedAudience = encodeURIComponent(audience);\n id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n }\n core_1.debug(`ID token url is ${id_token_url}`);\n const id_token = yield OidcClient.getCall(id_token_url);\n core_1.setSecret(id_token);\n return id_token;\n }\n catch (error) {\n throw new Error(`Error message: ${error.message}`);\n }\n });\n }\n}\nexports.OidcClient = OidcClient;\n//# sourceMappingURL=oidc-utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;\nconst path = __importStar(require(\"path\"));\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nfunction toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\nexports.toPosixPath = toPosixPath;\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nfunction toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\nexports.toWin32Path = toWin32Path;\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nfunction toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\nexports.toPlatformPath = toPlatformPath;\n//# sourceMappingURL=path-utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;\nconst os_1 = require(\"os\");\nconst fs_1 = require(\"fs\");\nconst { access, appendFile, writeFile } = fs_1.promises;\nexports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n constructor() {\n this._buffer = '';\n }\n /**\n * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n * Also checks r/w permissions.\n *\n * @returns step summary file path\n */\n filePath() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._filePath) {\n return this._filePath;\n }\n const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];\n if (!pathFromEnv) {\n throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n }\n try {\n yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);\n }\n catch (_a) {\n throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n }\n this._filePath = pathFromEnv;\n return this._filePath;\n });\n }\n /**\n * Wraps content in an HTML tag, adding any HTML attributes\n *\n * @param {string} tag HTML tag to wrap\n * @param {string | null} content content within the tag\n * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n *\n * @returns {string} content wrapped in HTML element\n */\n wrap(tag, content, attrs = {}) {\n const htmlAttrs = Object.entries(attrs)\n .map(([key, value]) => ` ${key}=\"${value}\"`)\n .join('');\n if (!content) {\n return `<${tag}${htmlAttrs}>`;\n }\n return `<${tag}${htmlAttrs}>${content}`;\n }\n /**\n * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n *\n * @param {SummaryWriteOptions} [options] (optional) options for write operation\n *\n * @returns {Promise} summary instance\n */\n write(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n const filePath = yield this.filePath();\n const writeFunc = overwrite ? writeFile : appendFile;\n yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n return this.emptyBuffer();\n });\n }\n /**\n * Clears the summary buffer and wipes the summary file\n *\n * @returns {Summary} summary instance\n */\n clear() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.emptyBuffer().write({ overwrite: true });\n });\n }\n /**\n * Returns the current summary buffer as a string\n *\n * @returns {string} string of summary buffer\n */\n stringify() {\n return this._buffer;\n }\n /**\n * If the summary buffer is empty\n *\n * @returns {boolen} true if the buffer is empty\n */\n isEmptyBuffer() {\n return this._buffer.length === 0;\n }\n /**\n * Resets the summary buffer without writing to summary file\n *\n * @returns {Summary} summary instance\n */\n emptyBuffer() {\n this._buffer = '';\n return this;\n }\n /**\n * Adds raw text to the summary buffer\n *\n * @param {string} text content to add\n * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n *\n * @returns {Summary} summary instance\n */\n addRaw(text, addEOL = false) {\n this._buffer += text;\n return addEOL ? this.addEOL() : this;\n }\n /**\n * Adds the operating system-specific end-of-line marker to the buffer\n *\n * @returns {Summary} summary instance\n */\n addEOL() {\n return this.addRaw(os_1.EOL);\n }\n /**\n * Adds an HTML codeblock to the summary buffer\n *\n * @param {string} code content to render within fenced code block\n * @param {string} lang (optional) language to syntax highlight code\n *\n * @returns {Summary} summary instance\n */\n addCodeBlock(code, lang) {\n const attrs = Object.assign({}, (lang && { lang }));\n const element = this.wrap('pre', this.wrap('code', code), attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML list to the summary buffer\n *\n * @param {string[]} items list of items to render\n * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n *\n * @returns {Summary} summary instance\n */\n addList(items, ordered = false) {\n const tag = ordered ? 'ol' : 'ul';\n const listItems = items.map(item => this.wrap('li', item)).join('');\n const element = this.wrap(tag, listItems);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML table to the summary buffer\n *\n * @param {SummaryTableCell[]} rows table rows\n *\n * @returns {Summary} summary instance\n */\n addTable(rows) {\n const tableBody = rows\n .map(row => {\n const cells = row\n .map(cell => {\n if (typeof cell === 'string') {\n return this.wrap('td', cell);\n }\n const { header, data, colspan, rowspan } = cell;\n const tag = header ? 'th' : 'td';\n const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n return this.wrap(tag, data, attrs);\n })\n .join('');\n return this.wrap('tr', cells);\n })\n .join('');\n const element = this.wrap('table', tableBody);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds a collapsable HTML details element to the summary buffer\n *\n * @param {string} label text for the closed state\n * @param {string} content collapsable content\n *\n * @returns {Summary} summary instance\n */\n addDetails(label, content) {\n const element = this.wrap('details', this.wrap('summary', label) + content);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML image tag to the summary buffer\n *\n * @param {string} src path to the image you to embed\n * @param {string} alt text description of the image\n * @param {SummaryImageOptions} options (optional) addition image attributes\n *\n * @returns {Summary} summary instance\n */\n addImage(src, alt, options) {\n const { width, height } = options || {};\n const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML section heading element\n *\n * @param {string} text heading text\n * @param {number | string} [level=1] (optional) the heading level, default: 1\n *\n * @returns {Summary} summary instance\n */\n addHeading(text, level) {\n const tag = `h${level}`;\n const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n ? tag\n : 'h1';\n const element = this.wrap(allowedTag, text);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexports.markdownSummary = _summary;\nexports.summary = _summary;\n//# sourceMappingURL=summary.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toCommandProperties = exports.toCommandValue = void 0;\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nfunction toCommandProperties(annotationProperties) {\n if (!Object.keys(annotationProperties).length) {\n return {};\n }\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n };\n}\nexports.toCommandProperties = toCommandProperties;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;\nclass BasicCredentialHandler {\n constructor(username, password) {\n this.username = username;\n this.password = password;\n }\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BasicCredentialHandler = BasicCredentialHandler;\nclass BearerCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BearerCredentialHandler = BearerCredentialHandler;\nclass PersonalAccessTokenCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;\n//# sourceMappingURL=auth.js.map","\"use strict\";\n/* eslint-disable @typescript-eslint/no-explicit-any */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;\nconst http = __importStar(require(\"http\"));\nconst https = __importStar(require(\"https\"));\nconst pm = __importStar(require(\"./proxy\"));\nconst tunnel = __importStar(require(\"tunnel\"));\nvar HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));\nvar Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers = exports.Headers || (exports.Headers = {}));\nvar MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nfunction getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nexports.getProxyUrl = getProxyUrl;\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nclass HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexports.HttpClientError = HttpClientError;\nclass HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n }));\n });\n }\n}\nexports.HttpClientResponse = HttpClientResponse;\nfunction isHttps(requestUrl) {\n const parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexports.isHttps = isHttps;\nclass HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n });\n }\n get(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n });\n }\n del(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n });\n }\n post(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n });\n }\n patch(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n });\n }\n put(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n });\n }\n head(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n });\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n });\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n getJson(requestUrl, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n const res = yield this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n postJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n putJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n patchJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n request(verb, requestUrl, data, headers) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n const parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n do {\n response = yield this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (const handler of this.handlers) {\n if (handler.canHandleAuthentication(response)) {\n authenticationHandler = handler;\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (response.message.statusCode &&\n HttpRedirectCodes.includes(response.message.statusCode) &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n const parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol === 'https:' &&\n parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n yield response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (const header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = yield this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (!response.message.statusCode ||\n !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n yield response.readBody();\n yield this._performExponentialBackoff(numTries);\n }\n } while (numTries < maxTries);\n return response;\n });\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => {\n function callbackForResult(err, res) {\n if (err) {\n reject(err);\n }\n else if (!res) {\n // If `err` is not passed, then `res` must be passed.\n reject(new Error('Unknown error'));\n }\n else {\n resolve(res);\n }\n }\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n const parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n for (const handler of this.handlers) {\n handler.prepareRequest(info.options);\n }\n }\n return info;\n }\n _mergeHeaders(headers) {\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n const proxyUrl = pm.getProxyUrl(parsedUrl);\n const useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (this._keepAlive && !useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n if (proxyUrl && proxyUrl.hostname) {\n const agentOptions = {\n maxSockets,\n keepAlive: this._keepAlive,\n proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n })), { host: proxyUrl.hostname, port: proxyUrl.port })\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if reusing agent across request and tunneling agent isn't assigned create a new agent\n if (this._keepAlive && !agent) {\n const options = { keepAlive: this._keepAlive, maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n // if not using private agent and tunnel agent isn't setup then use global agent\n if (!agent) {\n agent = usingSsl ? https.globalAgent : http.globalAgent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _performExponentialBackoff(retryNumber) {\n return __awaiter(this, void 0, void 0, function* () {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n });\n }\n _processResponse(res, options) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n const statusCode = res.message.statusCode || 0;\n const response = {\n statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode === HttpCodes.NotFound) {\n resolve(response);\n }\n // get the result from the body\n function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n let obj;\n let contents;\n try {\n contents = yield res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = `Failed request: (${statusCode})`;\n }\n const err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n }));\n });\n }\n}\nexports.HttpClient = HttpClient;\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkBypass = exports.getProxyUrl = void 0;\nfunction getProxyUrl(reqUrl) {\n const usingSsl = reqUrl.protocol === 'https:';\n if (checkBypass(reqUrl)) {\n return undefined;\n }\n const proxyVar = (() => {\n if (usingSsl) {\n return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n })();\n if (proxyVar) {\n return new URL(proxyVar);\n }\n else {\n return undefined;\n }\n}\nexports.getProxyUrl = getProxyUrl;\nfunction checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n const reqHost = reqUrl.hostname;\n if (isLoopbackAddress(reqHost)) {\n return true;\n }\n const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (const upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperNoProxyItem === '*' ||\n upperReqHosts.some(x => x === upperNoProxyItem ||\n x.endsWith(`.${upperNoProxyItem}`) ||\n (upperNoProxyItem.startsWith('.') &&\n x.endsWith(`${upperNoProxyItem}`)))) {\n return true;\n }\n }\n return false;\n}\nexports.checkBypass = checkBypass;\nfunction isLoopbackAddress(host) {\n const hostLower = host.toLowerCase();\n return (hostLower === 'localhost' ||\n hostLower.startsWith('127.') ||\n hostLower.startsWith('[::1]') ||\n hostLower.startsWith('[0:0:0:0:0:0:0:1]'));\n}\n//# sourceMappingURL=proxy.js.map","module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"v1\", {\n enumerable: true,\n get: function () {\n return _v.default;\n }\n});\nObject.defineProperty(exports, \"v3\", {\n enumerable: true,\n get: function () {\n return _v2.default;\n }\n});\nObject.defineProperty(exports, \"v4\", {\n enumerable: true,\n get: function () {\n return _v3.default;\n }\n});\nObject.defineProperty(exports, \"v5\", {\n enumerable: true,\n get: function () {\n return _v4.default;\n }\n});\nObject.defineProperty(exports, \"NIL\", {\n enumerable: true,\n get: function () {\n return _nil.default;\n }\n});\nObject.defineProperty(exports, \"version\", {\n enumerable: true,\n get: function () {\n return _version.default;\n }\n});\nObject.defineProperty(exports, \"validate\", {\n enumerable: true,\n get: function () {\n return _validate.default;\n }\n});\nObject.defineProperty(exports, \"stringify\", {\n enumerable: true,\n get: function () {\n return _stringify.default;\n }\n});\nObject.defineProperty(exports, \"parse\", {\n enumerable: true,\n get: function () {\n return _parse.default;\n }\n});\n\nvar _v = _interopRequireDefault(require(\"./v1.js\"));\n\nvar _v2 = _interopRequireDefault(require(\"./v3.js\"));\n\nvar _v3 = _interopRequireDefault(require(\"./v4.js\"));\n\nvar _v4 = _interopRequireDefault(require(\"./v5.js\"));\n\nvar _nil = _interopRequireDefault(require(\"./nil.js\"));\n\nvar _version = _interopRequireDefault(require(\"./version.js\"));\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction md5(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('md5').update(bytes).digest();\n}\n\nvar _default = md5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = '00000000-0000-0000-0000-000000000000';\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction parse(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n let v;\n const arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nvar _default = parse;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = rng;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate\n\nlet poolPtr = rnds8Pool.length;\n\nfunction rng() {\n if (poolPtr > rnds8Pool.length - 16) {\n _crypto.default.randomFillSync(rnds8Pool);\n\n poolPtr = 0;\n }\n\n return rnds8Pool.slice(poolPtr, poolPtr += 16);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction sha1(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('sha1').update(bytes).digest();\n}\n\nvar _default = sha1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nvar _default = stringify;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\nlet _nodeId;\n\nlet _clockseq; // Previous uuid creation time\n\n\nlet _lastMSecs = 0;\nlet _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n let i = buf && offset || 0;\n const b = buf || new Array(16);\n options = options || {};\n let node = options.node || _nodeId;\n let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n const seedBytes = options.random || (options.rng || _rng.default)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (let n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf || (0, _stringify.default)(b);\n}\n\nvar _default = v1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _md = _interopRequireDefault(require(\"./md5.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v3 = (0, _v.default)('v3', 0x30, _md.default);\nvar _default = v3;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nexports.URL = exports.DNS = void 0;\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n const bytes = [];\n\n for (let i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nconst DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexports.DNS = DNS;\nconst URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexports.URL = URL;\n\nfunction _default(name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = (0, _parse.default)(namespace);\n }\n\n if (namespace.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n let bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.default)(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction v4(options, buf, offset) {\n options = options || {};\n\n const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.default)(rnds);\n}\n\nvar _default = v4;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _sha = _interopRequireDefault(require(\"./sha1.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v5 = (0, _v.default)('v5', 0x50, _sha.default);\nvar _default = v5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _regex = _interopRequireDefault(require(\"./regex.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && _regex.default.test(uuid);\n}\n\nvar _default = validate;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction version(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n return parseInt(uuid.substr(14, 1), 16);\n}\n\nvar _default = version;\nexports.default = _default;","module.exports = require(\"@bitwarden/sdk-napi\");","module.exports = require(\"assert\");","module.exports = require(\"crypto\");","module.exports = require(\"events\");","module.exports = require(\"fs\");","module.exports = require(\"http\");","module.exports = require(\"https\");","module.exports = require(\"net\");","module.exports = require(\"os\");","module.exports = require(\"path\");","module.exports = require(\"tls\");","module.exports = require(\"util\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = __dirname + \"/\";","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(109);\n",""],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5lBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC3EA;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpBA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC7BA;AACA;;;;AEDA;AACA;AACA;AACA","sources":["../webpack://@bitwarden/sm-action/./lib/main.js","../webpack://@bitwarden/sm-action/./lib/parser.js","../webpack://@bitwarden/sm-action/./lib/validators.js","../webpack://@bitwarden/sm-action/./node_modules/@actions/core/lib/command.js","../webpack://@bitwarden/sm-action/./node_modules/@actions/core/lib/core.js","../webpack://@bitwarden/sm-action/./node_modules/@actions/core/lib/file-command.js","../webpack://@bitwarden/sm-action/./node_modules/@actions/core/lib/oidc-utils.js","../webpack://@bitwarden/sm-action/./node_modules/@actions/core/lib/path-utils.js","../webpack://@bitwarden/sm-action/./node_modules/@actions/core/lib/summary.js","../webpack://@bitwarden/sm-action/./node_modules/@actions/core/lib/utils.js","../webpack://@bitwarden/sm-action/./node_modules/@actions/http-client/lib/auth.js","../webpack://@bitwarden/sm-action/./node_modules/@actions/http-client/lib/index.js","../webpack://@bitwarden/sm-action/./node_modules/@actions/http-client/lib/proxy.js","../webpack://@bitwarden/sm-action/./node_modules/tunnel/index.js","../webpack://@bitwarden/sm-action/./node_modules/tunnel/lib/tunnel.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/index.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/md5.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/nil.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/parse.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/regex.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/rng.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/sha1.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/stringify.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/v1.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/v3.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/v35.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/v4.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/v5.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/validate.js","../webpack://@bitwarden/sm-action/./node_modules/uuid/dist/version.js","../webpack://@bitwarden/sm-action/external node-commonjs \"@bitwarden/sdk-napi\"","../webpack://@bitwarden/sm-action/external node-commonjs \"assert\"","../webpack://@bitwarden/sm-action/external node-commonjs \"crypto\"","../webpack://@bitwarden/sm-action/external node-commonjs \"events\"","../webpack://@bitwarden/sm-action/external node-commonjs \"fs\"","../webpack://@bitwarden/sm-action/external node-commonjs \"http\"","../webpack://@bitwarden/sm-action/external node-commonjs \"https\"","../webpack://@bitwarden/sm-action/external node-commonjs \"net\"","../webpack://@bitwarden/sm-action/external node-commonjs \"os\"","../webpack://@bitwarden/sm-action/external node-commonjs \"path\"","../webpack://@bitwarden/sm-action/external node-commonjs \"tls\"","../webpack://@bitwarden/sm-action/external node-commonjs \"util\"","../webpack://@bitwarden/sm-action/webpack/bootstrap","../webpack://@bitwarden/sm-action/webpack/runtime/compat","../webpack://@bitwarden/sm-action/webpack/before-startup","../webpack://@bitwarden/sm-action/webpack/startup","../webpack://@bitwarden/sm-action/webpack/after-startup"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core = __importStar(require(\"@actions/core\"));\nconst sdk_napi_1 = require(\"@bitwarden/sdk-napi\");\nconst parser_1 = require(\"./parser\");\nconst validators_1 = require(\"./validators\");\nfunction run() {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const accessToken = core.getInput(\"access_token\");\n const secrets = core.getMultilineInput(\"secrets\", {\n required: true,\n });\n const baseUrl = core.getInput(\"base_url\");\n let identityUrl = core.getInput(\"identity_url\");\n let apiUrl = core.getInput(\"api_url\");\n core.info(\"Validating bitwarden/sm-action inputs...\");\n if (baseUrl) {\n if (!(0, validators_1.isValidUrl)(baseUrl)) {\n throw TypeError(\"input provided for base_url not in expected format\");\n }\n identityUrl = baseUrl + \"/identity\";\n apiUrl = baseUrl + \"/api\";\n }\n if (!(0, validators_1.isValidUrl)(identityUrl)) {\n throw TypeError(\"input provided for identity_url not in expected format\");\n }\n if (!(0, validators_1.isValidUrl)(apiUrl)) {\n throw TypeError(\"input provided for api_url not in expected format\");\n }\n core.info(\"Parsing secrets input\");\n const secretInputs = (0, parser_1.parseSecretInput)(secrets);\n core.info(\"Authenticating to Bitwarden\");\n const settings = {\n apiUrl: apiUrl,\n identityUrl: identityUrl,\n userAgent: \"bitwarden/sm-action\",\n deviceType: sdk_napi_1.DeviceType.SDK,\n };\n const client = new sdk_napi_1.BitwardenClient(settings, 2 /* LogLevel.Info */);\n const result = yield client.loginWithAccessToken(accessToken);\n if (!result.success) {\n throw Error(\"Authentication with Bitwarden failed\");\n }\n core.info(\"Setting Secrets\");\n const secretIds = secretInputs.map((secretInput) => secretInput.id);\n const secretResponse = yield client.secrets().getByIds(secretIds);\n if (secretResponse.data) {\n const secrets = secretResponse.data.data;\n secrets.forEach((secret) => {\n const secretInput = secretInputs.find((secretInput) => secretInput.id === secret.id);\n if (secretInput) {\n core.setSecret(secret.value);\n core.exportVariable(secretInput.outputEnvName, secret.value);\n core.setOutput(secretInput.outputEnvName, secret.value);\n }\n });\n }\n else {\n let errorMessage = \"The secrets provided could not be found. Please check the service account has access to the secret UUIDs provided.\";\n if (secretResponse.errorMessage) {\n errorMessage = errorMessage + `\\n\\n` + secretResponse.errorMessage;\n }\n throw Error(errorMessage);\n }\n core.info(\"Completed setting secrets as environment variables.\");\n }\n catch (error) {\n if (error instanceof Error) {\n core.setFailed(error.message);\n }\n }\n });\n}\nrun();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseSecretInput = exports.SecretInput = void 0;\nconst validators_1 = require(\"./validators\");\nclass SecretInput {\n constructor(id, outputEnvName) {\n this.id = id;\n this.outputEnvName = outputEnvName;\n }\n}\nexports.SecretInput = SecretInput;\nfunction parseSecretInput(secrets) {\n const results = secrets.map((secret) => {\n try {\n let [id, envName] = secret.split(\">\", 2);\n id = id.trim();\n envName = envName.trim();\n if ((0, validators_1.isValidGuid)(id) && (0, validators_1.isValidEnvName)(envName)) {\n return new SecretInput(id, envName);\n }\n else {\n throw TypeError();\n }\n }\n catch (_a) {\n throw TypeError(`Error occurred when attempting to parse ${secret}`);\n }\n });\n if (!(0, validators_1.isUniqueEnvNames)(results)) {\n throw TypeError(\"Environmental variable names provided are not unique, names must be unique\");\n }\n return results;\n}\nexports.parseSecretInput = parseSecretInput;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isUniqueEnvNames = exports.isValidGuid = exports.isValidEnvName = exports.isValidUrl = void 0;\nconst ENV_NAME_REGEX = /^[a-zA-Z_]+[a-zA-Z0-9_]*$/;\nconst GUID_REGEX = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;\nfunction isValidUrl(url) {\n try {\n const tempUrl = new URL(url);\n if (tempUrl.protocol === \"https:\") {\n return true;\n }\n }\n catch (_a) {\n return false;\n }\n return false;\n}\nexports.isValidUrl = isValidUrl;\nfunction isValidEnvName(name) {\n return ENV_NAME_REGEX.test(name);\n}\nexports.isValidEnvName = isValidEnvName;\nfunction isValidGuid(value) {\n return GUID_REGEX.test(value);\n}\nexports.isValidGuid = isValidGuid;\nfunction isUniqueEnvNames(secretInputs) {\n const envNames = [...new Set(secretInputs.map((s) => s.outputEnvName))];\n return envNames.length === secretInputs.length;\n}\nexports.isUniqueEnvNames = isUniqueEnvNames;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issue = exports.issueCommand = void 0;\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst oidc_utils_1 = require(\"./oidc-utils\");\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));\n }\n command_1.issueCommand('set-env', { name }, convertedVal);\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueFileCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nfunction getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n if (options && options.trimWhitespace === false) {\n return inputs;\n }\n return inputs.map(input => input.trim());\n}\nexports.getMultilineInput = getMultilineInput;\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nfunction getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\nexports.getBooleanInput = getBooleanInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction error(message, properties = {}) {\n command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction warning(message, properties = {}) {\n command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction notice(message, properties = {}) {\n command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.notice = notice;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n const filePath = process.env['GITHUB_STATE'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));\n }\n command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\nfunction getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield oidc_utils_1.OidcClient.getIDToken(aud);\n });\n}\nexports.getIDToken = getIDToken;\n/**\n * Summary exports\n */\nvar summary_1 = require(\"./summary\");\nObject.defineProperty(exports, \"summary\", { enumerable: true, get: function () { return summary_1.summary; } });\n/**\n * @deprecated use core.summary\n */\nvar summary_2 = require(\"./summary\");\nObject.defineProperty(exports, \"markdownSummary\", { enumerable: true, get: function () { return summary_2.markdownSummary; } });\n/**\n * Path exports\n */\nvar path_utils_1 = require(\"./path-utils\");\nObject.defineProperty(exports, \"toPosixPath\", { enumerable: true, get: function () { return path_utils_1.toPosixPath; } });\nObject.defineProperty(exports, \"toWin32Path\", { enumerable: true, get: function () { return path_utils_1.toWin32Path; } });\nObject.defineProperty(exports, \"toPlatformPath\", { enumerable: true, get: function () { return path_utils_1.toPlatformPath; } });\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.prepareKeyValueMessage = exports.issueFileCommand = void 0;\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst uuid_1 = require(\"uuid\");\nconst utils_1 = require(\"./utils\");\nfunction issueFileCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueFileCommand = issueFileCommand;\nfunction prepareKeyValueMessage(key, value) {\n const delimiter = `ghadelimiter_${uuid_1.v4()}`;\n const convertedValue = utils_1.toCommandValue(value);\n // These should realistically never happen, but just in case someone finds a\n // way to exploit uuid generation let's not allow keys or values that contain\n // the delimiter.\n if (key.includes(delimiter)) {\n throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n }\n if (convertedValue.includes(delimiter)) {\n throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n }\n return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;\n}\nexports.prepareKeyValueMessage = prepareKeyValueMessage;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OidcClient = void 0;\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/lib/auth\");\nconst core_1 = require(\"./core\");\nclass OidcClient {\n static createHttpClient(allowRetry = true, maxRetry = 10) {\n const requestOptions = {\n allowRetries: allowRetry,\n maxRetries: maxRetry\n };\n return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n }\n static getRequestToken() {\n const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n }\n return token;\n }\n static getIDTokenUrl() {\n const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n }\n return runtimeUrl;\n }\n static getCall(id_token_url) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const httpclient = OidcClient.createHttpClient();\n const res = yield httpclient\n .getJson(id_token_url)\n .catch(error => {\n throw new Error(`Failed to get ID Token. \\n \n Error Code : ${error.statusCode}\\n \n Error Message: ${error.result.message}`);\n });\n const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n if (!id_token) {\n throw new Error('Response json body do not have ID Token field');\n }\n return id_token;\n });\n }\n static getIDToken(audience) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // New ID Token is requested from action service\n let id_token_url = OidcClient.getIDTokenUrl();\n if (audience) {\n const encodedAudience = encodeURIComponent(audience);\n id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n }\n core_1.debug(`ID token url is ${id_token_url}`);\n const id_token = yield OidcClient.getCall(id_token_url);\n core_1.setSecret(id_token);\n return id_token;\n }\n catch (error) {\n throw new Error(`Error message: ${error.message}`);\n }\n });\n }\n}\nexports.OidcClient = OidcClient;\n//# sourceMappingURL=oidc-utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;\nconst path = __importStar(require(\"path\"));\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nfunction toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\nexports.toPosixPath = toPosixPath;\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nfunction toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\nexports.toWin32Path = toWin32Path;\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nfunction toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\nexports.toPlatformPath = toPlatformPath;\n//# sourceMappingURL=path-utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;\nconst os_1 = require(\"os\");\nconst fs_1 = require(\"fs\");\nconst { access, appendFile, writeFile } = fs_1.promises;\nexports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n constructor() {\n this._buffer = '';\n }\n /**\n * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n * Also checks r/w permissions.\n *\n * @returns step summary file path\n */\n filePath() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._filePath) {\n return this._filePath;\n }\n const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];\n if (!pathFromEnv) {\n throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n }\n try {\n yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);\n }\n catch (_a) {\n throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n }\n this._filePath = pathFromEnv;\n return this._filePath;\n });\n }\n /**\n * Wraps content in an HTML tag, adding any HTML attributes\n *\n * @param {string} tag HTML tag to wrap\n * @param {string | null} content content within the tag\n * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n *\n * @returns {string} content wrapped in HTML element\n */\n wrap(tag, content, attrs = {}) {\n const htmlAttrs = Object.entries(attrs)\n .map(([key, value]) => ` ${key}=\"${value}\"`)\n .join('');\n if (!content) {\n return `<${tag}${htmlAttrs}>`;\n }\n return `<${tag}${htmlAttrs}>${content}`;\n }\n /**\n * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n *\n * @param {SummaryWriteOptions} [options] (optional) options for write operation\n *\n * @returns {Promise} summary instance\n */\n write(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n const filePath = yield this.filePath();\n const writeFunc = overwrite ? writeFile : appendFile;\n yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n return this.emptyBuffer();\n });\n }\n /**\n * Clears the summary buffer and wipes the summary file\n *\n * @returns {Summary} summary instance\n */\n clear() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.emptyBuffer().write({ overwrite: true });\n });\n }\n /**\n * Returns the current summary buffer as a string\n *\n * @returns {string} string of summary buffer\n */\n stringify() {\n return this._buffer;\n }\n /**\n * If the summary buffer is empty\n *\n * @returns {boolen} true if the buffer is empty\n */\n isEmptyBuffer() {\n return this._buffer.length === 0;\n }\n /**\n * Resets the summary buffer without writing to summary file\n *\n * @returns {Summary} summary instance\n */\n emptyBuffer() {\n this._buffer = '';\n return this;\n }\n /**\n * Adds raw text to the summary buffer\n *\n * @param {string} text content to add\n * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n *\n * @returns {Summary} summary instance\n */\n addRaw(text, addEOL = false) {\n this._buffer += text;\n return addEOL ? this.addEOL() : this;\n }\n /**\n * Adds the operating system-specific end-of-line marker to the buffer\n *\n * @returns {Summary} summary instance\n */\n addEOL() {\n return this.addRaw(os_1.EOL);\n }\n /**\n * Adds an HTML codeblock to the summary buffer\n *\n * @param {string} code content to render within fenced code block\n * @param {string} lang (optional) language to syntax highlight code\n *\n * @returns {Summary} summary instance\n */\n addCodeBlock(code, lang) {\n const attrs = Object.assign({}, (lang && { lang }));\n const element = this.wrap('pre', this.wrap('code', code), attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML list to the summary buffer\n *\n * @param {string[]} items list of items to render\n * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n *\n * @returns {Summary} summary instance\n */\n addList(items, ordered = false) {\n const tag = ordered ? 'ol' : 'ul';\n const listItems = items.map(item => this.wrap('li', item)).join('');\n const element = this.wrap(tag, listItems);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML table to the summary buffer\n *\n * @param {SummaryTableCell[]} rows table rows\n *\n * @returns {Summary} summary instance\n */\n addTable(rows) {\n const tableBody = rows\n .map(row => {\n const cells = row\n .map(cell => {\n if (typeof cell === 'string') {\n return this.wrap('td', cell);\n }\n const { header, data, colspan, rowspan } = cell;\n const tag = header ? 'th' : 'td';\n const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n return this.wrap(tag, data, attrs);\n })\n .join('');\n return this.wrap('tr', cells);\n })\n .join('');\n const element = this.wrap('table', tableBody);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds a collapsable HTML details element to the summary buffer\n *\n * @param {string} label text for the closed state\n * @param {string} content collapsable content\n *\n * @returns {Summary} summary instance\n */\n addDetails(label, content) {\n const element = this.wrap('details', this.wrap('summary', label) + content);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML image tag to the summary buffer\n *\n * @param {string} src path to the image you to embed\n * @param {string} alt text description of the image\n * @param {SummaryImageOptions} options (optional) addition image attributes\n *\n * @returns {Summary} summary instance\n */\n addImage(src, alt, options) {\n const { width, height } = options || {};\n const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML section heading element\n *\n * @param {string} text heading text\n * @param {number | string} [level=1] (optional) the heading level, default: 1\n *\n * @returns {Summary} summary instance\n */\n addHeading(text, level) {\n const tag = `h${level}`;\n const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n ? tag\n : 'h1';\n const element = this.wrap(allowedTag, text);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexports.markdownSummary = _summary;\nexports.summary = _summary;\n//# sourceMappingURL=summary.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toCommandProperties = exports.toCommandValue = void 0;\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nfunction toCommandProperties(annotationProperties) {\n if (!Object.keys(annotationProperties).length) {\n return {};\n }\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n };\n}\nexports.toCommandProperties = toCommandProperties;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;\nclass BasicCredentialHandler {\n constructor(username, password) {\n this.username = username;\n this.password = password;\n }\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BasicCredentialHandler = BasicCredentialHandler;\nclass BearerCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BearerCredentialHandler = BearerCredentialHandler;\nclass PersonalAccessTokenCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;\n//# sourceMappingURL=auth.js.map","\"use strict\";\n/* eslint-disable @typescript-eslint/no-explicit-any */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;\nconst http = __importStar(require(\"http\"));\nconst https = __importStar(require(\"https\"));\nconst pm = __importStar(require(\"./proxy\"));\nconst tunnel = __importStar(require(\"tunnel\"));\nvar HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));\nvar Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers = exports.Headers || (exports.Headers = {}));\nvar MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nfunction getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nexports.getProxyUrl = getProxyUrl;\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nclass HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexports.HttpClientError = HttpClientError;\nclass HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n }));\n });\n }\n}\nexports.HttpClientResponse = HttpClientResponse;\nfunction isHttps(requestUrl) {\n const parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexports.isHttps = isHttps;\nclass HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n });\n }\n get(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n });\n }\n del(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n });\n }\n post(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n });\n }\n patch(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n });\n }\n put(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n });\n }\n head(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n });\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n });\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n getJson(requestUrl, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n const res = yield this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n postJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n putJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n patchJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n request(verb, requestUrl, data, headers) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n const parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n do {\n response = yield this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (const handler of this.handlers) {\n if (handler.canHandleAuthentication(response)) {\n authenticationHandler = handler;\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (response.message.statusCode &&\n HttpRedirectCodes.includes(response.message.statusCode) &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n const parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol === 'https:' &&\n parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n yield response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (const header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = yield this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (!response.message.statusCode ||\n !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n yield response.readBody();\n yield this._performExponentialBackoff(numTries);\n }\n } while (numTries < maxTries);\n return response;\n });\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => {\n function callbackForResult(err, res) {\n if (err) {\n reject(err);\n }\n else if (!res) {\n // If `err` is not passed, then `res` must be passed.\n reject(new Error('Unknown error'));\n }\n else {\n resolve(res);\n }\n }\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n const parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n for (const handler of this.handlers) {\n handler.prepareRequest(info.options);\n }\n }\n return info;\n }\n _mergeHeaders(headers) {\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n const proxyUrl = pm.getProxyUrl(parsedUrl);\n const useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (this._keepAlive && !useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n if (proxyUrl && proxyUrl.hostname) {\n const agentOptions = {\n maxSockets,\n keepAlive: this._keepAlive,\n proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n })), { host: proxyUrl.hostname, port: proxyUrl.port })\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if reusing agent across request and tunneling agent isn't assigned create a new agent\n if (this._keepAlive && !agent) {\n const options = { keepAlive: this._keepAlive, maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n // if not using private agent and tunnel agent isn't setup then use global agent\n if (!agent) {\n agent = usingSsl ? https.globalAgent : http.globalAgent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _performExponentialBackoff(retryNumber) {\n return __awaiter(this, void 0, void 0, function* () {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n });\n }\n _processResponse(res, options) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n const statusCode = res.message.statusCode || 0;\n const response = {\n statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode === HttpCodes.NotFound) {\n resolve(response);\n }\n // get the result from the body\n function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n let obj;\n let contents;\n try {\n contents = yield res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = `Failed request: (${statusCode})`;\n }\n const err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n }));\n });\n }\n}\nexports.HttpClient = HttpClient;\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkBypass = exports.getProxyUrl = void 0;\nfunction getProxyUrl(reqUrl) {\n const usingSsl = reqUrl.protocol === 'https:';\n if (checkBypass(reqUrl)) {\n return undefined;\n }\n const proxyVar = (() => {\n if (usingSsl) {\n return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n })();\n if (proxyVar) {\n return new URL(proxyVar);\n }\n else {\n return undefined;\n }\n}\nexports.getProxyUrl = getProxyUrl;\nfunction checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n const reqHost = reqUrl.hostname;\n if (isLoopbackAddress(reqHost)) {\n return true;\n }\n const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (const upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperNoProxyItem === '*' ||\n upperReqHosts.some(x => x === upperNoProxyItem ||\n x.endsWith(`.${upperNoProxyItem}`) ||\n (upperNoProxyItem.startsWith('.') &&\n x.endsWith(`${upperNoProxyItem}`)))) {\n return true;\n }\n }\n return false;\n}\nexports.checkBypass = checkBypass;\nfunction isLoopbackAddress(host) {\n const hostLower = host.toLowerCase();\n return (hostLower === 'localhost' ||\n hostLower.startsWith('127.') ||\n hostLower.startsWith('[::1]') ||\n hostLower.startsWith('[0:0:0:0:0:0:0:1]'));\n}\n//# sourceMappingURL=proxy.js.map","module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"v1\", {\n enumerable: true,\n get: function () {\n return _v.default;\n }\n});\nObject.defineProperty(exports, \"v3\", {\n enumerable: true,\n get: function () {\n return _v2.default;\n }\n});\nObject.defineProperty(exports, \"v4\", {\n enumerable: true,\n get: function () {\n return _v3.default;\n }\n});\nObject.defineProperty(exports, \"v5\", {\n enumerable: true,\n get: function () {\n return _v4.default;\n }\n});\nObject.defineProperty(exports, \"NIL\", {\n enumerable: true,\n get: function () {\n return _nil.default;\n }\n});\nObject.defineProperty(exports, \"version\", {\n enumerable: true,\n get: function () {\n return _version.default;\n }\n});\nObject.defineProperty(exports, \"validate\", {\n enumerable: true,\n get: function () {\n return _validate.default;\n }\n});\nObject.defineProperty(exports, \"stringify\", {\n enumerable: true,\n get: function () {\n return _stringify.default;\n }\n});\nObject.defineProperty(exports, \"parse\", {\n enumerable: true,\n get: function () {\n return _parse.default;\n }\n});\n\nvar _v = _interopRequireDefault(require(\"./v1.js\"));\n\nvar _v2 = _interopRequireDefault(require(\"./v3.js\"));\n\nvar _v3 = _interopRequireDefault(require(\"./v4.js\"));\n\nvar _v4 = _interopRequireDefault(require(\"./v5.js\"));\n\nvar _nil = _interopRequireDefault(require(\"./nil.js\"));\n\nvar _version = _interopRequireDefault(require(\"./version.js\"));\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction md5(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('md5').update(bytes).digest();\n}\n\nvar _default = md5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = '00000000-0000-0000-0000-000000000000';\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction parse(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n let v;\n const arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nvar _default = parse;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = rng;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate\n\nlet poolPtr = rnds8Pool.length;\n\nfunction rng() {\n if (poolPtr > rnds8Pool.length - 16) {\n _crypto.default.randomFillSync(rnds8Pool);\n\n poolPtr = 0;\n }\n\n return rnds8Pool.slice(poolPtr, poolPtr += 16);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction sha1(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('sha1').update(bytes).digest();\n}\n\nvar _default = sha1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nvar _default = stringify;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\nlet _nodeId;\n\nlet _clockseq; // Previous uuid creation time\n\n\nlet _lastMSecs = 0;\nlet _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n let i = buf && offset || 0;\n const b = buf || new Array(16);\n options = options || {};\n let node = options.node || _nodeId;\n let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n const seedBytes = options.random || (options.rng || _rng.default)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (let n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf || (0, _stringify.default)(b);\n}\n\nvar _default = v1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _md = _interopRequireDefault(require(\"./md5.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v3 = (0, _v.default)('v3', 0x30, _md.default);\nvar _default = v3;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nexports.URL = exports.DNS = void 0;\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n const bytes = [];\n\n for (let i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nconst DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexports.DNS = DNS;\nconst URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexports.URL = URL;\n\nfunction _default(name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = (0, _parse.default)(namespace);\n }\n\n if (namespace.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n let bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.default)(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction v4(options, buf, offset) {\n options = options || {};\n\n const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.default)(rnds);\n}\n\nvar _default = v4;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _sha = _interopRequireDefault(require(\"./sha1.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v5 = (0, _v.default)('v5', 0x50, _sha.default);\nvar _default = v5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _regex = _interopRequireDefault(require(\"./regex.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && _regex.default.test(uuid);\n}\n\nvar _default = validate;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction version(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n return parseInt(uuid.substr(14, 1), 16);\n}\n\nvar _default = version;\nexports.default = _default;","module.exports = require(\"@bitwarden/sdk-napi\");","module.exports = require(\"assert\");","module.exports = require(\"crypto\");","module.exports = require(\"events\");","module.exports = require(\"fs\");","module.exports = require(\"http\");","module.exports = require(\"https\");","module.exports = require(\"net\");","module.exports = require(\"os\");","module.exports = require(\"path\");","module.exports = require(\"tls\");","module.exports = require(\"util\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = __dirname + \"/\";","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(109);\n",""],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/node_modules/@bitwarden/sdk-napi-darwin-x64/LICENSE b/dist/node_modules/@bitwarden/sdk-napi-darwin-x64/LICENSE index fdc9d12..e9d496f 100644 --- a/dist/node_modules/@bitwarden/sdk-napi-darwin-x64/LICENSE +++ b/dist/node_modules/@bitwarden/sdk-napi-darwin-x64/LICENSE @@ -15,7 +15,7 @@ available for download at the following URL, as updated from time to time. 1.3 A "Compatible Application" means any software program or service that (i) connects to and interoperates with a current version of the Bitwarden server products distributed by the Company; and (ii) complies with the Company’s -acceptable use policy available at the following URL: +acceptable use policy available at the following URL: https://bitwarden.com/terms/#acceptable_use. 1.4 "Company" means Bitwarden Inc., organized under the laws of the State of @@ -68,9 +68,9 @@ develop another SDK. 3.4 You may not use the SDK for any purpose not expressly permitted by the License Agreement. Except for contributions to Bitwarden pursuant to the Contribution License Agreement available at this URL: -https://cla-assistant.io/bitwarden/clients, or to the extent required by +https://cla-assistant.io/bitwarden/clients, or to the extent required by applicable third party licenses, you may not copy modify, adapt, redistribute, -decompile, reverse engineer, disassemble, or create derivative works of the SDK +decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK. 3.5 Use, reproduction, and distribution of a component of the SDK licensed under diff --git a/dist/node_modules/@bitwarden/sdk-napi-darwin-x64/package.json b/dist/node_modules/@bitwarden/sdk-napi-darwin-x64/package.json index 24335e6..f443303 100644 --- a/dist/node_modules/@bitwarden/sdk-napi-darwin-x64/package.json +++ b/dist/node_modules/@bitwarden/sdk-napi-darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@bitwarden/sdk-napi-darwin-x64", - "version": "0.2.1", + "version": "0.3.1", "homepage": "https://github.com/bitwarden/sdk#readme", "bugs": { "url": "https://github.com/bitwarden/sdk/issues" diff --git a/dist/node_modules/@bitwarden/sdk-napi-darwin-x64/sdk-napi.darwin-x64.node b/dist/node_modules/@bitwarden/sdk-napi-darwin-x64/sdk-napi.darwin-x64.node index 52647d6..3b8a78f 100644 Binary files a/dist/node_modules/@bitwarden/sdk-napi-darwin-x64/sdk-napi.darwin-x64.node and b/dist/node_modules/@bitwarden/sdk-napi-darwin-x64/sdk-napi.darwin-x64.node differ diff --git a/dist/node_modules/@bitwarden/sdk-napi-linux-x64-gnu/LICENSE b/dist/node_modules/@bitwarden/sdk-napi-linux-x64-gnu/LICENSE index fdc9d12..e9d496f 100644 --- a/dist/node_modules/@bitwarden/sdk-napi-linux-x64-gnu/LICENSE +++ b/dist/node_modules/@bitwarden/sdk-napi-linux-x64-gnu/LICENSE @@ -15,7 +15,7 @@ available for download at the following URL, as updated from time to time. 1.3 A "Compatible Application" means any software program or service that (i) connects to and interoperates with a current version of the Bitwarden server products distributed by the Company; and (ii) complies with the Company’s -acceptable use policy available at the following URL: +acceptable use policy available at the following URL: https://bitwarden.com/terms/#acceptable_use. 1.4 "Company" means Bitwarden Inc., organized under the laws of the State of @@ -68,9 +68,9 @@ develop another SDK. 3.4 You may not use the SDK for any purpose not expressly permitted by the License Agreement. Except for contributions to Bitwarden pursuant to the Contribution License Agreement available at this URL: -https://cla-assistant.io/bitwarden/clients, or to the extent required by +https://cla-assistant.io/bitwarden/clients, or to the extent required by applicable third party licenses, you may not copy modify, adapt, redistribute, -decompile, reverse engineer, disassemble, or create derivative works of the SDK +decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK. 3.5 Use, reproduction, and distribution of a component of the SDK licensed under diff --git a/dist/node_modules/@bitwarden/sdk-napi-linux-x64-gnu/package.json b/dist/node_modules/@bitwarden/sdk-napi-linux-x64-gnu/package.json index 37e738e..016bb50 100644 --- a/dist/node_modules/@bitwarden/sdk-napi-linux-x64-gnu/package.json +++ b/dist/node_modules/@bitwarden/sdk-napi-linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@bitwarden/sdk-napi-linux-x64-gnu", - "version": "0.2.1", + "version": "0.3.1", "homepage": "https://github.com/bitwarden/sdk#readme", "bugs": { "url": "https://github.com/bitwarden/sdk/issues" diff --git a/dist/node_modules/@bitwarden/sdk-napi-linux-x64-gnu/sdk-napi.linux-x64-gnu.node b/dist/node_modules/@bitwarden/sdk-napi-linux-x64-gnu/sdk-napi.linux-x64-gnu.node index 7c6d94e..70e1c6c 100644 Binary files a/dist/node_modules/@bitwarden/sdk-napi-linux-x64-gnu/sdk-napi.linux-x64-gnu.node and b/dist/node_modules/@bitwarden/sdk-napi-linux-x64-gnu/sdk-napi.linux-x64-gnu.node differ diff --git a/dist/node_modules/@bitwarden/sdk-napi-win32-x64-msvc/LICENSE b/dist/node_modules/@bitwarden/sdk-napi-win32-x64-msvc/LICENSE index fdc9d12..e9d496f 100644 --- a/dist/node_modules/@bitwarden/sdk-napi-win32-x64-msvc/LICENSE +++ b/dist/node_modules/@bitwarden/sdk-napi-win32-x64-msvc/LICENSE @@ -15,7 +15,7 @@ available for download at the following URL, as updated from time to time. 1.3 A "Compatible Application" means any software program or service that (i) connects to and interoperates with a current version of the Bitwarden server products distributed by the Company; and (ii) complies with the Company’s -acceptable use policy available at the following URL: +acceptable use policy available at the following URL: https://bitwarden.com/terms/#acceptable_use. 1.4 "Company" means Bitwarden Inc., organized under the laws of the State of @@ -68,9 +68,9 @@ develop another SDK. 3.4 You may not use the SDK for any purpose not expressly permitted by the License Agreement. Except for contributions to Bitwarden pursuant to the Contribution License Agreement available at this URL: -https://cla-assistant.io/bitwarden/clients, or to the extent required by +https://cla-assistant.io/bitwarden/clients, or to the extent required by applicable third party licenses, you may not copy modify, adapt, redistribute, -decompile, reverse engineer, disassemble, or create derivative works of the SDK +decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK. 3.5 Use, reproduction, and distribution of a component of the SDK licensed under diff --git a/dist/node_modules/@bitwarden/sdk-napi-win32-x64-msvc/package.json b/dist/node_modules/@bitwarden/sdk-napi-win32-x64-msvc/package.json index 5519198..67053d9 100644 --- a/dist/node_modules/@bitwarden/sdk-napi-win32-x64-msvc/package.json +++ b/dist/node_modules/@bitwarden/sdk-napi-win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@bitwarden/sdk-napi-win32-x64-msvc", - "version": "0.2.1", + "version": "0.3.1", "homepage": "https://github.com/bitwarden/sdk#readme", "bugs": { "url": "https://github.com/bitwarden/sdk/issues" diff --git a/dist/node_modules/@bitwarden/sdk-napi-win32-x64-msvc/sdk-napi.win32-x64-msvc.node b/dist/node_modules/@bitwarden/sdk-napi-win32-x64-msvc/sdk-napi.win32-x64-msvc.node index b3fe3e6..61149c7 100644 Binary files a/dist/node_modules/@bitwarden/sdk-napi-win32-x64-msvc/sdk-napi.win32-x64-msvc.node and b/dist/node_modules/@bitwarden/sdk-napi-win32-x64-msvc/sdk-napi.win32-x64-msvc.node differ diff --git a/dist/node_modules/@bitwarden/sdk-napi/LICENSE b/dist/node_modules/@bitwarden/sdk-napi/LICENSE index fdc9d12..e9d496f 100644 --- a/dist/node_modules/@bitwarden/sdk-napi/LICENSE +++ b/dist/node_modules/@bitwarden/sdk-napi/LICENSE @@ -15,7 +15,7 @@ available for download at the following URL, as updated from time to time. 1.3 A "Compatible Application" means any software program or service that (i) connects to and interoperates with a current version of the Bitwarden server products distributed by the Company; and (ii) complies with the Company’s -acceptable use policy available at the following URL: +acceptable use policy available at the following URL: https://bitwarden.com/terms/#acceptable_use. 1.4 "Company" means Bitwarden Inc., organized under the laws of the State of @@ -68,9 +68,9 @@ develop another SDK. 3.4 You may not use the SDK for any purpose not expressly permitted by the License Agreement. Except for contributions to Bitwarden pursuant to the Contribution License Agreement available at this URL: -https://cla-assistant.io/bitwarden/clients, or to the extent required by +https://cla-assistant.io/bitwarden/clients, or to the extent required by applicable third party licenses, you may not copy modify, adapt, redistribute, -decompile, reverse engineer, disassemble, or create derivative works of the SDK +decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK. 3.5 Use, reproduction, and distribution of a component of the SDK licensed under diff --git a/dist/node_modules/@bitwarden/sdk-napi/dist/bitwarden_client/index.d.ts b/dist/node_modules/@bitwarden/sdk-napi/dist/bitwarden_client/index.d.ts index 65f4a2d..e12d510 100644 --- a/dist/node_modules/@bitwarden/sdk-napi/dist/bitwarden_client/index.d.ts +++ b/dist/node_modules/@bitwarden/sdk-napi/dist/bitwarden_client/index.d.ts @@ -1,18 +1,17 @@ import * as rust from "../../binding"; import { LogLevel } from "../../binding"; -import { ClientSettings, ResponseForAPIKeyLoginResponse, ResponseForPasswordLoginResponse, ResponseForSecretIdentifiersResponse, ResponseForSecretResponse, ResponseForSecretsDeleteResponse, ResponseForSyncResponse } from "./schemas"; +import { ClientSettings, ResponseForAPIKeyLoginResponse, ResponseForSecretIdentifiersResponse, ResponseForSecretResponse, ResponseForSecretsDeleteResponse, ResponseForSecretsResponse } from "./schemas"; export declare class BitwardenClient { client: rust.BitwardenClient; constructor(settings?: ClientSettings, loggingLevel?: LogLevel); - login(email: string, password: string): Promise; loginWithAccessToken(accessToken: string): Promise; - sync(excludeSubdomains?: boolean): Promise; secrets(): SecretsClient; } export declare class SecretsClient { client: rust.BitwardenClient; constructor(client: rust.BitwardenClient); get(id: string): Promise; + getByIds(ids: string[]): Promise; create(key: string, note: string, organizationId: string, value: string): Promise; list(organizationId: string): Promise; update(id: string, key: string, note: string, organizationId: string, value: string): Promise; diff --git a/dist/node_modules/@bitwarden/sdk-napi/dist/bitwarden_client/index.js b/dist/node_modules/@bitwarden/sdk-napi/dist/bitwarden_client/index.js index 2cbc303..b8f733c 100644 --- a/dist/node_modules/@bitwarden/sdk-napi/dist/bitwarden_client/index.js +++ b/dist/node_modules/@bitwarden/sdk-napi/dist/bitwarden_client/index.js @@ -40,17 +40,6 @@ class BitwardenClient { const settingsJson = settings == null ? null : schemas_1.Convert.clientSettingsToJson(settings); this.client = new rust.BitwardenClient(settingsJson, loggingLevel !== null && loggingLevel !== void 0 ? loggingLevel : 2 /* LogLevel.Info */); } - login(email, password) { - return __awaiter(this, void 0, void 0, function* () { - const response = yield this.client.runCommand(schemas_1.Convert.commandToJson({ - passwordLogin: { - email: email, - password: password, - }, - })); - return schemas_1.Convert.toResponseForPasswordLoginResponse(response); - }); - } loginWithAccessToken(accessToken) { return __awaiter(this, void 0, void 0, function* () { const commandInput = schemas_1.Convert.commandToJson({ @@ -62,16 +51,19 @@ class BitwardenClient { return schemas_1.Convert.toResponseForAPIKeyLoginResponse(response); }); } - sync(excludeSubdomains = false) { - return __awaiter(this, void 0, void 0, function* () { - const response = yield this.client.runCommand(schemas_1.Convert.commandToJson({ - sync: { - excludeSubdomains, - }, - })); - return schemas_1.Convert.toResponseForSyncResponse(response); - }); + /* + async sync(excludeSubdomains = false): Promise { + const response = await this.client.runCommand( + Convert.commandToJson({ + sync: { + excludeSubdomains, + }, + }) + ); + + return Convert.toResponseForSyncResponse(response); } + */ secrets() { return new SecretsClient(this.client); } @@ -91,6 +83,16 @@ class SecretsClient { return schemas_1.Convert.toResponseForSecretResponse(response); }); } + getByIds(ids) { + return __awaiter(this, void 0, void 0, function* () { + const response = yield this.client.runCommand(schemas_1.Convert.commandToJson({ + secrets: { + getByIds: { ids }, + }, + })); + return schemas_1.Convert.toResponseForSecretsResponse(response); + }); + } create(key, note, organizationId, value) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.client.runCommand(schemas_1.Convert.commandToJson({ diff --git a/dist/node_modules/@bitwarden/sdk-napi/dist/bitwarden_client/schemas.d.ts b/dist/node_modules/@bitwarden/sdk-napi/dist/bitwarden_client/schemas.d.ts index 3a4d7c6..986afef 100644 --- a/dist/node_modules/@bitwarden/sdk-napi/dist/bitwarden_client/schemas.d.ts +++ b/dist/node_modules/@bitwarden/sdk-napi/dist/bitwarden_client/schemas.d.ts @@ -5,7 +5,7 @@ * * Defaults to * - * ``` # use bitwarden::sdk::request::client_settings::{ClientSettings, DeviceType}; # use + * ``` # use bitwarden::client::client_settings::{ClientSettings, DeviceType}; # use * assert_matches::assert_matches; let settings = ClientSettings { identity_url: * "https://identity.bitwarden.com".to_string(), api_url: * "https://api.bitwarden.com".to_string(), user_agent: "Bitwarden Rust-SDK".to_string(), @@ -18,20 +18,20 @@ export interface ClientSettings { /** * The api url of the targeted Bitwarden instance. Defaults to `https://api.bitwarden.com` */ - apiUrl: string; + apiUrl?: string; /** * Device type to send to Bitwarden. Defaults to SDK */ - deviceType: DeviceType; + deviceType?: DeviceType; /** * The identity url of the targeted Bitwarden instance. Defaults to * `https://identity.bitwarden.com` */ - identityUrl: string; + identityUrl?: string; /** * The user_agent to sent to Bitwarden. Defaults to `Bitwarden Rust-SDK` */ - userAgent: string; + userAgent?: string; } /** * Device type to send to Bitwarden. Defaults to SDK @@ -69,35 +69,39 @@ export declare enum DeviceType { * * This command is not capable of handling authentication requiring 2fa or captcha. * - * Returns: [PasswordLoginResponse](crate::sdk::auth::response::PasswordLoginResponse) + * Returns: [PasswordLoginResponse](bitwarden::auth::login::PasswordLoginResponse) * * Login with API Key * * This command is for initiating an authentication handshake with Bitwarden. * - * Returns: [ApiKeyLoginResponse](crate::sdk::auth::response::ApiKeyLoginResponse) + * Returns: [ApiKeyLoginResponse](bitwarden::auth::login::ApiKeyLoginResponse) * * Login with Secrets Manager Access Token * * This command is for initiating an authentication handshake with Bitwarden. * - * Returns: [ApiKeyLoginResponse](crate::sdk::auth::response::ApiKeyLoginResponse) + * Returns: [ApiKeyLoginResponse](bitwarden::auth::login::ApiKeyLoginResponse) * * > Requires Authentication Get the API key of the currently authenticated user * - * Returns: - * [UserApiKeyResponse](crate::sdk::response::user_api_key_response::UserApiKeyResponse) + * Returns: [UserApiKeyResponse](bitwarden::platform::UserApiKeyResponse) + * + * Get the user's passphrase + * + * Returns: String * * > Requires Authentication Retrieve all user data, ciphers and organizations the user is a * part of * - * Returns: [SyncResponse](crate::sdk::response::sync_response::SyncResponse) + * Returns: [SyncResponse](bitwarden::platform::SyncResponse) */ export interface Command { passwordLogin?: PasswordLoginRequest; apiKeyLogin?: APIKeyLoginRequest; accessTokenLogin?: AccessTokenLoginRequest; getUserApiKey?: SecretVerificationRequest; + fingerprint?: FingerprintRequest; sync?: SyncRequest; secrets?: SecretsCommand; projects?: ProjectsCommand; @@ -128,6 +132,16 @@ export interface APIKeyLoginRequest { */ password: string; } +export interface FingerprintRequest { + /** + * The input material, used in the fingerprint generation process. + */ + fingerprintMaterial: string; + /** + * The user's public key encoded with base64. + */ + publicKey: string; +} export interface SecretVerificationRequest { /** * The user's master password to use for user verification. If supplied, this will be used @@ -149,25 +163,104 @@ export interface PasswordLoginRequest { * Bitwarden account email address */ email: string; + /** + * Kdf from prelogin + */ + kdf: PasswordLoginKdf; /** * Bitwarden account master password */ password: string; + twoFactor?: TwoFactorRequest | null; +} +/** + * Kdf from prelogin + */ +export interface PasswordLoginKdf { + pBKDF2?: PurplePBKDF2; + argon2id?: PurpleArgon2ID; +} +export interface PurpleArgon2ID { + iterations: number; + memory: number; + parallelism: number; +} +export interface PurplePBKDF2 { + iterations: number; +} +export interface TwoFactorRequest { + /** + * Two-factor provider + */ + provider: TwoFactorProvider; + /** + * Two-factor remember + */ + remember: boolean; + /** + * Two-factor Token + */ + token: string; +} +/** + * Two-factor provider + */ +export declare enum TwoFactorProvider { + Authenticator = "Authenticator", + Duo = "Duo", + Email = "Email", + OrganizationDuo = "OrganizationDuo", + Remember = "Remember", + U2F = "U2f", + WebAuthn = "WebAuthn", + Yubikey = "Yubikey" } /** * > Requires Authentication > Requires using an Access Token for login or calling Sync at * least once Retrieve a project by the provided identifier * - * Returns: [ProjectResponse](crate::sdk::response::projects_response::ProjectResponse) + * Returns: [ProjectResponse](bitwarden::secrets_manager::projects::ProjectResponse) + * + * > Requires Authentication > Requires using an Access Token for login or calling Sync at + * least once Creates a new project in the provided organization using the given data + * + * Returns: [ProjectResponse](bitwarden::secrets_manager::projects::ProjectResponse) * * > Requires Authentication > Requires using an Access Token for login or calling Sync at * least once Lists all projects of the given organization * - * Returns: [ProjectsResponse](crate::sdk::response::projects_response::ProjectsResponse) + * Returns: [ProjectsResponse](bitwarden::secrets_manager::projects::ProjectsResponse) + * + * > Requires Authentication > Requires using an Access Token for login or calling Sync at + * least once Updates an existing project with the provided ID using the given data + * + * Returns: [ProjectResponse](bitwarden::secrets_manager::projects::ProjectResponse) + * + * > Requires Authentication > Requires using an Access Token for login or calling Sync at + * least once Deletes all the projects whose IDs match the provided ones + * + * Returns: + * [ProjectsDeleteResponse](bitwarden::secrets_manager::projects::ProjectsDeleteResponse) */ export interface ProjectsCommand { get?: ProjectGetRequest; + create?: ProjectCreateRequest; list?: ProjectsListRequest; + update?: ProjectPutRequest; + delete?: ProjectsDeleteRequest; +} +export interface ProjectCreateRequest { + name: string; + /** + * Organization where the project will be created + */ + organizationId: string; +} +export interface ProjectsDeleteRequest { + /** + * IDs of the projects to delete + */ + ids: string[]; } export interface ProjectGetRequest { /** @@ -181,37 +274,54 @@ export interface ProjectsListRequest { */ organizationId: string; } +export interface ProjectPutRequest { + /** + * ID of the project to modify + */ + id: string; + name: string; + /** + * Organization ID of the project to modify + */ + organizationId: string; +} /** * > Requires Authentication > Requires using an Access Token for login or calling Sync at * least once Retrieve a secret by the provided identifier * - * Returns: [SecretResponse](crate::sdk::response::secrets_response::SecretResponse) + * Returns: [SecretResponse](bitwarden::secrets_manager::secrets::SecretResponse) + * + * > Requires Authentication > Requires using an Access Token for login or calling Sync at + * least once Retrieve secrets by the provided identifiers + * + * Returns: [SecretsResponse](bitwarden::secrets_manager::secrets::SecretsResponse) * * > Requires Authentication > Requires using an Access Token for login or calling Sync at * least once Creates a new secret in the provided organization using the given data * - * Returns: [SecretResponse](crate::sdk::response::secrets_response::SecretResponse) + * Returns: [SecretResponse](bitwarden::secrets_manager::secrets::SecretResponse) * * > Requires Authentication > Requires using an Access Token for login or calling Sync at * least once Lists all secret identifiers of the given organization, to then retrieve each * secret, use `CreateSecret` * * Returns: - * [SecretIdentifiersResponse](crate::sdk::response::secrets_response::SecretIdentifiersResponse) + * [SecretIdentifiersResponse](bitwarden::secrets_manager::secrets::SecretIdentifiersResponse) * * > Requires Authentication > Requires using an Access Token for login or calling Sync at * least once Updates an existing secret with the provided ID using the given data * - * Returns: [SecretResponse](crate::sdk::response::secrets_response::SecretResponse) + * Returns: [SecretResponse](bitwarden::secrets_manager::secrets::SecretResponse) * * > Requires Authentication > Requires using an Access Token for login or calling Sync at * least once Deletes all the secrets whose IDs match the provided ones * * Returns: - * [SecretsDeleteResponse](crate::sdk::response::secrets_response::SecretsDeleteResponse) + * [SecretsDeleteResponse](bitwarden::secrets_manager::secrets::SecretsDeleteResponse) */ export interface SecretsCommand { get?: SecretGetRequest; + getByIds?: SecretsGetRequest; create?: SecretCreateRequest; list?: SecretIdentifiersRequest; update?: SecretPutRequest; @@ -224,6 +334,10 @@ export interface SecretCreateRequest { * Organization where the secret will be created */ organizationId: string; + /** + * IDs of the projects that this secret will belong to + */ + projectIds?: string[] | null; value: string; } export interface SecretsDeleteRequest { @@ -238,6 +352,12 @@ export interface SecretGetRequest { */ id: string; } +export interface SecretsGetRequest { + /** + * IDs of the secrets to retrieve + */ + ids: string[]; +} export interface SecretIdentifiersRequest { /** * Organization to retrieve all the secrets from @@ -255,6 +375,7 @@ export interface SecretPutRequest { * Organization ID of the secret to modify */ organizationId: string; + projectIds?: string[] | null; value: string; } export interface SyncRequest { @@ -263,6 +384,455 @@ export interface SyncRequest { */ excludeSubdomains?: boolean | null; } +export interface DocRef { + Cipher?: Cipher; + CipherView?: CipherView; + Collection?: Collection; + Folder?: Folder; + FolderView?: FolderView; + Send?: Send; + SendView?: SendView; + SendListView?: SendListView; + InitCryptoRequest?: InitCryptoRequest; + PasswordGeneratorRequest?: PasswordGeneratorRequest; + PassphraseGeneratorRequest?: PassphraseGeneratorRequest; + ExportFormat?: ExportFormatClass | ExportFormatEnum; + MasterPasswordPolicyOptions?: MasterPasswordPolicyOptions; + Kdf?: InitCryptoRequestKdf; +} +export interface Cipher { + attachments?: Attachment[] | null; + card?: Card | null; + collectionIds: string[]; + creationDate: Date; + deletedDate?: Date | null; + edit: boolean; + favorite: boolean; + fields?: Field[] | null; + folderId?: null | string; + id?: null | string; + identity?: Identity | null; + localData?: LocalData | null; + login?: Login | null; + name: string; + notes?: null | string; + organizationId?: null | string; + organizationUseTotp: boolean; + passwordHistory?: PasswordHistory[] | null; + reprompt: CipherRepromptType; + revisionDate: Date; + secureNote?: SecureNote | null; + type: CipherType; + viewPassword: boolean; +} +export interface Attachment { + fileName?: null | string; + id?: null | string; + key?: null | string; + size?: null | string; + /** + * Readable size, ex: "4.2 KB" or "1.43 GB" + */ + sizeName?: null | string; + url?: null | string; +} +export interface Card { + brand?: null | string; + cardholderName?: null | string; + code?: null | string; + expMonth?: null | string; + expYear?: null | string; + number?: null | string; +} +export interface Field { + linkedId?: LinkedIDType | null; + name?: null | string; + type: FieldType; + value?: null | string; +} +export declare enum LinkedIDType { + Address1 = "Address1", + Address2 = "Address2", + Address3 = "Address3", + Brand = "Brand", + CardholderName = "CardholderName", + City = "City", + Code = "Code", + Company = "Company", + Country = "Country", + Email = "Email", + ExpMonth = "ExpMonth", + ExpYear = "ExpYear", + FirstName = "FirstName", + FullName = "FullName", + LastName = "LastName", + LicenseNumber = "LicenseNumber", + MiddleName = "MiddleName", + Number = "Number", + PassportNumber = "PassportNumber", + Password = "Password", + Phone = "Phone", + PostalCode = "PostalCode", + Ssn = "Ssn", + State = "State", + Title = "Title", + Username = "Username" +} +export declare enum FieldType { + Boolean = "Boolean", + Hidden = "Hidden", + Linked = "Linked", + Text = "Text" +} +export interface Identity { + address1?: null | string; + address2?: null | string; + address3?: null | string; + city?: null | string; + company?: null | string; + country?: null | string; + email?: null | string; + firstName?: null | string; + lastName?: null | string; + licenseNumber?: null | string; + middleName?: null | string; + passportNumber?: null | string; + phone?: null | string; + postalCode?: null | string; + ssn?: null | string; + state?: null | string; + title?: null | string; + username?: null | string; +} +export interface LocalData { + lastLaunched?: number | null; + lastUsedDate?: number | null; +} +export interface Login { + autofillOnPageLoad?: boolean | null; + password?: null | string; + passwordRevisionDate?: Date | null; + totp?: null | string; + uris?: LoginURI[] | null; + username?: null | string; +} +export interface LoginURI { + match?: URIMatchType | null; + uri?: null | string; +} +export declare enum URIMatchType { + Domain = "domain", + Exact = "exact", + Host = "host", + Never = "never", + RegularExpression = "regularExpression", + StartsWith = "startsWith" +} +export interface PasswordHistory { + lastUsedDate: Date; + password: string; +} +export declare enum CipherRepromptType { + None = "None", + Password = "Password" +} +export interface SecureNote { + type: SecureNoteType; +} +export declare enum SecureNoteType { + Generic = "Generic" +} +export declare enum CipherType { + Card = "Card", + Identity = "Identity", + Login = "Login", + SecureNote = "SecureNote" +} +export interface CipherView { + attachments?: AttachmentView[] | null; + card?: CardView | null; + collectionIds: string[]; + creationDate: Date; + deletedDate?: Date | null; + edit: boolean; + favorite: boolean; + fields?: FieldView[] | null; + folderId?: null | string; + id?: null | string; + identity?: IdentityView | null; + localData?: LocalDataView | null; + login?: LoginView | null; + name: string; + notes?: null | string; + organizationId?: null | string; + organizationUseTotp: boolean; + passwordHistory?: PasswordHistoryView[] | null; + reprompt: CipherRepromptType; + revisionDate: Date; + secureNote?: SecureNoteView | null; + type: CipherType; + viewPassword: boolean; +} +export interface AttachmentView { + fileName?: null | string; + id?: null | string; + key?: null | string; + size?: null | string; + sizeName?: null | string; + url?: null | string; +} +export interface CardView { + brand?: null | string; + cardholderName?: null | string; + code?: null | string; + expMonth?: null | string; + expYear?: null | string; + number?: null | string; +} +export interface FieldView { + linkedId?: LinkedIDType | null; + name?: null | string; + type: FieldType; + value?: null | string; +} +export interface IdentityView { + address1?: null | string; + address2?: null | string; + address3?: null | string; + city?: null | string; + company?: null | string; + country?: null | string; + email?: null | string; + firstName?: null | string; + lastName?: null | string; + licenseNumber?: null | string; + middleName?: null | string; + passportNumber?: null | string; + phone?: null | string; + postalCode?: null | string; + ssn?: null | string; + state?: null | string; + title?: null | string; + username?: null | string; +} +export interface LocalDataView { + lastLaunched?: number | null; + lastUsedDate?: number | null; +} +export interface LoginView { + autofillOnPageLoad?: boolean | null; + password?: null | string; + passwordRevisionDate?: Date | null; + totp?: null | string; + uris?: LoginURIView[] | null; + username?: null | string; +} +export interface LoginURIView { + match?: URIMatchType | null; + uri?: null | string; +} +export interface PasswordHistoryView { + lastUsedDate: Date; + password: string; +} +export interface SecureNoteView { + type: SecureNoteType; +} +export interface Collection { + externalId?: null | string; + hidePasswords: boolean; + id: string; + name: string; + organizationId: string; + readOnly: boolean; +} +export interface ExportFormatClass { + EncryptedJson: EncryptedJSON; +} +export interface EncryptedJSON { + password: string; + [property: string]: any; +} +export declare enum ExportFormatEnum { + AccountEncryptedJSON = "AccountEncryptedJson", + CSV = "Csv", + JSON = "Json" +} +export interface Folder { + id: string; + name: string; + revisionDate: Date; + [property: string]: any; +} +export interface FolderView { + id: string; + name: string; + revisionDate: Date; + [property: string]: any; +} +export interface InitCryptoRequest { + /** + * The user's email address + */ + email: string; + /** + * The user's KDF parameters, as received from the prelogin request + */ + kdfParams: InitCryptoRequestKdf; + /** + * The encryption keys for all the organizations the user is a part of + */ + organizationKeys: { + [key: string]: string; + }; + /** + * The user's master password + */ + password: string; + /** + * The user's encryptred private key + */ + privateKey: string; + /** + * The user's encrypted symmetric crypto key + */ + userKey: string; +} +/** + * The user's KDF parameters, as received from the prelogin request + */ +export interface InitCryptoRequestKdf { + pBKDF2?: FluffyPBKDF2; + argon2id?: FluffyArgon2ID; +} +export interface FluffyArgon2ID { + iterations: number; + memory: number; + parallelism: number; +} +export interface FluffyPBKDF2 { + iterations: number; +} +export interface MasterPasswordPolicyOptions { + /** + * Flag to indicate if the policy should be enforced on login. If true, and the user's + * password does not meet the policy requirements, the user will be forced to update their + * password. + */ + enforce_on_login: boolean; + min_complexity: number; + min_length: number; + require_lower: boolean; + require_numbers: boolean; + require_special: boolean; + require_upper: boolean; + [property: string]: any; +} +/** + * Passphrase generator request. + * + * The default separator is `-` and default number of words is 3. + */ +export interface PassphraseGeneratorRequest { + capitalize?: boolean | null; + includeNumber?: boolean | null; + numWords?: number | null; + wordSeparator?: null | string; +} +/** + * Password generator request. If all options are false, the default is to generate a + * password with: - lowercase - uppercase - numbers + * + * The default length is 16. + */ +export interface PasswordGeneratorRequest { + avoidAmbiguous?: boolean | null; + length?: number | null; + lowercase: boolean; + minLowercase?: boolean | null; + minNumber?: boolean | null; + minSpecial?: boolean | null; + minUppercase?: boolean | null; + numbers: boolean; + special: boolean; + uppercase: boolean; +} +export interface Send { + accessCount: number; + accessId: string; + deletionDate: Date; + disabled: boolean; + expirationDate?: Date | null; + file?: SendFile | null; + hideEmail: boolean; + id: string; + key: string; + maxAccessCount?: number | null; + name: string; + notes?: null | string; + password?: null | string; + revisionDate: Date; + text?: SendText | null; + type: SendType; +} +export interface SendFile { + fileName: string; + id: string; + size: string; + /** + * Readable size, ex: "4.2 KB" or "1.43 GB" + */ + sizeName: string; +} +export interface SendText { + hidden: boolean; + text?: null | string; +} +export declare enum SendType { + File = "File", + Text = "Text" +} +export interface SendListView { + accessId: string; + deletionDate: Date; + disabled: boolean; + expirationDate?: Date | null; + id: string; + name: string; + revisionDate: Date; + type: SendType; +} +export interface SendView { + accessCount: number; + accessId: string; + deletionDate: Date; + disabled: boolean; + expirationDate?: Date | null; + file?: SendFileView | null; + hideEmail: boolean; + id: string; + key: string; + maxAccessCount?: number | null; + name: string; + notes?: null | string; + password?: null | string; + revisionDate: Date; + text?: SendTextView | null; + type: SendType; +} +export interface SendFileView { + fileName: string; + id: string; + size: string; + /** + * Readable size, ex: "4.2 KB" or "1.43 GB" + */ + sizeName: string; +} +export interface SendTextView { + hidden: boolean; + text?: null | string; +} export interface ResponseForAPIKeyLoginResponse { /** * The response data. Populated if `success` is true. @@ -338,6 +908,23 @@ export interface PurpleYubiKey { */ nfc: boolean; } +export interface ResponseForFingerprintResponse { + /** + * The response data. Populated if `success` is true. + */ + data?: FingerprintResponse | null; + /** + * A message for any error that may occur. Populated if `success` is false. + */ + errorMessage?: null | string; + /** + * Whether or not the SDK request succeeded. + */ + success: boolean; +} +export interface FingerprintResponse { + fingerprint: string; +} export interface ResponseForPasswordLoginResponse { /** * The response data. Populated if `success` is true. @@ -428,11 +1015,11 @@ export interface FluffyYubiKey { */ nfc: boolean; } -export interface ResponseForSecretDeleteResponse { +export interface ResponseForProjectResponse { /** * The response data. Populated if `success` is true. */ - data?: SecretDeleteResponse | null; + data?: ProjectResponse | null; /** * A message for any error that may occur. Populated if `success` is false. */ @@ -442,15 +1029,39 @@ export interface ResponseForSecretDeleteResponse { */ success: boolean; } -export interface SecretDeleteResponse { +export interface ProjectResponse { + creationDate: Date; + id: string; + name: string; + organizationId: string; + revisionDate: Date; +} +export interface ResponseForProjectsDeleteResponse { + /** + * The response data. Populated if `success` is true. + */ + data?: ProjectsDeleteResponse | null; + /** + * A message for any error that may occur. Populated if `success` is false. + */ + errorMessage?: null | string; + /** + * Whether or not the SDK request succeeded. + */ + success: boolean; +} +export interface ProjectsDeleteResponse { + data: ProjectDeleteResponse[]; +} +export interface ProjectDeleteResponse { error?: null | string; id: string; } -export interface ResponseForSecretIdentifierResponse { +export interface ResponseForProjectsResponse { /** * The response data. Populated if `success` is true. */ - data?: SecretIdentifierResponse | null; + data?: ProjectsResponse | null; /** * A message for any error that may occur. Populated if `success` is false. */ @@ -460,10 +1071,15 @@ export interface ResponseForSecretIdentifierResponse { */ success: boolean; } -export interface SecretIdentifierResponse { +export interface ProjectsResponse { + data: DatumElement[]; +} +export interface DatumElement { + creationDate: Date; id: string; - key: string; + name: string; organizationId: string; + revisionDate: Date; } export interface ResponseForSecretIdentifiersResponse { /** @@ -480,9 +1096,9 @@ export interface ResponseForSecretIdentifiersResponse { success: boolean; } export interface SecretIdentifiersResponse { - data: DatumElement[]; + data: SecretIdentifierResponse[]; } -export interface DatumElement { +export interface SecretIdentifierResponse { id: string; key: string; organizationId: string; @@ -502,14 +1118,13 @@ export interface ResponseForSecretResponse { success: boolean; } export interface SecretResponse { - creationDate: string; + creationDate: Date; id: string; key: string; note: string; - object: string; organizationId: string; projectId?: null | string; - revisionDate: string; + revisionDate: Date; value: string; } export interface ResponseForSecretsDeleteResponse { @@ -527,11 +1142,38 @@ export interface ResponseForSecretsDeleteResponse { success: boolean; } export interface SecretsDeleteResponse { + data: SecretDeleteResponse[]; +} +export interface SecretDeleteResponse { + error?: null | string; + id: string; +} +export interface ResponseForSecretsResponse { + /** + * The response data. Populated if `success` is true. + */ + data?: SecretsResponse | null; + /** + * A message for any error that may occur. Populated if `success` is false. + */ + errorMessage?: null | string; + /** + * Whether or not the SDK request succeeded. + */ + success: boolean; +} +export interface SecretsResponse { data: DatumClass[]; } export interface DatumClass { - error?: null | string; + creationDate: Date; id: string; + key: string; + note: string; + organizationId: string; + projectId?: null | string; + revisionDate: Date; + value: string; } export interface ResponseForSyncResponse { /** @@ -598,20 +1240,28 @@ export declare class Convert { static clientSettingsToJson(value: ClientSettings): string; static toCommand(json: string): Command; static commandToJson(value: Command): string; + static toDocRef(json: string): DocRef; + static docRefToJson(value: DocRef): string; static toResponseForAPIKeyLoginResponse(json: string): ResponseForAPIKeyLoginResponse; static responseForAPIKeyLoginResponseToJson(value: ResponseForAPIKeyLoginResponse): string; + static toResponseForFingerprintResponse(json: string): ResponseForFingerprintResponse; + static responseForFingerprintResponseToJson(value: ResponseForFingerprintResponse): string; static toResponseForPasswordLoginResponse(json: string): ResponseForPasswordLoginResponse; static responseForPasswordLoginResponseToJson(value: ResponseForPasswordLoginResponse): string; - static toResponseForSecretDeleteResponse(json: string): ResponseForSecretDeleteResponse; - static responseForSecretDeleteResponseToJson(value: ResponseForSecretDeleteResponse): string; - static toResponseForSecretIdentifierResponse(json: string): ResponseForSecretIdentifierResponse; - static responseForSecretIdentifierResponseToJson(value: ResponseForSecretIdentifierResponse): string; + static toResponseForProjectResponse(json: string): ResponseForProjectResponse; + static responseForProjectResponseToJson(value: ResponseForProjectResponse): string; + static toResponseForProjectsDeleteResponse(json: string): ResponseForProjectsDeleteResponse; + static responseForProjectsDeleteResponseToJson(value: ResponseForProjectsDeleteResponse): string; + static toResponseForProjectsResponse(json: string): ResponseForProjectsResponse; + static responseForProjectsResponseToJson(value: ResponseForProjectsResponse): string; static toResponseForSecretIdentifiersResponse(json: string): ResponseForSecretIdentifiersResponse; static responseForSecretIdentifiersResponseToJson(value: ResponseForSecretIdentifiersResponse): string; static toResponseForSecretResponse(json: string): ResponseForSecretResponse; static responseForSecretResponseToJson(value: ResponseForSecretResponse): string; static toResponseForSecretsDeleteResponse(json: string): ResponseForSecretsDeleteResponse; static responseForSecretsDeleteResponseToJson(value: ResponseForSecretsDeleteResponse): string; + static toResponseForSecretsResponse(json: string): ResponseForSecretsResponse; + static responseForSecretsResponseToJson(value: ResponseForSecretsResponse): string; static toResponseForSyncResponse(json: string): ResponseForSyncResponse; static responseForSyncResponseToJson(value: ResponseForSyncResponse): string; static toResponseForUserAPIKeyResponse(json: string): ResponseForUserAPIKeyResponse; diff --git a/dist/node_modules/@bitwarden/sdk-napi/dist/bitwarden_client/schemas.js b/dist/node_modules/@bitwarden/sdk-napi/dist/bitwarden_client/schemas.js index 9436c48..4745802 100644 --- a/dist/node_modules/@bitwarden/sdk-napi/dist/bitwarden_client/schemas.js +++ b/dist/node_modules/@bitwarden/sdk-napi/dist/bitwarden_client/schemas.js @@ -1,24 +1,28 @@ "use strict"; // To parse this data: // -// import { Convert, ClientSettings, Command, ResponseForAPIKeyLoginResponse, ResponseForPasswordLoginResponse, ResponseForSecretDeleteResponse, ResponseForSecretIdentifierResponse, ResponseForSecretIdentifiersResponse, ResponseForSecretResponse, ResponseForSecretsDeleteResponse, ResponseForSyncResponse, ResponseForUserAPIKeyResponse } from "./file"; +// import { Convert, ClientSettings, Command, DocRef, ResponseForAPIKeyLoginResponse, ResponseForFingerprintResponse, ResponseForPasswordLoginResponse, ResponseForProjectResponse, ResponseForProjectsDeleteResponse, ResponseForProjectsResponse, ResponseForSecretIdentifiersResponse, ResponseForSecretResponse, ResponseForSecretsDeleteResponse, ResponseForSecretsResponse, ResponseForSyncResponse, ResponseForUserAPIKeyResponse } from "./file"; // // const clientSettings = Convert.toClientSettings(json); // const command = Convert.toCommand(json); +// const docRef = Convert.toDocRef(json); // const responseForAPIKeyLoginResponse = Convert.toResponseForAPIKeyLoginResponse(json); +// const responseForFingerprintResponse = Convert.toResponseForFingerprintResponse(json); // const responseForPasswordLoginResponse = Convert.toResponseForPasswordLoginResponse(json); -// const responseForSecretDeleteResponse = Convert.toResponseForSecretDeleteResponse(json); -// const responseForSecretIdentifierResponse = Convert.toResponseForSecretIdentifierResponse(json); +// const responseForProjectResponse = Convert.toResponseForProjectResponse(json); +// const responseForProjectsDeleteResponse = Convert.toResponseForProjectsDeleteResponse(json); +// const responseForProjectsResponse = Convert.toResponseForProjectsResponse(json); // const responseForSecretIdentifiersResponse = Convert.toResponseForSecretIdentifiersResponse(json); // const responseForSecretResponse = Convert.toResponseForSecretResponse(json); // const responseForSecretsDeleteResponse = Convert.toResponseForSecretsDeleteResponse(json); +// const responseForSecretsResponse = Convert.toResponseForSecretsResponse(json); // const responseForSyncResponse = Convert.toResponseForSyncResponse(json); // const responseForUserAPIKeyResponse = Convert.toResponseForUserAPIKeyResponse(json); // // These functions will throw an error if the JSON doesn't // match the expected interface, even if the JSON is valid. Object.defineProperty(exports, "__esModule", { value: true }); -exports.Convert = exports.DeviceType = void 0; +exports.Convert = exports.SendType = exports.ExportFormatEnum = exports.CipherType = exports.SecureNoteType = exports.CipherRepromptType = exports.URIMatchType = exports.FieldType = exports.LinkedIDType = exports.TwoFactorProvider = exports.DeviceType = void 0; /** * Device type to send to Bitwarden. Defaults to SDK */ @@ -46,7 +50,93 @@ var DeviceType; DeviceType["VivaldiBrowser"] = "VivaldiBrowser"; DeviceType["VivaldiExtension"] = "VivaldiExtension"; DeviceType["WindowsDesktop"] = "WindowsDesktop"; -})(DeviceType = exports.DeviceType || (exports.DeviceType = {})); +})(DeviceType || (exports.DeviceType = DeviceType = {})); +/** + * Two-factor provider + */ +var TwoFactorProvider; +(function (TwoFactorProvider) { + TwoFactorProvider["Authenticator"] = "Authenticator"; + TwoFactorProvider["Duo"] = "Duo"; + TwoFactorProvider["Email"] = "Email"; + TwoFactorProvider["OrganizationDuo"] = "OrganizationDuo"; + TwoFactorProvider["Remember"] = "Remember"; + TwoFactorProvider["U2F"] = "U2f"; + TwoFactorProvider["WebAuthn"] = "WebAuthn"; + TwoFactorProvider["Yubikey"] = "Yubikey"; +})(TwoFactorProvider || (exports.TwoFactorProvider = TwoFactorProvider = {})); +var LinkedIDType; +(function (LinkedIDType) { + LinkedIDType["Address1"] = "Address1"; + LinkedIDType["Address2"] = "Address2"; + LinkedIDType["Address3"] = "Address3"; + LinkedIDType["Brand"] = "Brand"; + LinkedIDType["CardholderName"] = "CardholderName"; + LinkedIDType["City"] = "City"; + LinkedIDType["Code"] = "Code"; + LinkedIDType["Company"] = "Company"; + LinkedIDType["Country"] = "Country"; + LinkedIDType["Email"] = "Email"; + LinkedIDType["ExpMonth"] = "ExpMonth"; + LinkedIDType["ExpYear"] = "ExpYear"; + LinkedIDType["FirstName"] = "FirstName"; + LinkedIDType["FullName"] = "FullName"; + LinkedIDType["LastName"] = "LastName"; + LinkedIDType["LicenseNumber"] = "LicenseNumber"; + LinkedIDType["MiddleName"] = "MiddleName"; + LinkedIDType["Number"] = "Number"; + LinkedIDType["PassportNumber"] = "PassportNumber"; + LinkedIDType["Password"] = "Password"; + LinkedIDType["Phone"] = "Phone"; + LinkedIDType["PostalCode"] = "PostalCode"; + LinkedIDType["Ssn"] = "Ssn"; + LinkedIDType["State"] = "State"; + LinkedIDType["Title"] = "Title"; + LinkedIDType["Username"] = "Username"; +})(LinkedIDType || (exports.LinkedIDType = LinkedIDType = {})); +var FieldType; +(function (FieldType) { + FieldType["Boolean"] = "Boolean"; + FieldType["Hidden"] = "Hidden"; + FieldType["Linked"] = "Linked"; + FieldType["Text"] = "Text"; +})(FieldType || (exports.FieldType = FieldType = {})); +var URIMatchType; +(function (URIMatchType) { + URIMatchType["Domain"] = "domain"; + URIMatchType["Exact"] = "exact"; + URIMatchType["Host"] = "host"; + URIMatchType["Never"] = "never"; + URIMatchType["RegularExpression"] = "regularExpression"; + URIMatchType["StartsWith"] = "startsWith"; +})(URIMatchType || (exports.URIMatchType = URIMatchType = {})); +var CipherRepromptType; +(function (CipherRepromptType) { + CipherRepromptType["None"] = "None"; + CipherRepromptType["Password"] = "Password"; +})(CipherRepromptType || (exports.CipherRepromptType = CipherRepromptType = {})); +var SecureNoteType; +(function (SecureNoteType) { + SecureNoteType["Generic"] = "Generic"; +})(SecureNoteType || (exports.SecureNoteType = SecureNoteType = {})); +var CipherType; +(function (CipherType) { + CipherType["Card"] = "Card"; + CipherType["Identity"] = "Identity"; + CipherType["Login"] = "Login"; + CipherType["SecureNote"] = "SecureNote"; +})(CipherType || (exports.CipherType = CipherType = {})); +var ExportFormatEnum; +(function (ExportFormatEnum) { + ExportFormatEnum["AccountEncryptedJSON"] = "AccountEncryptedJson"; + ExportFormatEnum["CSV"] = "Csv"; + ExportFormatEnum["JSON"] = "Json"; +})(ExportFormatEnum || (exports.ExportFormatEnum = ExportFormatEnum = {})); +var SendType; +(function (SendType) { + SendType["File"] = "File"; + SendType["Text"] = "Text"; +})(SendType || (exports.SendType = SendType = {})); // Converts JSON strings to/from your types // and asserts the results of JSON.parse at runtime class Convert { @@ -62,29 +152,47 @@ class Convert { static commandToJson(value) { return JSON.stringify(uncast(value, r("Command")), null, 2); } + static toDocRef(json) { + return cast(JSON.parse(json), r("DocRef")); + } + static docRefToJson(value) { + return JSON.stringify(uncast(value, r("DocRef")), null, 2); + } static toResponseForAPIKeyLoginResponse(json) { return cast(JSON.parse(json), r("ResponseForAPIKeyLoginResponse")); } static responseForAPIKeyLoginResponseToJson(value) { return JSON.stringify(uncast(value, r("ResponseForAPIKeyLoginResponse")), null, 2); } + static toResponseForFingerprintResponse(json) { + return cast(JSON.parse(json), r("ResponseForFingerprintResponse")); + } + static responseForFingerprintResponseToJson(value) { + return JSON.stringify(uncast(value, r("ResponseForFingerprintResponse")), null, 2); + } static toResponseForPasswordLoginResponse(json) { return cast(JSON.parse(json), r("ResponseForPasswordLoginResponse")); } static responseForPasswordLoginResponseToJson(value) { return JSON.stringify(uncast(value, r("ResponseForPasswordLoginResponse")), null, 2); } - static toResponseForSecretDeleteResponse(json) { - return cast(JSON.parse(json), r("ResponseForSecretDeleteResponse")); + static toResponseForProjectResponse(json) { + return cast(JSON.parse(json), r("ResponseForProjectResponse")); + } + static responseForProjectResponseToJson(value) { + return JSON.stringify(uncast(value, r("ResponseForProjectResponse")), null, 2); } - static responseForSecretDeleteResponseToJson(value) { - return JSON.stringify(uncast(value, r("ResponseForSecretDeleteResponse")), null, 2); + static toResponseForProjectsDeleteResponse(json) { + return cast(JSON.parse(json), r("ResponseForProjectsDeleteResponse")); } - static toResponseForSecretIdentifierResponse(json) { - return cast(JSON.parse(json), r("ResponseForSecretIdentifierResponse")); + static responseForProjectsDeleteResponseToJson(value) { + return JSON.stringify(uncast(value, r("ResponseForProjectsDeleteResponse")), null, 2); } - static responseForSecretIdentifierResponseToJson(value) { - return JSON.stringify(uncast(value, r("ResponseForSecretIdentifierResponse")), null, 2); + static toResponseForProjectsResponse(json) { + return cast(JSON.parse(json), r("ResponseForProjectsResponse")); + } + static responseForProjectsResponseToJson(value) { + return JSON.stringify(uncast(value, r("ResponseForProjectsResponse")), null, 2); } static toResponseForSecretIdentifiersResponse(json) { return cast(JSON.parse(json), r("ResponseForSecretIdentifiersResponse")); @@ -104,6 +212,12 @@ class Convert { static responseForSecretsDeleteResponseToJson(value) { return JSON.stringify(uncast(value, r("ResponseForSecretsDeleteResponse")), null, 2); } + static toResponseForSecretsResponse(json) { + return cast(JSON.parse(json), r("ResponseForSecretsResponse")); + } + static responseForSecretsResponseToJson(value) { + return JSON.stringify(uncast(value, r("ResponseForSecretsResponse")), null, 2); + } static toResponseForSyncResponse(json) { return cast(JSON.parse(json), r("ResponseForSyncResponse")); } @@ -265,16 +379,17 @@ function r(name) { } const typeMap = { "ClientSettings": o([ - { json: "apiUrl", js: "apiUrl", typ: "" }, - { json: "deviceType", js: "deviceType", typ: r("DeviceType") }, - { json: "identityUrl", js: "identityUrl", typ: "" }, - { json: "userAgent", js: "userAgent", typ: "" }, + { json: "apiUrl", js: "apiUrl", typ: u(undefined, "") }, + { json: "deviceType", js: "deviceType", typ: u(undefined, r("DeviceType")) }, + { json: "identityUrl", js: "identityUrl", typ: u(undefined, "") }, + { json: "userAgent", js: "userAgent", typ: u(undefined, "") }, ], false), "Command": o([ { json: "passwordLogin", js: "passwordLogin", typ: u(undefined, r("PasswordLoginRequest")) }, { json: "apiKeyLogin", js: "apiKeyLogin", typ: u(undefined, r("APIKeyLoginRequest")) }, { json: "accessTokenLogin", js: "accessTokenLogin", typ: u(undefined, r("AccessTokenLoginRequest")) }, { json: "getUserApiKey", js: "getUserApiKey", typ: u(undefined, r("SecretVerificationRequest")) }, + { json: "fingerprint", js: "fingerprint", typ: u(undefined, r("FingerprintRequest")) }, { json: "sync", js: "sync", typ: u(undefined, r("SyncRequest")) }, { json: "secrets", js: "secrets", typ: u(undefined, r("SecretsCommand")) }, { json: "projects", js: "projects", typ: u(undefined, r("ProjectsCommand")) }, @@ -287,17 +402,50 @@ const typeMap = { { json: "clientSecret", js: "clientSecret", typ: "" }, { json: "password", js: "password", typ: "" }, ], false), + "FingerprintRequest": o([ + { json: "fingerprintMaterial", js: "fingerprintMaterial", typ: "" }, + { json: "publicKey", js: "publicKey", typ: "" }, + ], false), "SecretVerificationRequest": o([ { json: "masterPassword", js: "masterPassword", typ: u(undefined, u(null, "")) }, { json: "otp", js: "otp", typ: u(undefined, u(null, "")) }, ], false), "PasswordLoginRequest": o([ { json: "email", js: "email", typ: "" }, + { json: "kdf", js: "kdf", typ: r("PasswordLoginKdf") }, { json: "password", js: "password", typ: "" }, + { json: "twoFactor", js: "twoFactor", typ: u(undefined, u(r("TwoFactorRequest"), null)) }, + ], false), + "PasswordLoginKdf": o([ + { json: "pBKDF2", js: "pBKDF2", typ: u(undefined, r("PurplePBKDF2")) }, + { json: "argon2id", js: "argon2id", typ: u(undefined, r("PurpleArgon2ID")) }, + ], false), + "PurpleArgon2ID": o([ + { json: "iterations", js: "iterations", typ: 0 }, + { json: "memory", js: "memory", typ: 0 }, + { json: "parallelism", js: "parallelism", typ: 0 }, + ], false), + "PurplePBKDF2": o([ + { json: "iterations", js: "iterations", typ: 0 }, + ], false), + "TwoFactorRequest": o([ + { json: "provider", js: "provider", typ: r("TwoFactorProvider") }, + { json: "remember", js: "remember", typ: true }, + { json: "token", js: "token", typ: "" }, ], false), "ProjectsCommand": o([ { json: "get", js: "get", typ: u(undefined, r("ProjectGetRequest")) }, + { json: "create", js: "create", typ: u(undefined, r("ProjectCreateRequest")) }, { json: "list", js: "list", typ: u(undefined, r("ProjectsListRequest")) }, + { json: "update", js: "update", typ: u(undefined, r("ProjectPutRequest")) }, + { json: "delete", js: "delete", typ: u(undefined, r("ProjectsDeleteRequest")) }, + ], false), + "ProjectCreateRequest": o([ + { json: "name", js: "name", typ: "" }, + { json: "organizationId", js: "organizationId", typ: "" }, + ], false), + "ProjectsDeleteRequest": o([ + { json: "ids", js: "ids", typ: a("") }, ], false), "ProjectGetRequest": o([ { json: "id", js: "id", typ: "" }, @@ -305,8 +453,14 @@ const typeMap = { "ProjectsListRequest": o([ { json: "organizationId", js: "organizationId", typ: "" }, ], false), + "ProjectPutRequest": o([ + { json: "id", js: "id", typ: "" }, + { json: "name", js: "name", typ: "" }, + { json: "organizationId", js: "organizationId", typ: "" }, + ], false), "SecretsCommand": o([ { json: "get", js: "get", typ: u(undefined, r("SecretGetRequest")) }, + { json: "getByIds", js: "getByIds", typ: u(undefined, r("SecretsGetRequest")) }, { json: "create", js: "create", typ: u(undefined, r("SecretCreateRequest")) }, { json: "list", js: "list", typ: u(undefined, r("SecretIdentifiersRequest")) }, { json: "update", js: "update", typ: u(undefined, r("SecretPutRequest")) }, @@ -316,6 +470,7 @@ const typeMap = { { json: "key", js: "key", typ: "" }, { json: "note", js: "note", typ: "" }, { json: "organizationId", js: "organizationId", typ: "" }, + { json: "projectIds", js: "projectIds", typ: u(undefined, u(a(""), null)) }, { json: "value", js: "value", typ: "" }, ], false), "SecretsDeleteRequest": o([ @@ -324,6 +479,9 @@ const typeMap = { "SecretGetRequest": o([ { json: "id", js: "id", typ: "" }, ], false), + "SecretsGetRequest": o([ + { json: "ids", js: "ids", typ: a("") }, + ], false), "SecretIdentifiersRequest": o([ { json: "organizationId", js: "organizationId", typ: "" }, ], false), @@ -332,11 +490,345 @@ const typeMap = { { json: "key", js: "key", typ: "" }, { json: "note", js: "note", typ: "" }, { json: "organizationId", js: "organizationId", typ: "" }, + { json: "projectIds", js: "projectIds", typ: u(undefined, u(a(""), null)) }, { json: "value", js: "value", typ: "" }, ], false), "SyncRequest": o([ { json: "excludeSubdomains", js: "excludeSubdomains", typ: u(undefined, u(true, null)) }, ], false), + "DocRef": o([ + { json: "Cipher", js: "Cipher", typ: u(undefined, r("Cipher")) }, + { json: "CipherView", js: "CipherView", typ: u(undefined, r("CipherView")) }, + { json: "Collection", js: "Collection", typ: u(undefined, r("Collection")) }, + { json: "Folder", js: "Folder", typ: u(undefined, r("Folder")) }, + { json: "FolderView", js: "FolderView", typ: u(undefined, r("FolderView")) }, + { json: "Send", js: "Send", typ: u(undefined, r("Send")) }, + { json: "SendView", js: "SendView", typ: u(undefined, r("SendView")) }, + { json: "SendListView", js: "SendListView", typ: u(undefined, r("SendListView")) }, + { json: "InitCryptoRequest", js: "InitCryptoRequest", typ: u(undefined, r("InitCryptoRequest")) }, + { json: "PasswordGeneratorRequest", js: "PasswordGeneratorRequest", typ: u(undefined, r("PasswordGeneratorRequest")) }, + { json: "PassphraseGeneratorRequest", js: "PassphraseGeneratorRequest", typ: u(undefined, r("PassphraseGeneratorRequest")) }, + { json: "ExportFormat", js: "ExportFormat", typ: u(undefined, u(r("ExportFormatClass"), r("ExportFormatEnum"))) }, + { json: "MasterPasswordPolicyOptions", js: "MasterPasswordPolicyOptions", typ: u(undefined, r("MasterPasswordPolicyOptions")) }, + { json: "Kdf", js: "Kdf", typ: u(undefined, r("InitCryptoRequestKdf")) }, + ], false), + "Cipher": o([ + { json: "attachments", js: "attachments", typ: u(undefined, u(a(r("Attachment")), null)) }, + { json: "card", js: "card", typ: u(undefined, u(r("Card"), null)) }, + { json: "collectionIds", js: "collectionIds", typ: a("") }, + { json: "creationDate", js: "creationDate", typ: Date }, + { json: "deletedDate", js: "deletedDate", typ: u(undefined, u(Date, null)) }, + { json: "edit", js: "edit", typ: true }, + { json: "favorite", js: "favorite", typ: true }, + { json: "fields", js: "fields", typ: u(undefined, u(a(r("Field")), null)) }, + { json: "folderId", js: "folderId", typ: u(undefined, u(null, "")) }, + { json: "id", js: "id", typ: u(undefined, u(null, "")) }, + { json: "identity", js: "identity", typ: u(undefined, u(r("Identity"), null)) }, + { json: "localData", js: "localData", typ: u(undefined, u(r("LocalData"), null)) }, + { json: "login", js: "login", typ: u(undefined, u(r("Login"), null)) }, + { json: "name", js: "name", typ: "" }, + { json: "notes", js: "notes", typ: u(undefined, u(null, "")) }, + { json: "organizationId", js: "organizationId", typ: u(undefined, u(null, "")) }, + { json: "organizationUseTotp", js: "organizationUseTotp", typ: true }, + { json: "passwordHistory", js: "passwordHistory", typ: u(undefined, u(a(r("PasswordHistory")), null)) }, + { json: "reprompt", js: "reprompt", typ: r("CipherRepromptType") }, + { json: "revisionDate", js: "revisionDate", typ: Date }, + { json: "secureNote", js: "secureNote", typ: u(undefined, u(r("SecureNote"), null)) }, + { json: "type", js: "type", typ: r("CipherType") }, + { json: "viewPassword", js: "viewPassword", typ: true }, + ], false), + "Attachment": o([ + { json: "fileName", js: "fileName", typ: u(undefined, u(null, "")) }, + { json: "id", js: "id", typ: u(undefined, u(null, "")) }, + { json: "key", js: "key", typ: u(undefined, u(null, "")) }, + { json: "size", js: "size", typ: u(undefined, u(null, "")) }, + { json: "sizeName", js: "sizeName", typ: u(undefined, u(null, "")) }, + { json: "url", js: "url", typ: u(undefined, u(null, "")) }, + ], false), + "Card": o([ + { json: "brand", js: "brand", typ: u(undefined, u(null, "")) }, + { json: "cardholderName", js: "cardholderName", typ: u(undefined, u(null, "")) }, + { json: "code", js: "code", typ: u(undefined, u(null, "")) }, + { json: "expMonth", js: "expMonth", typ: u(undefined, u(null, "")) }, + { json: "expYear", js: "expYear", typ: u(undefined, u(null, "")) }, + { json: "number", js: "number", typ: u(undefined, u(null, "")) }, + ], false), + "Field": o([ + { json: "linkedId", js: "linkedId", typ: u(undefined, u(r("LinkedIDType"), null)) }, + { json: "name", js: "name", typ: u(undefined, u(null, "")) }, + { json: "type", js: "type", typ: r("FieldType") }, + { json: "value", js: "value", typ: u(undefined, u(null, "")) }, + ], false), + "Identity": o([ + { json: "address1", js: "address1", typ: u(undefined, u(null, "")) }, + { json: "address2", js: "address2", typ: u(undefined, u(null, "")) }, + { json: "address3", js: "address3", typ: u(undefined, u(null, "")) }, + { json: "city", js: "city", typ: u(undefined, u(null, "")) }, + { json: "company", js: "company", typ: u(undefined, u(null, "")) }, + { json: "country", js: "country", typ: u(undefined, u(null, "")) }, + { json: "email", js: "email", typ: u(undefined, u(null, "")) }, + { json: "firstName", js: "firstName", typ: u(undefined, u(null, "")) }, + { json: "lastName", js: "lastName", typ: u(undefined, u(null, "")) }, + { json: "licenseNumber", js: "licenseNumber", typ: u(undefined, u(null, "")) }, + { json: "middleName", js: "middleName", typ: u(undefined, u(null, "")) }, + { json: "passportNumber", js: "passportNumber", typ: u(undefined, u(null, "")) }, + { json: "phone", js: "phone", typ: u(undefined, u(null, "")) }, + { json: "postalCode", js: "postalCode", typ: u(undefined, u(null, "")) }, + { json: "ssn", js: "ssn", typ: u(undefined, u(null, "")) }, + { json: "state", js: "state", typ: u(undefined, u(null, "")) }, + { json: "title", js: "title", typ: u(undefined, u(null, "")) }, + { json: "username", js: "username", typ: u(undefined, u(null, "")) }, + ], false), + "LocalData": o([ + { json: "lastLaunched", js: "lastLaunched", typ: u(undefined, u(0, null)) }, + { json: "lastUsedDate", js: "lastUsedDate", typ: u(undefined, u(0, null)) }, + ], false), + "Login": o([ + { json: "autofillOnPageLoad", js: "autofillOnPageLoad", typ: u(undefined, u(true, null)) }, + { json: "password", js: "password", typ: u(undefined, u(null, "")) }, + { json: "passwordRevisionDate", js: "passwordRevisionDate", typ: u(undefined, u(Date, null)) }, + { json: "totp", js: "totp", typ: u(undefined, u(null, "")) }, + { json: "uris", js: "uris", typ: u(undefined, u(a(r("LoginURI")), null)) }, + { json: "username", js: "username", typ: u(undefined, u(null, "")) }, + ], false), + "LoginURI": o([ + { json: "match", js: "match", typ: u(undefined, u(r("URIMatchType"), null)) }, + { json: "uri", js: "uri", typ: u(undefined, u(null, "")) }, + ], false), + "PasswordHistory": o([ + { json: "lastUsedDate", js: "lastUsedDate", typ: Date }, + { json: "password", js: "password", typ: "" }, + ], false), + "SecureNote": o([ + { json: "type", js: "type", typ: r("SecureNoteType") }, + ], false), + "CipherView": o([ + { json: "attachments", js: "attachments", typ: u(undefined, u(a(r("AttachmentView")), null)) }, + { json: "card", js: "card", typ: u(undefined, u(r("CardView"), null)) }, + { json: "collectionIds", js: "collectionIds", typ: a("") }, + { json: "creationDate", js: "creationDate", typ: Date }, + { json: "deletedDate", js: "deletedDate", typ: u(undefined, u(Date, null)) }, + { json: "edit", js: "edit", typ: true }, + { json: "favorite", js: "favorite", typ: true }, + { json: "fields", js: "fields", typ: u(undefined, u(a(r("FieldView")), null)) }, + { json: "folderId", js: "folderId", typ: u(undefined, u(null, "")) }, + { json: "id", js: "id", typ: u(undefined, u(null, "")) }, + { json: "identity", js: "identity", typ: u(undefined, u(r("IdentityView"), null)) }, + { json: "localData", js: "localData", typ: u(undefined, u(r("LocalDataView"), null)) }, + { json: "login", js: "login", typ: u(undefined, u(r("LoginView"), null)) }, + { json: "name", js: "name", typ: "" }, + { json: "notes", js: "notes", typ: u(undefined, u(null, "")) }, + { json: "organizationId", js: "organizationId", typ: u(undefined, u(null, "")) }, + { json: "organizationUseTotp", js: "organizationUseTotp", typ: true }, + { json: "passwordHistory", js: "passwordHistory", typ: u(undefined, u(a(r("PasswordHistoryView")), null)) }, + { json: "reprompt", js: "reprompt", typ: r("CipherRepromptType") }, + { json: "revisionDate", js: "revisionDate", typ: Date }, + { json: "secureNote", js: "secureNote", typ: u(undefined, u(r("SecureNoteView"), null)) }, + { json: "type", js: "type", typ: r("CipherType") }, + { json: "viewPassword", js: "viewPassword", typ: true }, + ], false), + "AttachmentView": o([ + { json: "fileName", js: "fileName", typ: u(undefined, u(null, "")) }, + { json: "id", js: "id", typ: u(undefined, u(null, "")) }, + { json: "key", js: "key", typ: u(undefined, u(null, "")) }, + { json: "size", js: "size", typ: u(undefined, u(null, "")) }, + { json: "sizeName", js: "sizeName", typ: u(undefined, u(null, "")) }, + { json: "url", js: "url", typ: u(undefined, u(null, "")) }, + ], false), + "CardView": o([ + { json: "brand", js: "brand", typ: u(undefined, u(null, "")) }, + { json: "cardholderName", js: "cardholderName", typ: u(undefined, u(null, "")) }, + { json: "code", js: "code", typ: u(undefined, u(null, "")) }, + { json: "expMonth", js: "expMonth", typ: u(undefined, u(null, "")) }, + { json: "expYear", js: "expYear", typ: u(undefined, u(null, "")) }, + { json: "number", js: "number", typ: u(undefined, u(null, "")) }, + ], false), + "FieldView": o([ + { json: "linkedId", js: "linkedId", typ: u(undefined, u(r("LinkedIDType"), null)) }, + { json: "name", js: "name", typ: u(undefined, u(null, "")) }, + { json: "type", js: "type", typ: r("FieldType") }, + { json: "value", js: "value", typ: u(undefined, u(null, "")) }, + ], false), + "IdentityView": o([ + { json: "address1", js: "address1", typ: u(undefined, u(null, "")) }, + { json: "address2", js: "address2", typ: u(undefined, u(null, "")) }, + { json: "address3", js: "address3", typ: u(undefined, u(null, "")) }, + { json: "city", js: "city", typ: u(undefined, u(null, "")) }, + { json: "company", js: "company", typ: u(undefined, u(null, "")) }, + { json: "country", js: "country", typ: u(undefined, u(null, "")) }, + { json: "email", js: "email", typ: u(undefined, u(null, "")) }, + { json: "firstName", js: "firstName", typ: u(undefined, u(null, "")) }, + { json: "lastName", js: "lastName", typ: u(undefined, u(null, "")) }, + { json: "licenseNumber", js: "licenseNumber", typ: u(undefined, u(null, "")) }, + { json: "middleName", js: "middleName", typ: u(undefined, u(null, "")) }, + { json: "passportNumber", js: "passportNumber", typ: u(undefined, u(null, "")) }, + { json: "phone", js: "phone", typ: u(undefined, u(null, "")) }, + { json: "postalCode", js: "postalCode", typ: u(undefined, u(null, "")) }, + { json: "ssn", js: "ssn", typ: u(undefined, u(null, "")) }, + { json: "state", js: "state", typ: u(undefined, u(null, "")) }, + { json: "title", js: "title", typ: u(undefined, u(null, "")) }, + { json: "username", js: "username", typ: u(undefined, u(null, "")) }, + ], false), + "LocalDataView": o([ + { json: "lastLaunched", js: "lastLaunched", typ: u(undefined, u(0, null)) }, + { json: "lastUsedDate", js: "lastUsedDate", typ: u(undefined, u(0, null)) }, + ], false), + "LoginView": o([ + { json: "autofillOnPageLoad", js: "autofillOnPageLoad", typ: u(undefined, u(true, null)) }, + { json: "password", js: "password", typ: u(undefined, u(null, "")) }, + { json: "passwordRevisionDate", js: "passwordRevisionDate", typ: u(undefined, u(Date, null)) }, + { json: "totp", js: "totp", typ: u(undefined, u(null, "")) }, + { json: "uris", js: "uris", typ: u(undefined, u(a(r("LoginURIView")), null)) }, + { json: "username", js: "username", typ: u(undefined, u(null, "")) }, + ], false), + "LoginURIView": o([ + { json: "match", js: "match", typ: u(undefined, u(r("URIMatchType"), null)) }, + { json: "uri", js: "uri", typ: u(undefined, u(null, "")) }, + ], false), + "PasswordHistoryView": o([ + { json: "lastUsedDate", js: "lastUsedDate", typ: Date }, + { json: "password", js: "password", typ: "" }, + ], false), + "SecureNoteView": o([ + { json: "type", js: "type", typ: r("SecureNoteType") }, + ], false), + "Collection": o([ + { json: "externalId", js: "externalId", typ: u(undefined, u(null, "")) }, + { json: "hidePasswords", js: "hidePasswords", typ: true }, + { json: "id", js: "id", typ: "" }, + { json: "name", js: "name", typ: "" }, + { json: "organizationId", js: "organizationId", typ: "" }, + { json: "readOnly", js: "readOnly", typ: true }, + ], false), + "ExportFormatClass": o([ + { json: "EncryptedJson", js: "EncryptedJson", typ: r("EncryptedJSON") }, + ], false), + "EncryptedJSON": o([ + { json: "password", js: "password", typ: "" }, + ], "any"), + "Folder": o([ + { json: "id", js: "id", typ: "" }, + { json: "name", js: "name", typ: "" }, + { json: "revisionDate", js: "revisionDate", typ: Date }, + ], "any"), + "FolderView": o([ + { json: "id", js: "id", typ: "" }, + { json: "name", js: "name", typ: "" }, + { json: "revisionDate", js: "revisionDate", typ: Date }, + ], "any"), + "InitCryptoRequest": o([ + { json: "email", js: "email", typ: "" }, + { json: "kdfParams", js: "kdfParams", typ: r("InitCryptoRequestKdf") }, + { json: "organizationKeys", js: "organizationKeys", typ: m("") }, + { json: "password", js: "password", typ: "" }, + { json: "privateKey", js: "privateKey", typ: "" }, + { json: "userKey", js: "userKey", typ: "" }, + ], false), + "InitCryptoRequestKdf": o([ + { json: "pBKDF2", js: "pBKDF2", typ: u(undefined, r("FluffyPBKDF2")) }, + { json: "argon2id", js: "argon2id", typ: u(undefined, r("FluffyArgon2ID")) }, + ], false), + "FluffyArgon2ID": o([ + { json: "iterations", js: "iterations", typ: 0 }, + { json: "memory", js: "memory", typ: 0 }, + { json: "parallelism", js: "parallelism", typ: 0 }, + ], false), + "FluffyPBKDF2": o([ + { json: "iterations", js: "iterations", typ: 0 }, + ], false), + "MasterPasswordPolicyOptions": o([ + { json: "enforce_on_login", js: "enforce_on_login", typ: true }, + { json: "min_complexity", js: "min_complexity", typ: 0 }, + { json: "min_length", js: "min_length", typ: 0 }, + { json: "require_lower", js: "require_lower", typ: true }, + { json: "require_numbers", js: "require_numbers", typ: true }, + { json: "require_special", js: "require_special", typ: true }, + { json: "require_upper", js: "require_upper", typ: true }, + ], "any"), + "PassphraseGeneratorRequest": o([ + { json: "capitalize", js: "capitalize", typ: u(undefined, u(true, null)) }, + { json: "includeNumber", js: "includeNumber", typ: u(undefined, u(true, null)) }, + { json: "numWords", js: "numWords", typ: u(undefined, u(0, null)) }, + { json: "wordSeparator", js: "wordSeparator", typ: u(undefined, u(null, "")) }, + ], false), + "PasswordGeneratorRequest": o([ + { json: "avoidAmbiguous", js: "avoidAmbiguous", typ: u(undefined, u(true, null)) }, + { json: "length", js: "length", typ: u(undefined, u(0, null)) }, + { json: "lowercase", js: "lowercase", typ: true }, + { json: "minLowercase", js: "minLowercase", typ: u(undefined, u(true, null)) }, + { json: "minNumber", js: "minNumber", typ: u(undefined, u(true, null)) }, + { json: "minSpecial", js: "minSpecial", typ: u(undefined, u(true, null)) }, + { json: "minUppercase", js: "minUppercase", typ: u(undefined, u(true, null)) }, + { json: "numbers", js: "numbers", typ: true }, + { json: "special", js: "special", typ: true }, + { json: "uppercase", js: "uppercase", typ: true }, + ], false), + "Send": o([ + { json: "accessCount", js: "accessCount", typ: 0 }, + { json: "accessId", js: "accessId", typ: "" }, + { json: "deletionDate", js: "deletionDate", typ: Date }, + { json: "disabled", js: "disabled", typ: true }, + { json: "expirationDate", js: "expirationDate", typ: u(undefined, u(Date, null)) }, + { json: "file", js: "file", typ: u(undefined, u(r("SendFile"), null)) }, + { json: "hideEmail", js: "hideEmail", typ: true }, + { json: "id", js: "id", typ: "" }, + { json: "key", js: "key", typ: "" }, + { json: "maxAccessCount", js: "maxAccessCount", typ: u(undefined, u(0, null)) }, + { json: "name", js: "name", typ: "" }, + { json: "notes", js: "notes", typ: u(undefined, u(null, "")) }, + { json: "password", js: "password", typ: u(undefined, u(null, "")) }, + { json: "revisionDate", js: "revisionDate", typ: Date }, + { json: "text", js: "text", typ: u(undefined, u(r("SendText"), null)) }, + { json: "type", js: "type", typ: r("SendType") }, + ], false), + "SendFile": o([ + { json: "fileName", js: "fileName", typ: "" }, + { json: "id", js: "id", typ: "" }, + { json: "size", js: "size", typ: "" }, + { json: "sizeName", js: "sizeName", typ: "" }, + ], false), + "SendText": o([ + { json: "hidden", js: "hidden", typ: true }, + { json: "text", js: "text", typ: u(undefined, u(null, "")) }, + ], false), + "SendListView": o([ + { json: "accessId", js: "accessId", typ: "" }, + { json: "deletionDate", js: "deletionDate", typ: Date }, + { json: "disabled", js: "disabled", typ: true }, + { json: "expirationDate", js: "expirationDate", typ: u(undefined, u(Date, null)) }, + { json: "id", js: "id", typ: "" }, + { json: "name", js: "name", typ: "" }, + { json: "revisionDate", js: "revisionDate", typ: Date }, + { json: "type", js: "type", typ: r("SendType") }, + ], false), + "SendView": o([ + { json: "accessCount", js: "accessCount", typ: 0 }, + { json: "accessId", js: "accessId", typ: "" }, + { json: "deletionDate", js: "deletionDate", typ: Date }, + { json: "disabled", js: "disabled", typ: true }, + { json: "expirationDate", js: "expirationDate", typ: u(undefined, u(Date, null)) }, + { json: "file", js: "file", typ: u(undefined, u(r("SendFileView"), null)) }, + { json: "hideEmail", js: "hideEmail", typ: true }, + { json: "id", js: "id", typ: "" }, + { json: "key", js: "key", typ: "" }, + { json: "maxAccessCount", js: "maxAccessCount", typ: u(undefined, u(0, null)) }, + { json: "name", js: "name", typ: "" }, + { json: "notes", js: "notes", typ: u(undefined, u(null, "")) }, + { json: "password", js: "password", typ: u(undefined, u(null, "")) }, + { json: "revisionDate", js: "revisionDate", typ: Date }, + { json: "text", js: "text", typ: u(undefined, u(r("SendTextView"), null)) }, + { json: "type", js: "type", typ: r("SendType") }, + ], false), + "SendFileView": o([ + { json: "fileName", js: "fileName", typ: "" }, + { json: "id", js: "id", typ: "" }, + { json: "size", js: "size", typ: "" }, + { json: "sizeName", js: "sizeName", typ: "" }, + ], false), + "SendTextView": o([ + { json: "hidden", js: "hidden", typ: true }, + { json: "text", js: "text", typ: u(undefined, u(null, "")) }, + ], false), "ResponseForAPIKeyLoginResponse": o([ { json: "data", js: "data", typ: u(undefined, u(r("APIKeyLoginResponse"), null)) }, { json: "errorMessage", js: "errorMessage", typ: u(undefined, u(null, "")) }, @@ -370,6 +862,14 @@ const typeMap = { "PurpleYubiKey": o([ { json: "nfc", js: "nfc", typ: true }, ], false), + "ResponseForFingerprintResponse": o([ + { json: "data", js: "data", typ: u(undefined, u(r("FingerprintResponse"), null)) }, + { json: "errorMessage", js: "errorMessage", typ: u(undefined, u(null, "")) }, + { json: "success", js: "success", typ: true }, + ], false), + "FingerprintResponse": o([ + { json: "fingerprint", js: "fingerprint", typ: "" }, + ], false), "ResponseForPasswordLoginResponse": o([ { json: "data", js: "data", typ: u(undefined, u(r("PasswordLoginResponse"), null)) }, { json: "errorMessage", js: "errorMessage", typ: u(undefined, u(null, "")) }, @@ -407,24 +907,44 @@ const typeMap = { "FluffyYubiKey": o([ { json: "nfc", js: "nfc", typ: true }, ], false), - "ResponseForSecretDeleteResponse": o([ - { json: "data", js: "data", typ: u(undefined, u(r("SecretDeleteResponse"), null)) }, + "ResponseForProjectResponse": o([ + { json: "data", js: "data", typ: u(undefined, u(r("ProjectResponse"), null)) }, { json: "errorMessage", js: "errorMessage", typ: u(undefined, u(null, "")) }, { json: "success", js: "success", typ: true }, ], false), - "SecretDeleteResponse": o([ + "ProjectResponse": o([ + { json: "creationDate", js: "creationDate", typ: Date }, + { json: "id", js: "id", typ: "" }, + { json: "name", js: "name", typ: "" }, + { json: "organizationId", js: "organizationId", typ: "" }, + { json: "revisionDate", js: "revisionDate", typ: Date }, + ], false), + "ResponseForProjectsDeleteResponse": o([ + { json: "data", js: "data", typ: u(undefined, u(r("ProjectsDeleteResponse"), null)) }, + { json: "errorMessage", js: "errorMessage", typ: u(undefined, u(null, "")) }, + { json: "success", js: "success", typ: true }, + ], false), + "ProjectsDeleteResponse": o([ + { json: "data", js: "data", typ: a(r("ProjectDeleteResponse")) }, + ], false), + "ProjectDeleteResponse": o([ { json: "error", js: "error", typ: u(undefined, u(null, "")) }, { json: "id", js: "id", typ: "" }, ], false), - "ResponseForSecretIdentifierResponse": o([ - { json: "data", js: "data", typ: u(undefined, u(r("SecretIdentifierResponse"), null)) }, + "ResponseForProjectsResponse": o([ + { json: "data", js: "data", typ: u(undefined, u(r("ProjectsResponse"), null)) }, { json: "errorMessage", js: "errorMessage", typ: u(undefined, u(null, "")) }, { json: "success", js: "success", typ: true }, ], false), - "SecretIdentifierResponse": o([ + "ProjectsResponse": o([ + { json: "data", js: "data", typ: a(r("DatumElement")) }, + ], false), + "DatumElement": o([ + { json: "creationDate", js: "creationDate", typ: Date }, { json: "id", js: "id", typ: "" }, - { json: "key", js: "key", typ: "" }, + { json: "name", js: "name", typ: "" }, { json: "organizationId", js: "organizationId", typ: "" }, + { json: "revisionDate", js: "revisionDate", typ: Date }, ], false), "ResponseForSecretIdentifiersResponse": o([ { json: "data", js: "data", typ: u(undefined, u(r("SecretIdentifiersResponse"), null)) }, @@ -432,9 +952,9 @@ const typeMap = { { json: "success", js: "success", typ: true }, ], false), "SecretIdentifiersResponse": o([ - { json: "data", js: "data", typ: a(r("DatumElement")) }, + { json: "data", js: "data", typ: a(r("SecretIdentifierResponse")) }, ], false), - "DatumElement": o([ + "SecretIdentifierResponse": o([ { json: "id", js: "id", typ: "" }, { json: "key", js: "key", typ: "" }, { json: "organizationId", js: "organizationId", typ: "" }, @@ -445,14 +965,13 @@ const typeMap = { { json: "success", js: "success", typ: true }, ], false), "SecretResponse": o([ - { json: "creationDate", js: "creationDate", typ: "" }, + { json: "creationDate", js: "creationDate", typ: Date }, { json: "id", js: "id", typ: "" }, { json: "key", js: "key", typ: "" }, { json: "note", js: "note", typ: "" }, - { json: "object", js: "object", typ: "" }, { json: "organizationId", js: "organizationId", typ: "" }, { json: "projectId", js: "projectId", typ: u(undefined, u(null, "")) }, - { json: "revisionDate", js: "revisionDate", typ: "" }, + { json: "revisionDate", js: "revisionDate", typ: Date }, { json: "value", js: "value", typ: "" }, ], false), "ResponseForSecretsDeleteResponse": o([ @@ -461,11 +980,29 @@ const typeMap = { { json: "success", js: "success", typ: true }, ], false), "SecretsDeleteResponse": o([ + { json: "data", js: "data", typ: a(r("SecretDeleteResponse")) }, + ], false), + "SecretDeleteResponse": o([ + { json: "error", js: "error", typ: u(undefined, u(null, "")) }, + { json: "id", js: "id", typ: "" }, + ], false), + "ResponseForSecretsResponse": o([ + { json: "data", js: "data", typ: u(undefined, u(r("SecretsResponse"), null)) }, + { json: "errorMessage", js: "errorMessage", typ: u(undefined, u(null, "")) }, + { json: "success", js: "success", typ: true }, + ], false), + "SecretsResponse": o([ { json: "data", js: "data", typ: a(r("DatumClass")) }, ], false), "DatumClass": o([ - { json: "error", js: "error", typ: u(undefined, u(null, "")) }, + { json: "creationDate", js: "creationDate", typ: Date }, { json: "id", js: "id", typ: "" }, + { json: "key", js: "key", typ: "" }, + { json: "note", js: "note", typ: "" }, + { json: "organizationId", js: "organizationId", typ: "" }, + { json: "projectId", js: "projectId", typ: u(undefined, u(null, "")) }, + { json: "revisionDate", js: "revisionDate", typ: Date }, + { json: "value", js: "value", typ: "" }, ], false), "ResponseForSyncResponse": o([ { json: "data", js: "data", typ: u(undefined, u(r("SyncResponse"), null)) }, @@ -518,4 +1055,78 @@ const typeMap = { "VivaldiExtension", "WindowsDesktop", ], + "TwoFactorProvider": [ + "Authenticator", + "Duo", + "Email", + "OrganizationDuo", + "Remember", + "U2f", + "WebAuthn", + "Yubikey", + ], + "LinkedIDType": [ + "Address1", + "Address2", + "Address3", + "Brand", + "CardholderName", + "City", + "Code", + "Company", + "Country", + "Email", + "ExpMonth", + "ExpYear", + "FirstName", + "FullName", + "LastName", + "LicenseNumber", + "MiddleName", + "Number", + "PassportNumber", + "Password", + "Phone", + "PostalCode", + "Ssn", + "State", + "Title", + "Username", + ], + "FieldType": [ + "Boolean", + "Hidden", + "Linked", + "Text", + ], + "URIMatchType": [ + "domain", + "exact", + "host", + "never", + "regularExpression", + "startsWith", + ], + "CipherRepromptType": [ + "None", + "Password", + ], + "SecureNoteType": [ + "Generic", + ], + "CipherType": [ + "Card", + "Identity", + "Login", + "SecureNote", + ], + "ExportFormatEnum": [ + "AccountEncryptedJson", + "Csv", + "Json", + ], + "SendType": [ + "File", + "Text", + ], }; diff --git a/dist/node_modules/@bitwarden/sdk-napi/package.json b/dist/node_modules/@bitwarden/sdk-napi/package.json index ef1ed9c..65d0a82 100644 --- a/dist/node_modules/@bitwarden/sdk-napi/package.json +++ b/dist/node_modules/@bitwarden/sdk-napi/package.json @@ -1,6 +1,6 @@ { "name": "@bitwarden/sdk-napi", - "version": "0.2.1", + "version": "0.3.1", "homepage": "https://github.com/bitwarden/sdk#readme", "bugs": { "url": "https://github.com/bitwarden/sdk/issues" @@ -31,7 +31,7 @@ "devDependencies": { "@napi-rs/cli": "^2.13.2", "ts-node": "10.9.1", - "typescript": "^4.9.4" + "typescript": "^5.0.0" }, "engines": { "node": ">= 10" @@ -49,9 +49,9 @@ } }, "optionalDependencies": { - "@bitwarden/sdk-napi-win32-x64-msvc": "0.2.1", - "@bitwarden/sdk-napi-darwin-x64": "0.2.1", - "@bitwarden/sdk-napi-linux-x64-gnu": "0.2.1", - "@bitwarden/sdk-napi-darwin-arm64": "0.2.1" + "@bitwarden/sdk-napi-win32-x64-msvc": "0.3.1", + "@bitwarden/sdk-napi-darwin-x64": "0.3.1", + "@bitwarden/sdk-napi-linux-x64-gnu": "0.3.1", + "@bitwarden/sdk-napi-darwin-arm64": "0.3.1" } } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 114ebae..74b199c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "GPL-3.0", "dependencies": { "@actions/core": "^1.10.0", - "@bitwarden/sdk-napi": "0.2.1" + "@bitwarden/sdk-napi": "0.3.1" }, "devDependencies": { "@types/node": "^18.15.3", @@ -661,23 +661,23 @@ "dev": true }, "node_modules/@bitwarden/sdk-napi": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@bitwarden/sdk-napi/-/sdk-napi-0.2.1.tgz", - "integrity": "sha512-iPIN3MkOTPgN7FykNVJ0w4QelO6IT4xyFb4Vt7j/VMBzA+pbxL9IgcysNNh5glNW9HlvG2IbnHvQeC2iVz21hw==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@bitwarden/sdk-napi/-/sdk-napi-0.3.1.tgz", + "integrity": "sha512-G5oM/st2+1eQOposoxdgLqK52j52fkcjv6W3OiojBx/yHy854FnY5KfKZRf73DRV/U1AYnHWckHE4IQ53/u3CQ==", "engines": { "node": ">= 10" }, "optionalDependencies": { - "@bitwarden/sdk-napi-darwin-arm64": "0.2.1", - "@bitwarden/sdk-napi-darwin-x64": "0.2.1", - "@bitwarden/sdk-napi-linux-x64-gnu": "0.2.1", - "@bitwarden/sdk-napi-win32-x64-msvc": "0.2.1" + "@bitwarden/sdk-napi-darwin-arm64": "0.3.1", + "@bitwarden/sdk-napi-darwin-x64": "0.3.1", + "@bitwarden/sdk-napi-linux-x64-gnu": "0.3.1", + "@bitwarden/sdk-napi-win32-x64-msvc": "0.3.1" } }, "node_modules/@bitwarden/sdk-napi-darwin-arm64": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@bitwarden/sdk-napi-darwin-arm64/-/sdk-napi-darwin-arm64-0.2.1.tgz", - "integrity": "sha512-JJY8CB2Kl2riUfhMajX0Yx7AwvIfm5/mA36wYk+GS2mDhxgXunVIn+S9dxXI8GUQBk845I49c5xDOjHMSyPceA==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@bitwarden/sdk-napi-darwin-arm64/-/sdk-napi-darwin-arm64-0.3.1.tgz", + "integrity": "sha512-kfQ6uEJOEO9x8sPHk+qysJGYvBfc9XIHLSTNMp8axkRpuVOkc+uq7IC2fvViUDNJXGRjdepvuC5blp75oT6BMA==", "cpu": [ "arm64" ], @@ -690,9 +690,9 @@ } }, "node_modules/@bitwarden/sdk-napi-darwin-x64": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@bitwarden/sdk-napi-darwin-x64/-/sdk-napi-darwin-x64-0.2.1.tgz", - "integrity": "sha512-At3Hu5/LcMCF6CnNWg3TXo2waJ4jRlekyR5TaZx/oJ+cqXz5o51C1mTOefE0xVdAfuS1tqMboJku8unU4ZJnJg==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@bitwarden/sdk-napi-darwin-x64/-/sdk-napi-darwin-x64-0.3.1.tgz", + "integrity": "sha512-mV4DLakyQ4hhM3HI0jeZ55y62UnrDccj6qX7Z5ygItx/Q9w0mEn0TQLZiwcm/uqtOYWBsDr3Bg9QyyiOfCCT1g==", "cpu": [ "x64" ], @@ -705,9 +705,9 @@ } }, "node_modules/@bitwarden/sdk-napi-linux-x64-gnu": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@bitwarden/sdk-napi-linux-x64-gnu/-/sdk-napi-linux-x64-gnu-0.2.1.tgz", - "integrity": "sha512-N89d/65EkYE67/su5xv7+/A5pMaqAdygxIphQJqcduFhv+8SMl5nR7ZCYvom259NAFEdhRLPc/UOSbkBnlsI/Q==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@bitwarden/sdk-napi-linux-x64-gnu/-/sdk-napi-linux-x64-gnu-0.3.1.tgz", + "integrity": "sha512-NkS09B0P55zWy6YAyFKJ1MytJWyUgAUFCNgFCf6wx7L2W9uplKfunWaY4NhElAhn4pXX1aElNN1+T2OECUTykg==", "cpu": [ "x64" ], @@ -720,9 +720,9 @@ } }, "node_modules/@bitwarden/sdk-napi-win32-x64-msvc": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@bitwarden/sdk-napi-win32-x64-msvc/-/sdk-napi-win32-x64-msvc-0.2.1.tgz", - "integrity": "sha512-lg24+7kxdtu2k+QsMwcqC1oUinwSMGm7224TSr65QERdaX2qlDBSvLoaxhmT94ZRDLJobhnXFNp0mTE4E0Ar0g==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@bitwarden/sdk-napi-win32-x64-msvc/-/sdk-napi-win32-x64-msvc-0.3.1.tgz", + "integrity": "sha512-C70Y4skSbPcKxAVb3zUS++TmtHU8Wz5FCx+kdJvq1VWPAokuOG5OjlqiK06tY+zaiCIgNBAvjxfHCq1774N30w==", "cpu": [ "x64" ], @@ -6150,38 +6150,38 @@ "dev": true }, "@bitwarden/sdk-napi": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@bitwarden/sdk-napi/-/sdk-napi-0.2.1.tgz", - "integrity": "sha512-iPIN3MkOTPgN7FykNVJ0w4QelO6IT4xyFb4Vt7j/VMBzA+pbxL9IgcysNNh5glNW9HlvG2IbnHvQeC2iVz21hw==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@bitwarden/sdk-napi/-/sdk-napi-0.3.1.tgz", + "integrity": "sha512-G5oM/st2+1eQOposoxdgLqK52j52fkcjv6W3OiojBx/yHy854FnY5KfKZRf73DRV/U1AYnHWckHE4IQ53/u3CQ==", "requires": { - "@bitwarden/sdk-napi-darwin-arm64": "0.2.1", - "@bitwarden/sdk-napi-darwin-x64": "0.2.1", - "@bitwarden/sdk-napi-linux-x64-gnu": "0.2.1", - "@bitwarden/sdk-napi-win32-x64-msvc": "0.2.1" + "@bitwarden/sdk-napi-darwin-arm64": "0.3.1", + "@bitwarden/sdk-napi-darwin-x64": "0.3.1", + "@bitwarden/sdk-napi-linux-x64-gnu": "0.3.1", + "@bitwarden/sdk-napi-win32-x64-msvc": "0.3.1" } }, "@bitwarden/sdk-napi-darwin-arm64": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@bitwarden/sdk-napi-darwin-arm64/-/sdk-napi-darwin-arm64-0.2.1.tgz", - "integrity": "sha512-JJY8CB2Kl2riUfhMajX0Yx7AwvIfm5/mA36wYk+GS2mDhxgXunVIn+S9dxXI8GUQBk845I49c5xDOjHMSyPceA==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@bitwarden/sdk-napi-darwin-arm64/-/sdk-napi-darwin-arm64-0.3.1.tgz", + "integrity": "sha512-kfQ6uEJOEO9x8sPHk+qysJGYvBfc9XIHLSTNMp8axkRpuVOkc+uq7IC2fvViUDNJXGRjdepvuC5blp75oT6BMA==", "optional": true }, "@bitwarden/sdk-napi-darwin-x64": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@bitwarden/sdk-napi-darwin-x64/-/sdk-napi-darwin-x64-0.2.1.tgz", - "integrity": "sha512-At3Hu5/LcMCF6CnNWg3TXo2waJ4jRlekyR5TaZx/oJ+cqXz5o51C1mTOefE0xVdAfuS1tqMboJku8unU4ZJnJg==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@bitwarden/sdk-napi-darwin-x64/-/sdk-napi-darwin-x64-0.3.1.tgz", + "integrity": "sha512-mV4DLakyQ4hhM3HI0jeZ55y62UnrDccj6qX7Z5ygItx/Q9w0mEn0TQLZiwcm/uqtOYWBsDr3Bg9QyyiOfCCT1g==", "optional": true }, "@bitwarden/sdk-napi-linux-x64-gnu": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@bitwarden/sdk-napi-linux-x64-gnu/-/sdk-napi-linux-x64-gnu-0.2.1.tgz", - "integrity": "sha512-N89d/65EkYE67/su5xv7+/A5pMaqAdygxIphQJqcduFhv+8SMl5nR7ZCYvom259NAFEdhRLPc/UOSbkBnlsI/Q==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@bitwarden/sdk-napi-linux-x64-gnu/-/sdk-napi-linux-x64-gnu-0.3.1.tgz", + "integrity": "sha512-NkS09B0P55zWy6YAyFKJ1MytJWyUgAUFCNgFCf6wx7L2W9uplKfunWaY4NhElAhn4pXX1aElNN1+T2OECUTykg==", "optional": true }, "@bitwarden/sdk-napi-win32-x64-msvc": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@bitwarden/sdk-napi-win32-x64-msvc/-/sdk-napi-win32-x64-msvc-0.2.1.tgz", - "integrity": "sha512-lg24+7kxdtu2k+QsMwcqC1oUinwSMGm7224TSr65QERdaX2qlDBSvLoaxhmT94ZRDLJobhnXFNp0mTE4E0Ar0g==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@bitwarden/sdk-napi-win32-x64-msvc/-/sdk-napi-win32-x64-msvc-0.3.1.tgz", + "integrity": "sha512-C70Y4skSbPcKxAVb3zUS++TmtHU8Wz5FCx+kdJvq1VWPAokuOG5OjlqiK06tY+zaiCIgNBAvjxfHCq1774N30w==", "optional": true }, "@eslint-community/eslint-utils": { diff --git a/package.json b/package.json index 65a18ad..fb8b599 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ }, "dependencies": { "@actions/core": "^1.10.0", - "@bitwarden/sdk-napi": "0.2.1" + "@bitwarden/sdk-napi": "0.3.1" }, "devDependencies": { "@types/node": "^18.15.3", diff --git a/src/main.ts b/src/main.ts index a0f119d..8602db4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,6 @@ import * as core from "@actions/core"; import { BitwardenClient, ClientSettings, DeviceType, LogLevel } from "@bitwarden/sdk-napi"; -import { parseSecretInput } from "./parser"; +import { SecretInput, parseSecretInput } from "./parser"; import { isValidUrl } from "./validators"; async function run(): Promise { @@ -41,25 +41,31 @@ async function run(): Promise { const client = new BitwardenClient(settings, LogLevel.Info); const result = await client.loginWithAccessToken(accessToken); if (!result.success) { - throw Error("Authentication to Bitwarden failed"); + throw Error("Authentication with Bitwarden failed"); } core.info("Setting Secrets"); - for (const secretInput of secretInputs) { - const secretResponse = await client.secrets().get(secretInput.id); - - if (secretResponse.data) { - core.setSecret(secretResponse.data.value); - core.exportVariable(secretInput.outputEnvName, secretResponse.data.value); - core.setOutput(secretInput.outputEnvName, secretResponse.data.value); - } else { - let errorMessage = `The secret ${secretInput.id} could not be found `; - if (secretResponse.errorMessage) { - errorMessage = errorMessage + "error message was: " + secretResponse.errorMessage; + const secretIds = secretInputs.map((secretInput: SecretInput) => secretInput.id); + const secretResponse = await client.secrets().getByIds(secretIds); + if (secretResponse.data) { + const secrets = secretResponse.data.data; + secrets.forEach((secret) => { + const secretInput = secretInputs.find((secretInput) => secretInput.id === secret.id); + if (secretInput) { + core.setSecret(secret.value); + core.exportVariable(secretInput.outputEnvName, secret.value); + core.setOutput(secretInput.outputEnvName, secret.value); } - throw Error(errorMessage); + }); + } else { + let errorMessage = + "The secrets provided could not be found. Please check the service account has access to the secret UUIDs provided."; + if (secretResponse.errorMessage) { + errorMessage = errorMessage + `\n\n` + secretResponse.errorMessage; } + throw Error(errorMessage); } + core.info("Completed setting secrets as environment variables."); } catch (error) { if (error instanceof Error) {