diff --git a/.eslintrc.json b/.eslintrc.json index 3b95860..7ff0c58 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,11 +1,22 @@ { - "plugins": ["jest", "@typescript-eslint", "prettier", "unicorn"], - "extends": ["plugin:unicorn/recommended", "plugin:github/recommended", "plugin:prettier/recommended"], + "plugins": [ + "jest", + "@typescript-eslint", + "prettier", + "unicorn" + ], + "extends": [ + "plugin:unicorn/recommended", + "plugin:github/recommended", + "plugin:prettier/recommended" + ], "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": 2020, "sourceType": "module", - "extraFileExtensions": [".mjs"], + "extraFileExtensions": [ + ".mjs" + ], "ecmaFeatures": { "impliedStrict": true }, @@ -22,7 +33,10 @@ // Namespaces or sometimes needed "import/no-namespace": "off", // Properly format comments - "spaced-comment": ["error", "always"], + "spaced-comment": [ + "error", + "always" + ], "lines-around-comment": [ "error", { @@ -38,14 +52,31 @@ // Mandatory spacing "padding-line-between-statements": [ "error", - { "blankLine": "always", "prev": "*", "next": "return" }, - { "blankLine": "always", "prev": "directive", "next": "*" }, - { "blankLine": "any", "prev": "directive", "next": "directive" } + { + "blankLine": "always", + "prev": "*", + "next": "return" + }, + { + "blankLine": "always", + "prev": "directive", + "next": "*" + }, + { + "blankLine": "any", + "prev": "directive", + "next": "directive" + } ], // Enforce camelCase "camelcase": "error", // Allow forOfStatements - "no-restricted-syntax": ["error", "ForInStatement", "LabeledStatement", "WithStatement"], + "no-restricted-syntax": [ + "error", + "ForInStatement", + "LabeledStatement", + "WithStatement" + ], // Continue is viable in forOf loops in generators "no-continue": "off", // From experience, named exports are almost always desired. I got tired of this rule @@ -53,8 +84,17 @@ // Unused vars are useful to keep method signatures consistent and documented "@typescript-eslint/no-unused-vars": "off", // For this project only use kebab-case - "unicorn/filename-case": ["error", { "cases": { "kebabCase": true } }], + "unicorn/filename-case": [ + "error", + { + "cases": { + "kebabCase": true + } + } + ], // Allow Array.from(set) mitigate TS2569 which would require '--downlevelIteration' - "unicorn/prefer-spread": "off" + "unicorn/prefer-spread": "off", + // Temp disable to prevent mixing changes with other PRs + "i18n-text/no-en": "off" } } diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml index 7a39dba..48f82d5 100644 --- a/.github/workflows/cleanup.yml +++ b/.github/workflows/cleanup.yml @@ -21,7 +21,7 @@ jobs: lfs: true - uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: '18' - run: yarn - run: yarn run cli --help env: diff --git a/.github/workflows/integrity-check.yml b/.github/workflows/integrity-check.yml index 4d64fb8..64e01b2 100644 --- a/.github/workflows/integrity-check.yml +++ b/.github/workflows/integrity-check.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: '16' + node-version: '18' - run: yarn - run: yarn lint - run: yarn test --coverage diff --git a/dist/index.js b/dist/index.js index ca62348..a6f2dbd 100644 --- a/dist/index.js +++ b/dist/index.js @@ -8,7 +8,11 @@ require('./sourcemap-register.js');/******/ (() => { // webpackBootstrap var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -128,7 +132,11 @@ exports["default"] = Action; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -289,7 +297,7 @@ class BuildParameters { isCliMode: cli_1.Cli.isCliMode, awsStackName: cloud_runner_options_1.default.awsStackName, gitSha: input_1.default.gitSha, - logId: nanoid_1.customAlphabet(cloud_runner_constants_1.default.alphabet, 9)(), + logId: (0, nanoid_1.customAlphabet)(cloud_runner_constants_1.default.alphabet, 9)(), buildGuid: cloud_runner_guid_1.default.generateGuid(input_1.default.runNumber, input_1.default.targetPlatform), commandHooks: cloud_runner_options_1.default.commandHooks, inputPullCommand: cloud_runner_options_1.default.inputPullCommand, @@ -353,7 +361,11 @@ exports["default"] = BuildParameters; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -454,7 +466,11 @@ exports.CliFunction = CliFunction; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -627,31 +643,31 @@ class Cli { } } __decorate([ - cli_functions_repository_1.CliFunction(`print-input`, `prints all input`) + (0, cli_functions_repository_1.CliFunction)(`print-input`, `prints all input`) ], Cli, "logInput", null); __decorate([ - cli_functions_repository_1.CliFunction(`cli-build`, `runs a cloud runner build`) + (0, cli_functions_repository_1.CliFunction)(`cli-build`, `runs a cloud runner build`) ], Cli, "CLIBuild", null); __decorate([ - cli_functions_repository_1.CliFunction(`async-workflow`, `runs a cloud runner build`) + (0, cli_functions_repository_1.CliFunction)(`async-workflow`, `runs a cloud runner build`) ], Cli, "asyncronousWorkflow", null); __decorate([ - cli_functions_repository_1.CliFunction(`checks-update`, `runs a cloud runner build`) + (0, cli_functions_repository_1.CliFunction)(`checks-update`, `runs a cloud runner build`) ], Cli, "checksUpdate", null); __decorate([ - cli_functions_repository_1.CliFunction(`garbage-collect`, `runs garbage collection`) + (0, cli_functions_repository_1.CliFunction)(`garbage-collect`, `runs garbage collection`) ], Cli, "GarbageCollect", null); __decorate([ - cli_functions_repository_1.CliFunction(`list-resources`, `lists active resources`) + (0, cli_functions_repository_1.CliFunction)(`list-resources`, `lists active resources`) ], Cli, "ListResources", null); __decorate([ - cli_functions_repository_1.CliFunction(`list-worfklow`, `lists running workflows`) + (0, cli_functions_repository_1.CliFunction)(`list-worfklow`, `lists running workflows`) ], Cli, "ListWorfklow", null); __decorate([ - cli_functions_repository_1.CliFunction(`watch`, `follows logs of a running workflow`) + (0, cli_functions_repository_1.CliFunction)(`watch`, `follows logs of a running workflow`) ], Cli, "Watch", null); __decorate([ - cli_functions_repository_1.CliFunction(`remote-cli-post-build`, `runs a cloud runner build`) + (0, cli_functions_repository_1.CliFunction)(`remote-cli-post-build`, `runs a cloud runner build`) ], Cli, "PostCLIBuild", null); exports.Cli = Cli; @@ -665,7 +681,11 @@ exports.Cli = Cli; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -829,7 +849,11 @@ exports["default"] = CloudRunner; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -986,7 +1010,7 @@ const nanoid_1 = __nccwpck_require__(17592); const cloud_runner_constants_1 = __importDefault(__nccwpck_require__(10694)); class CloudRunnerNamespace { static generateGuid(runNumber, platform) { - const nanoid = nanoid_1.customAlphabet(cloud_runner_constants_1.default.alphabet, 4); + const nanoid = (0, nanoid_1.customAlphabet)(cloud_runner_constants_1.default.alphabet, 4); return `${runNumber}-${platform.toLowerCase().replace('standalone', '')}-${nanoid()}`; } } @@ -1023,7 +1047,11 @@ exports["default"] = CloudRunnerOptionsReader; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -1376,7 +1404,11 @@ exports.CloudRunnerStepParameters = CloudRunnerStepParameters; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -1553,7 +1585,11 @@ exports.AWSCloudFormationTemplates = AWSCloudFormationTemplates; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -1779,7 +1815,11 @@ exports.AWSJobStack = AWSJobStack; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -2731,7 +2771,11 @@ TaskDefinitionFormation.streamLogs = ` var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -3091,7 +3135,11 @@ exports.TaskService = TaskService; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -3196,7 +3244,7 @@ cp -a /github/workspace/cloud-runner-cache/. ${sharedFolder} ${command_hook_service_1.CommandHookService.ApplyHooksToCommands(commands, this.buildParameters)} cp -a ${sharedFolder}. /github/workspace/cloud-runner-cache/ `; - node_fs_1.writeFileSync(`${workspace}/${entrypointFilePath}`, fileContents, { + (0, node_fs_1.writeFileSync)(`${workspace}/${entrypointFilePath}`, fileContents, { flag: 'w', }); if (cloud_runner_1.default.buildParameters.cloudRunnerDebug) { @@ -3230,7 +3278,11 @@ exports["default"] = LocalDockerCloudRunner; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -3618,7 +3670,11 @@ exports["default"] = KubernetesPods; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -3684,7 +3740,11 @@ exports["default"] = KubernetesSecret; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -3727,7 +3787,11 @@ exports["default"] = KubernetesServiceAccount; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -3748,7 +3812,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const async_wait_until_1 = __importDefault(__nccwpck_require__(41299)); +const async_wait_until_1 = __nccwpck_require__(41299); const core = __importStar(__nccwpck_require__(42186)); const k8s = __importStar(__nccwpck_require__(89679)); const cloud_runner_logger_1 = __importDefault(__nccwpck_require__(42864)); @@ -3789,7 +3853,7 @@ class KubernetesStorage { try { cloud_runner_logger_1.default.log(`watch Until PVC Not Pending ${name} ${namespace}`); cloud_runner_logger_1.default.log(`${await this.getPVCPhase(kubeClient, name, namespace)}`); - await async_wait_until_1.default(async () => { + await (0, async_wait_until_1.waitUntil)(async () => { return (await this.getPVCPhase(kubeClient, name, namespace)) === 'Pending'; }, { timeout: 750000, @@ -3845,7 +3909,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); const cloud_runner_logger_1 = __importDefault(__nccwpck_require__(42864)); -const async_wait_until_1 = __importDefault(__nccwpck_require__(41299)); +const async_wait_until_1 = __nccwpck_require__(41299); const cloud_runner_system_1 = __nccwpck_require__(4197); const cloud_runner_1 = __importDefault(__nccwpck_require__(79144)); const kubernetes_pods_1 = __importDefault(__nccwpck_require__(90740)); @@ -3924,7 +3988,7 @@ class KubernetesTaskRunner { let success = false; let message = ``; cloud_runner_logger_1.default.log(`Watching ${podName} ${namespace}`); - await async_wait_until_1.default(async () => { + await (0, async_wait_until_1.waitUntil)(async () => { const status = await kubeClient.readNamespacedPodStatus(podName, namespace); const phase = status?.body.status?.phase; success = phase === 'Running'; @@ -4180,11 +4244,11 @@ class Caching { } await cloud_runner_system_1.CloudRunnerSystem.Run(`tar -cf ${cacheArtifactName}.tar${compressionSuffix} ${node_path_1.default.basename(sourceFolder)}`); await cloud_runner_system_1.CloudRunnerSystem.Run(`du ${cacheArtifactName}.tar${compressionSuffix}`); - node_console_1.assert(await fileExists(`${cacheArtifactName}.tar${compressionSuffix}`), 'cache archive exists'); - node_console_1.assert(await fileExists(node_path_1.default.basename(sourceFolder)), 'source folder exists'); + (0, node_console_1.assert)(await fileExists(`${cacheArtifactName}.tar${compressionSuffix}`), 'cache archive exists'); + (0, node_console_1.assert)(await fileExists(node_path_1.default.basename(sourceFolder)), 'source folder exists'); await cloud_runner_system_1.CloudRunnerSystem.Run(`mv ${cacheArtifactName}.tar${compressionSuffix} ${cacheFolder}`); remote_client_logger_1.RemoteClientLogger.log(`moved cache entry ${cacheArtifactName} to ${cacheFolder}`); - node_console_1.assert(await fileExists(`${node_path_1.default.join(cacheFolder, cacheArtifactName)}.tar${compressionSuffix}`), 'cache archive exists inside cache folder'); + (0, node_console_1.assert)(await fileExists(`${node_path_1.default.join(cacheFolder, cacheArtifactName)}.tar${compressionSuffix}`), 'cache archive exists inside cache folder'); } catch (error) { process.chdir(`${startPath}`); @@ -4227,7 +4291,7 @@ class Caching { const fullResultsFolder = node_path_1.default.join(cacheFolder, resultsFolder); await cloud_runner_system_1.CloudRunnerSystem.Run(`tar -xf ${cacheSelection}.tar${compressionSuffix} -C ${fullResultsFolder}`); remote_client_logger_1.RemoteClientLogger.log(`cache item extracted to ${fullResultsFolder}`); - node_console_1.assert(await fileExists(fullResultsFolder), `cache extraction results folder exists`); + (0, node_console_1.assert)(await fileExists(fullResultsFolder), `cache extraction results folder exists`); const destinationParentFolder = node_path_1.default.resolve(destinationFolder, '..'); if (await fileExists(destinationFolder)) { await node_fs_1.default.promises.rmdir(destinationFolder, { recursive: true }); @@ -4258,10 +4322,10 @@ class Caching { } } __decorate([ - cli_functions_repository_1.CliFunction(`cache-push`, `push to cache`) + (0, cli_functions_repository_1.CliFunction)(`cache-push`, `push to cache`) ], Caching, "cachePush", null); __decorate([ - cli_functions_repository_1.CliFunction(`cache-pull`, `pull from cache`) + (0, cli_functions_repository_1.CliFunction)(`cache-pull`, `pull from cache`) ], Caching, "cachePull", null); exports.Caching = Caching; @@ -4295,7 +4359,7 @@ const node_console_1 = __nccwpck_require__(40027); const cloud_runner_logger_1 = __importDefault(__nccwpck_require__(42864)); const cli_functions_repository_1 = __nccwpck_require__(85301); const cloud_runner_system_1 = __nccwpck_require__(4197); -const yaml_1 = __importDefault(__nccwpck_require__(44603)); +const yaml_1 = __importDefault(__nccwpck_require__(44083)); const github_1 = __importDefault(__nccwpck_require__(83654)); const build_parameters_1 = __importDefault(__nccwpck_require__(80787)); class RemoteClient { @@ -4376,7 +4440,7 @@ class RemoteClient { } process.chdir(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute); await cloud_runner_system_1.CloudRunnerSystem.Run(`git lfs install`); - node_console_1.assert(node_fs_1.default.existsSync(`.git`), 'git folder exists'); + (0, node_console_1.assert)(node_fs_1.default.existsSync(`.git`), 'git folder exists'); remote_client_logger_1.RemoteClientLogger.log(`${cloud_runner_1.default.buildParameters.branch}`); if (cloud_runner_1.default.buildParameters.gitSha !== undefined) { await cloud_runner_system_1.CloudRunnerSystem.Run(`git checkout ${cloud_runner_1.default.buildParameters.gitSha}`); @@ -4385,7 +4449,7 @@ class RemoteClient { await cloud_runner_system_1.CloudRunnerSystem.Run(`git checkout ${cloud_runner_1.default.buildParameters.branch}`); remote_client_logger_1.RemoteClientLogger.log(`buildParameter Git Sha is empty`); } - node_console_1.assert(node_fs_1.default.existsSync(node_path_1.default.join(`.git`, `lfs`)), 'LFS folder should not exist before caching'); + (0, node_console_1.assert)(node_fs_1.default.existsSync(node_path_1.default.join(`.git`, `lfs`)), 'LFS folder should not exist before caching'); remote_client_logger_1.RemoteClientLogger.log(`Checked out ${cloud_runner_1.default.buildParameters.branch}`); } static async replaceLargePackageReferencesWithSharedReferences() { @@ -4407,7 +4471,7 @@ class RemoteClient { if (!cloud_runner_1.default.buildParameters.skipLfs) { await cloud_runner_system_1.CloudRunnerSystem.Run(`git lfs pull`); remote_client_logger_1.RemoteClientLogger.log(`pulled latest LFS files`); - node_console_1.assert(node_fs_1.default.existsSync(cloud_runner_folders_1.CloudRunnerFolders.lfsFolderAbsolute)); + (0, node_console_1.assert)(node_fs_1.default.existsSync(cloud_runner_folders_1.CloudRunnerFolders.lfsFolderAbsolute)); } } static async handleRetainedWorkspace() { @@ -4427,7 +4491,7 @@ class RemoteClient { } } __decorate([ - cli_functions_repository_1.CliFunction(`remote-cli-pre-build`, `sets up a repository, usually before a game-ci build`) + (0, cli_functions_repository_1.CliFunction)(`remote-cli-pre-build`, `sets up a repository, usually before a game-ci build`) ], RemoteClient, "runRemoteClientJob", null); exports.RemoteClient = RemoteClient; @@ -4471,7 +4535,11 @@ exports.RemoteClientLogger = RemoteClientLogger; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -4553,7 +4621,7 @@ class CloudRunnerSystem { } return await new Promise((promise, throwError) => { let output = ''; - const child = child_process_1.exec(command, (error, stdout, stderr) => { + const child = (0, child_process_1.exec)(command, (error, stdout, stderr) => { if (!suppressError && error) { remote_client_logger_1.RemoteClientLogger.log(error.toString()); throwError(error); @@ -4598,7 +4666,11 @@ exports.CloudRunnerSystem = CloudRunnerSystem; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -5052,7 +5124,11 @@ TaskParameterSerializer.blockedParameterNames = new Set([ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -5075,7 +5151,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CommandHookService = void 0; const __1 = __nccwpck_require__(41359); -const yaml_1 = __importDefault(__nccwpck_require__(44603)); +const yaml_1 = __importDefault(__nccwpck_require__(44083)); const remote_client_logger_1 = __nccwpck_require__(59412); const node_path_1 = __importDefault(__nccwpck_require__(49411)); const cloud_runner_options_1 = __importDefault(__nccwpck_require__(66965)); @@ -5187,7 +5263,11 @@ exports.CommandHookService = CommandHookService; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -5209,7 +5289,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ContainerHookService = void 0; -const yaml_1 = __importDefault(__nccwpck_require__(44603)); +const yaml_1 = __importDefault(__nccwpck_require__(44083)); const cloud_runner_1 = __importDefault(__nccwpck_require__(79144)); const core = __importStar(__nccwpck_require__(42186)); const custom_workflow_1 = __nccwpck_require__(3786); @@ -5504,7 +5584,7 @@ class LfsHashing { } } __decorate([ - cli_functions_repository_1.CliFunction(`hash`, `hash all folder contents`) + (0, cli_functions_repository_1.CliFunction)(`hash`, `hash all folder contents`) ], LfsHashing, "hash", null); exports.LfsHashing = LfsHashing; @@ -5581,7 +5661,11 @@ exports.AsyncWorkflow = AsyncWorkflow; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -5789,20 +5873,20 @@ class Docker { } if (options) { options.silent = silent; - await exec_with_error_check_1.execWithErrorCheck(runCommand, undefined, options, errorWhenMissingUnityBuildResults); + await (0, exec_with_error_check_1.execWithErrorCheck)(runCommand, undefined, options, errorWhenMissingUnityBuildResults); } else { - await exec_with_error_check_1.execWithErrorCheck(runCommand, undefined, { silent }, errorWhenMissingUnityBuildResults); + await (0, exec_with_error_check_1.execWithErrorCheck)(runCommand, undefined, { silent }, errorWhenMissingUnityBuildResults); } } static getLinuxCommand(image, parameters, overrideCommands = '', additionalVariables = [], entrypointBash = false) { const { workspace, actionFolder, runnerTempPath, sshAgent, gitPrivateToken, dockerWorkspacePath } = parameters; const githubHome = node_path_1.default.join(runnerTempPath, '_github_home'); - if (!node_fs_1.existsSync(githubHome)) - node_fs_1.mkdirSync(githubHome); + if (!(0, node_fs_1.existsSync)(githubHome)) + (0, node_fs_1.mkdirSync)(githubHome); const githubWorkflow = node_path_1.default.join(runnerTempPath, '_github_workflow'); - if (!node_fs_1.existsSync(githubWorkflow)) - node_fs_1.mkdirSync(githubWorkflow); + if (!(0, node_fs_1.existsSync)(githubWorkflow)) + (0, node_fs_1.mkdirSync)(githubWorkflow); const commandPrefix = image === `alpine` ? `/bin/sh` : `/bin/bash`; return `docker run \ --workdir ${dockerWorkspacePath} \ @@ -5895,7 +5979,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.execWithErrorCheck = void 0; const exec_1 = __nccwpck_require__(71514); async function execWithErrorCheck(commandLine, arguments_, options, errorWhenMissingUnityBuildResults = true) { - const result = await exec_1.getExecOutput(commandLine, arguments_, options); + const result = await (0, exec_1.getExecOutput)(commandLine, arguments_, options); if (!errorWhenMissingUnityBuildResults) { return result.exitCode; } @@ -5925,7 +6009,11 @@ exports.execWithErrorCheck = execWithErrorCheck; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -6162,7 +6250,7 @@ class ImageEnvironmentFactory { } static getEnvironmentVariables(parameters, additionalVariables = []) { let environmentVariables = [ - { name: 'UNITY_LICENSE', value: process.env.UNITY_LICENSE || test_license_reader_1.ReadLicense() }, + { name: 'UNITY_LICENSE', value: process.env.UNITY_LICENSE || (0, test_license_reader_1.ReadLicense)() }, { name: 'UNITY_LICENSE_FILE', value: process.env.UNITY_LICENSE_FILE }, { name: 'UNITY_EMAIL', value: process.env.UNITY_EMAIL }, { name: 'UNITY_PASSWORD', value: process.env.UNITY_PASSWORD }, @@ -6254,7 +6342,7 @@ class ImageTag { const isCloudRunnerLocal = cloudRunnerBuilderPlatform === 'local' || cloudRunnerBuilderPlatform === undefined; this.builderPlatform = ImageTag.getTargetPlatformToTargetPlatformSuffixMap(targetPlatform, editorVersion); this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes(isCloudRunnerLocal ? process.platform : cloudRunnerBuilderPlatform); - this.imageRollingVersion = 1; // Will automatically roll to the latest non-breaking version. + this.imageRollingVersion = 2; // Will automatically roll to the latest non-breaking version. } static get versionPattern() { return /^(20\d{2}\.\d\.\w{3,4}|3)$/; @@ -6424,7 +6512,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ActionYamlReader = void 0; const node_fs_1 = __importDefault(__nccwpck_require__(87561)); const node_path_1 = __importDefault(__nccwpck_require__(49411)); -const yaml_1 = __importDefault(__nccwpck_require__(44603)); +const yaml_1 = __importDefault(__nccwpck_require__(44083)); class ActionYamlReader { constructor() { let filename = `action.yml`; @@ -6488,17 +6576,17 @@ class GitRepoReader { if (cloud_runner_options_1.default.providerStrategy === 'local') { return ''; } - node_console_1.assert(node_fs_1.default.existsSync(`.git`)); + (0, node_console_1.assert)(node_fs_1.default.existsSync(`.git`)); const value = (await cloud_runner_system_1.CloudRunnerSystem.Run(`cd ${input_1.default.projectPath} && git remote -v`, false, true)).replace(/ /g, ``); cloud_runner_logger_1.default.log(`value ${value}`); - node_console_1.assert(value.includes('github.com')); + (0, node_console_1.assert)(value.includes('github.com')); return value.split('github.com')[1].split('.git')[0].slice(1); } static async GetBranch() { if (cloud_runner_options_1.default.providerStrategy === 'local') { return ''; } - node_console_1.assert(node_fs_1.default.existsSync(`.git`)); + (0, node_console_1.assert)(node_fs_1.default.existsSync(`.git`)); return (await cloud_runner_system_1.CloudRunnerSystem.Run(`cd ${input_1.default.projectPath} && git branch --show-current`, false, true)) .split('\n')[0] .replace(/ /g, ``) @@ -6517,7 +6605,11 @@ exports.GitRepoReader = GitRepoReader; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -6580,7 +6672,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ReadLicense = void 0; const node_path_1 = __importDefault(__nccwpck_require__(49411)); const node_fs_1 = __importDefault(__nccwpck_require__(87561)); -const yaml_1 = __importDefault(__nccwpck_require__(44603)); +const yaml_1 = __importDefault(__nccwpck_require__(44083)); const cloud_runner_options_1 = __importDefault(__nccwpck_require__(66965)); function ReadLicense() { if (cloud_runner_options_1.default.providerStrategy === 'local') { @@ -6601,7 +6693,11 @@ exports.ReadLicense = ReadLicense; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -6818,7 +6914,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); const exec_with_error_check_1 = __nccwpck_require__(3161); class MacBuilder { static async run(actionFolder, silent = false) { - await exec_with_error_check_1.execWithErrorCheck('bash', [`${actionFolder}/platforms/mac/entrypoint.sh`], { + await (0, exec_with_error_check_1.execWithErrorCheck)('bash', [`${actionFolder}/platforms/mac/entrypoint.sh`], { silent, }); } @@ -6835,7 +6931,11 @@ exports["default"] = MacBuilder; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -6874,7 +6974,11 @@ exports["default"] = Output; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -6943,7 +7047,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SetupAndroid = exports.SetupMac = exports.SetupWindows = void 0; const setup_windows_1 = __importDefault(__nccwpck_require__(37449)); exports.SetupWindows = setup_windows_1.default; -const setup_mac_1 = __importDefault(__nccwpck_require__(22466)); +const setup_mac_1 = __importDefault(__nccwpck_require__(72715)); exports.SetupMac = setup_mac_1.default; const setup_android_1 = __importDefault(__nccwpck_require__(45142)); exports.SetupAndroid = setup_android_1.default; @@ -6980,7 +7084,7 @@ exports["default"] = SetupAndroid; /***/ }), -/***/ 22466: +/***/ 72715: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -7012,7 +7116,7 @@ class SetupMac { : await SetupMac.getLatestUnityHubVersion(); const restoreKey = `Cache-MacOS-UnityHub@${targetHubVersion}`; if (buildParameters.cacheUnityInstallationOnMac) { - const cacheId = await cache_1.restoreCache([unityHubCachePath], restoreKey); + const cacheId = await (0, cache_1.restoreCache)([unityHubCachePath], restoreKey); if (cacheId) { // Cache restored successfully, unity hub is installed now return; @@ -7022,12 +7126,12 @@ class SetupMac { const command = `brew install unity-hub${commandSuffix}`; // Ignoring return code because the log seems to overflow the internal buffer which triggers // a false error - const errorCode = await exec_1.exec(command, undefined, { silent, ignoreReturnCode: true }); + const errorCode = await (0, exec_1.exec)(command, undefined, { silent, ignoreReturnCode: true }); if (errorCode) { throw new Error(`There was an error installing the Unity Editor. See logs above for details.`); } if (buildParameters.cacheUnityInstallationOnMac) { - await cache_1.saveCache([unityHubCachePath], restoreKey); + await (0, cache_1.saveCache)([unityHubCachePath], restoreKey); } } /** @@ -7037,7 +7141,7 @@ class SetupMac { static async getLatestUnityHubVersion() { // Need to check if the latest version available is the same as the one we have cached const hubVersionCommand = `/bin/bash -c "brew info unity-hub | grep -o '[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+'"`; - const result = await exec_1.getExecOutput(hubVersionCommand, undefined, { silent: true }); + const result = await (0, exec_1.getExecOutput)(hubVersionCommand, undefined, { silent: true }); if (result.exitCode === 0 && result.stdout !== '') { return result.stdout; } @@ -7070,13 +7174,13 @@ class SetupMac { const unityEditorPath = `/Applications/Unity/Hub/Editor/${buildParameters.editorVersion}`; const key = `Cache-MacOS-UnityEditor-With-Module-${buildParameters.targetPlatform}@${buildParameters.editorVersion}`; if (buildParameters.cacheUnityInstallationOnMac) { - const cacheId = await cache_1.restoreCache([unityEditorPath], key); + const cacheId = await (0, cache_1.restoreCache)([unityEditorPath], key); if (cacheId) { // Cache restored successfully, unity editor is installed now return; } } - const unityChangeset = await unity_changeset_1.getUnityChangeset(buildParameters.editorVersion); + const unityChangeset = await (0, unity_changeset_1.getUnityChangeset)(buildParameters.editorVersion); const moduleArguments = SetupMac.getModuleParametersForTargetPlatform(buildParameters.targetPlatform); const execArguments = [ '--', @@ -7089,12 +7193,12 @@ class SetupMac { ]; // Ignoring return code because the log seems to overflow the internal buffer which triggers // a false error - const errorCode = await exec_1.exec(this.unityHubExecPath, execArguments, { silent, ignoreReturnCode: true }); + const errorCode = await (0, exec_1.exec)(this.unityHubExecPath, execArguments, { silent, ignoreReturnCode: true }); if (errorCode) { throw new Error(`There was an error installing the Unity Editor. See logs above for details.`); } if (buildParameters.cacheUnityInstallationOnMac) { - await cache_1.saveCache([unityEditorPath], key); + await (0, cache_1.saveCache)([unityEditorPath], key); } } static async setEnvironmentVariables(buildParameters, actionFolder) { @@ -7164,7 +7268,7 @@ class SetupWindows { static async generateWinSDKRegKeys(silent = false) { // Export registry keys that point to the Windows 10 SDK const exportWinSDKRegKeysCommand = 'reg export "HKLM\\SOFTWARE\\WOW6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0" c:/regkeys/winsdk.reg /y'; - await exec_1.exec(exportWinSDKRegKeysCommand, undefined, { silent }); + await (0, exec_1.exec)(exportWinSDKRegKeysCommand, undefined, { silent }); } } exports["default"] = SetupWindows; @@ -7323,7 +7427,11 @@ exports["default"] = Project; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -7384,7 +7492,7 @@ class System { if (command.trim() === '') { throw new Error(`Failed to execute empty command`); } - const exitCode = await exec_1.exec(command, arguments_, { silent: true, listeners, ...options }); + const exitCode = await (0, exec_1.exec)(command, arguments_, { silent: true, listeners, ...options }); showOutput(); if (exitCode !== 0) { throwContextualError(`Command returned non-zero exit code.\nError: ${error}`); @@ -7466,7 +7574,11 @@ exports["default"] = Unity; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -7720,6 +7832,29 @@ exports["default"] = Versioning; "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -7729,14 +7864,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.saveCache = exports.restoreCache = exports.isFeatureAvailable = exports.ReserveCacheError = exports.ValidationError = void 0; const core = __importStar(__nccwpck_require__(42186)); const path = __importStar(__nccwpck_require__(71017)); const utils = __importStar(__nccwpck_require__(75340)); @@ -7816,16 +7945,20 @@ function restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArch // Cache not found return undefined; } + if (options === null || options === void 0 ? void 0 : options.lookupOnly) { + core.info('Lookup only - skipping download'); + return cacheEntry.cacheKey; + } archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); core.debug(`Archive Path: ${archivePath}`); // Download the cache from the cache entry yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); if (core.isDebug()) { - yield tar_1.listTar(archivePath, compressionMethod); + yield (0, tar_1.listTar)(archivePath, compressionMethod); } const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - yield tar_1.extractTar(archivePath, compressionMethod); + yield (0, tar_1.extractTar)(archivePath, compressionMethod); core.info('Cache restored successfully'); return cacheEntry.cacheKey; } @@ -7878,9 +8011,9 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) { const archivePath = path.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core.debug(`Archive Path: ${archivePath}`); try { - yield tar_1.createTar(archiveFolder, cachePaths, compressionMethod); + yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); if (core.isDebug()) { - yield tar_1.listTar(archivePath, compressionMethod); + yield (0, tar_1.listTar)(archivePath, compressionMethod); } const fileSizeLimit = 10 * 1024 * 1024 * 1024; // 10GB per repo limit const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); @@ -7941,6 +8074,29 @@ exports.saveCache = saveCache; "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -7950,14 +8106,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.saveCache = exports.reserveCache = exports.downloadCache = exports.getCacheEntry = exports.getCacheVersion = void 0; const core = __importStar(__nccwpck_require__(42186)); const http_client_1 = __nccwpck_require__(96255); const auth_1 = __nccwpck_require__(35526); @@ -8007,10 +8157,7 @@ function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) } // Add salt to cache version to support breaking changes in cache entry components.push(versionSalt); - return crypto - .createHash('sha256') - .update(components.join('|')) - .digest('hex'); + return crypto.createHash('sha256').update(components.join('|')).digest('hex'); } exports.getCacheVersion = getCacheVersion; function getCacheEntry(keys, paths, options) { @@ -8018,7 +8165,7 @@ function getCacheEntry(keys, paths, options) { const httpClient = createHttpClient(); const version = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod, options === null || options === void 0 ? void 0 : options.enableCrossOsArchive); const resource = `cache?keys=${encodeURIComponent(keys.join(','))}&version=${version}`; - const response = yield requestUtils_1.retryTypedResponse('getCacheEntry', () => __awaiter(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); + const response = yield (0, requestUtils_1.retryTypedResponse)('getCacheEntry', () => __awaiter(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); // Cache not found if (response.statusCode === 204) { // List cache for primary key only if cache miss occurs @@ -8027,7 +8174,7 @@ function getCacheEntry(keys, paths, options) { } return null; } - if (!requestUtils_1.isSuccessStatusCode(response.statusCode)) { + if (!(0, requestUtils_1.isSuccessStatusCode)(response.statusCode)) { throw new Error(`Cache service responded with ${response.statusCode}`); } const cacheResult = response.result; @@ -8046,7 +8193,7 @@ exports.getCacheEntry = getCacheEntry; function printCachesListForDiagnostics(key, httpClient, version) { return __awaiter(this, void 0, void 0, function* () { const resource = `caches?key=${encodeURIComponent(key)}`; - const response = yield requestUtils_1.retryTypedResponse('listCache', () => __awaiter(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); + const response = yield (0, requestUtils_1.retryTypedResponse)('listCache', () => __awaiter(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 200) { const cacheListResult = response.result; const totalCount = cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.totalCount; @@ -8062,15 +8209,23 @@ function printCachesListForDiagnostics(key, httpClient, version) { function downloadCache(archiveLocation, archivePath, options) { return __awaiter(this, void 0, void 0, function* () { const archiveUrl = new url_1.URL(archiveLocation); - const downloadOptions = options_1.getDownloadOptions(options); - if (downloadOptions.useAzureSdk && - archiveUrl.hostname.endsWith('.blob.core.windows.net')) { - // Use Azure storage SDK to download caches hosted on Azure to improve speed and reliability. - yield downloadUtils_1.downloadCacheStorageSDK(archiveLocation, archivePath, downloadOptions); + const downloadOptions = (0, options_1.getDownloadOptions)(options); + if (archiveUrl.hostname.endsWith('.blob.core.windows.net')) { + if (downloadOptions.useAzureSdk) { + // Use Azure storage SDK to download caches hosted on Azure to improve speed and reliability. + yield (0, downloadUtils_1.downloadCacheStorageSDK)(archiveLocation, archivePath, downloadOptions); + } + else if (downloadOptions.concurrentBlobDownloads) { + // Use concurrent implementation with HttpClient to work around blob SDK issue + yield (0, downloadUtils_1.downloadCacheHttpClientConcurrent)(archiveLocation, archivePath, downloadOptions); + } + else { + // Otherwise, download using the Actions http-client. + yield (0, downloadUtils_1.downloadCacheHttpClient)(archiveLocation, archivePath); + } } else { - // Otherwise, download using the Actions http-client. - yield downloadUtils_1.downloadCacheHttpClient(archiveLocation, archivePath); + yield (0, downloadUtils_1.downloadCacheHttpClient)(archiveLocation, archivePath); } }); } @@ -8085,7 +8240,7 @@ function reserveCache(key, paths, options) { version, cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize }; - const response = yield requestUtils_1.retryTypedResponse('reserveCache', () => __awaiter(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)('reserveCache', () => __awaiter(this, void 0, void 0, function* () { return httpClient.postJson(getCacheApiUrl('caches'), reserveCacheRequest); })); return response; @@ -8102,17 +8257,15 @@ function getContentRange(start, end) { } function uploadChunk(httpClient, resourceUrl, openStream, start, end) { return __awaiter(this, void 0, void 0, function* () { - core.debug(`Uploading chunk of size ${end - - start + - 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`); + core.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`); const additionalHeaders = { 'Content-Type': 'application/octet-stream', 'Content-Range': getContentRange(start, end) }; - const uploadChunkResponse = yield requestUtils_1.retryHttpClientResponse(`uploadChunk (start: ${start}, end: ${end})`, () => __awaiter(this, void 0, void 0, function* () { + const uploadChunkResponse = yield (0, requestUtils_1.retryHttpClientResponse)(`uploadChunk (start: ${start}, end: ${end})`, () => __awaiter(this, void 0, void 0, function* () { return httpClient.sendStream('PATCH', resourceUrl, openStream(), additionalHeaders); })); - if (!requestUtils_1.isSuccessStatusCode(uploadChunkResponse.message.statusCode)) { + if (!(0, requestUtils_1.isSuccessStatusCode)(uploadChunkResponse.message.statusCode)) { throw new Error(`Cache service responded with ${uploadChunkResponse.message.statusCode} during upload chunk.`); } }); @@ -8123,7 +8276,7 @@ function uploadFile(httpClient, cacheId, archivePath, options) { const fileSize = utils.getArchiveFileSizeInBytes(archivePath); const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); const fd = fs.openSync(archivePath, 'r'); - const uploadOptions = options_1.getUploadOptions(options); + const uploadOptions = (0, options_1.getUploadOptions)(options); const concurrency = utils.assertDefined('uploadConcurrency', uploadOptions.uploadConcurrency); const maxChunkSize = utils.assertDefined('uploadChunkSize', uploadOptions.uploadChunkSize); const parallelUploads = [...new Array(concurrency).keys()]; @@ -8158,7 +8311,7 @@ function uploadFile(httpClient, cacheId, archivePath, options) { function commitCache(httpClient, cacheId, filesize) { return __awaiter(this, void 0, void 0, function* () { const commitCacheRequest = { size: filesize }; - return yield requestUtils_1.retryTypedResponse('commitCache', () => __awaiter(this, void 0, void 0, function* () { + return yield (0, requestUtils_1.retryTypedResponse)('commitCache', () => __awaiter(this, void 0, void 0, function* () { return httpClient.postJson(getCacheApiUrl(`caches/${cacheId.toString()}`), commitCacheRequest); })); }); @@ -8173,7 +8326,7 @@ function saveCache(cacheId, archivePath, options) { const cacheSize = utils.getArchiveFileSizeInBytes(archivePath); core.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`); const commitCacheResponse = yield commitCache(httpClient, cacheId, cacheSize); - if (!requestUtils_1.isSuccessStatusCode(commitCacheResponse.statusCode)) { + if (!(0, requestUtils_1.isSuccessStatusCode)(commitCacheResponse.statusCode)) { throw new Error(`Cache service responded with ${commitCacheResponse.statusCode} during commit cache.`); } core.info('Cache saved successfully'); @@ -8189,6 +8342,29 @@ exports.saveCache = saveCache; "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -8205,16 +8381,10 @@ var __asyncValues = (this && this.__asyncValues) || function (o) { function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } }; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isGhes = exports.assertDefined = exports.getGnuTarPathOnWindows = exports.getCacheFileName = exports.getCompressionMethod = exports.unlinkFile = exports.resolvePaths = exports.getArchiveFileSizeInBytes = exports.createTempDirectory = void 0; const core = __importStar(__nccwpck_require__(42186)); -const exec = __importStar(__nccwpck_require__(83878)); +const exec = __importStar(__nccwpck_require__(71514)); const glob = __importStar(__nccwpck_require__(28090)); const io = __importStar(__nccwpck_require__(47351)); const fs = __importStar(__nccwpck_require__(57147)); @@ -8244,7 +8414,7 @@ function createTempDirectory() { } tempDirectory = path.join(baseLocation, 'actions', 'temp'); } - const dest = path.join(tempDirectory, uuid_1.v4()); + const dest = path.join(tempDirectory, (0, uuid_1.v4)()); yield io.mkdirP(dest); return dest; }); @@ -8255,35 +8425,42 @@ function getArchiveFileSizeInBytes(filePath) { } exports.getArchiveFileSizeInBytes = getArchiveFileSizeInBytes; function resolvePaths(patterns) { - var e_1, _a; - var _b; + var _a, e_1, _b, _c; + var _d; return __awaiter(this, void 0, void 0, function* () { const paths = []; - const workspace = (_b = process.env['GITHUB_WORKSPACE']) !== null && _b !== void 0 ? _b : process.cwd(); + const workspace = (_d = process.env['GITHUB_WORKSPACE']) !== null && _d !== void 0 ? _d : process.cwd(); const globber = yield glob.create(patterns.join('\n'), { implicitDescendants: false }); try { - for (var _c = __asyncValues(globber.globGenerator()), _d; _d = yield _c.next(), !_d.done;) { - const file = _d.value; - const relativeFile = path - .relative(workspace, file) - .replace(new RegExp(`\\${path.sep}`, 'g'), '/'); - core.debug(`Matched: ${relativeFile}`); - // Paths are made relative so the tar entries are all relative to the root of the workspace. - if (relativeFile === '') { - // path.relative returns empty string if workspace and file are equal - paths.push('.'); + for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a;) { + _c = _g.value; + _e = false; + try { + const file = _c; + const relativeFile = path + .relative(workspace, file) + .replace(new RegExp(`\\${path.sep}`, 'g'), '/'); + core.debug(`Matched: ${relativeFile}`); + // Paths are made relative so the tar entries are all relative to the root of the workspace. + if (relativeFile === '') { + // path.relative returns empty string if workspace and file are equal + paths.push('.'); + } + else { + paths.push(`${relativeFile}`); + } } - else { - paths.push(`${relativeFile}`); + finally { + _e = true; } } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { - if (_d && !_d.done && (_a = _c.return)) yield _a.call(_c); + if (!_e && !_a && (_b = _f.return)) yield _b.call(_f); } finally { if (e_1) throw e_1.error; } } @@ -8297,12 +8474,13 @@ function unlinkFile(filePath) { }); } exports.unlinkFile = unlinkFile; -function getVersion(app) { +function getVersion(app, additionalArgs = []) { return __awaiter(this, void 0, void 0, function* () { - core.debug(`Checking ${app} --version`); let versionOutput = ''; + additionalArgs.push('--version'); + core.debug(`Checking ${app} ${additionalArgs.join(' ')}`); try { - yield exec.exec(`${app} --version`, [], { + yield exec.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, silent: true, listeners: { @@ -8322,19 +8500,14 @@ function getVersion(app) { // Use zstandard if possible to maximize cache performance function getCompressionMethod() { return __awaiter(this, void 0, void 0, function* () { - const versionOutput = yield getVersion('zstd'); + const versionOutput = yield getVersion('zstd', ['--quiet']); const version = semver.clean(versionOutput); - if (!versionOutput.toLowerCase().includes('zstd command line interface')) { - // zstd is not installed + core.debug(`zstd version: ${version}`); + if (versionOutput === '') { return constants_1.CompressionMethod.Gzip; } - else if (!version || semver.lt(version, 'v1.3.2')) { - // zstd is installed but using a version earlier than v1.3.2 - // v1.3.2 is required to use the `--long` options in zstd - return constants_1.CompressionMethod.ZstdWithoutLong; - } else { - return constants_1.CompressionMethod.Zstd; + return constants_1.CompressionMethod.ZstdWithoutLong; } }); } @@ -8377,6 +8550,7 @@ exports.isGhes = isGhes; "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ManifestFilename = exports.TarFilename = exports.SystemTarPathOnWindows = exports.GnuTarPathOnWindows = exports.SocketTimeout = exports.DefaultRetryDelay = exports.DefaultRetryAttempts = exports.ArchiveToolType = exports.CompressionMethod = exports.CacheFilename = void 0; var CacheFilename; (function (CacheFilename) { CacheFilename["Gzip"] = "cache.tgz"; @@ -8418,6 +8592,29 @@ exports.ManifestFilename = 'manifest.txt'; "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -8427,14 +8624,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.downloadCacheStorageSDK = exports.downloadCacheHttpClientConcurrent = exports.downloadCacheHttpClient = exports.DownloadProgress = void 0; const core = __importStar(__nccwpck_require__(42186)); const http_client_1 = __nccwpck_require__(96255); const storage_blob_1 = __nccwpck_require__(84100); @@ -8569,7 +8760,7 @@ function downloadCacheHttpClient(archiveLocation, archivePath) { return __awaiter(this, void 0, void 0, function* () { const writeStream = fs.createWriteStream(archivePath); const httpClient = new http_client_1.HttpClient('actions/cache'); - const downloadResponse = yield requestUtils_1.retryHttpClientResponse('downloadCache', () => __awaiter(this, void 0, void 0, function* () { return httpClient.get(archiveLocation); })); + const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)('downloadCache', () => __awaiter(this, void 0, void 0, function* () { return httpClient.get(archiveLocation); })); // Abort download if no traffic received over the socket. downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => { downloadResponse.message.destroy(); @@ -8591,6 +8782,115 @@ function downloadCacheHttpClient(archiveLocation, archivePath) { }); } exports.downloadCacheHttpClient = downloadCacheHttpClient; +/** + * Download the cache using the Actions toolkit http-client concurrently + * + * @param archiveLocation the URL for the cache + * @param archivePath the local path where the cache is saved + */ +function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + const archiveDescriptor = yield fs.promises.open(archivePath, 'w'); + const httpClient = new http_client_1.HttpClient('actions/cache', undefined, { + socketTimeout: options.timeoutInMs, + keepAlive: true + }); + try { + const res = yield (0, requestUtils_1.retryHttpClientResponse)('downloadCacheMetadata', () => __awaiter(this, void 0, void 0, function* () { return yield httpClient.request('HEAD', archiveLocation, null, {}); })); + const lengthHeader = res.message.headers['content-length']; + if (lengthHeader === undefined || lengthHeader === null) { + throw new Error('Content-Length not found on blob response'); + } + const length = parseInt(lengthHeader); + if (Number.isNaN(length)) { + throw new Error(`Could not interpret Content-Length: ${length}`); + } + const downloads = []; + const blockSize = 4 * 1024 * 1024; + for (let offset = 0; offset < length; offset += blockSize) { + const count = Math.min(blockSize, length - offset); + downloads.push({ + offset, + promiseGetter: () => __awaiter(this, void 0, void 0, function* () { + return yield downloadSegmentRetry(httpClient, archiveLocation, offset, count); + }) + }); + } + // reverse to use .pop instead of .shift + downloads.reverse(); + let actives = 0; + let bytesDownloaded = 0; + const progress = new DownloadProgress(length); + progress.startDisplayTimer(); + const progressFn = progress.onProgress(); + const activeDownloads = []; + let nextDownload; + const waitAndWrite = () => __awaiter(this, void 0, void 0, function* () { + const segment = yield Promise.race(Object.values(activeDownloads)); + yield archiveDescriptor.write(segment.buffer, 0, segment.count, segment.offset); + actives--; + delete activeDownloads[segment.offset]; + bytesDownloaded += segment.count; + progressFn({ loadedBytes: bytesDownloaded }); + }); + while ((nextDownload = downloads.pop())) { + activeDownloads[nextDownload.offset] = nextDownload.promiseGetter(); + actives++; + if (actives >= ((_a = options.downloadConcurrency) !== null && _a !== void 0 ? _a : 10)) { + yield waitAndWrite(); + } + } + while (actives > 0) { + yield waitAndWrite(); + } + } + finally { + httpClient.dispose(); + yield archiveDescriptor.close(); + } + }); +} +exports.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; +function downloadSegmentRetry(httpClient, archiveLocation, offset, count) { + return __awaiter(this, void 0, void 0, function* () { + const retries = 5; + let failures = 0; + while (true) { + try { + const timeout = 30000; + const result = yield promiseWithTimeout(timeout, downloadSegment(httpClient, archiveLocation, offset, count)); + if (typeof result === 'string') { + throw new Error('downloadSegmentRetry failed due to timeout'); + } + return result; + } + catch (err) { + if (failures >= retries) { + throw err; + } + failures++; + } + } + }); +} +function downloadSegment(httpClient, archiveLocation, offset, count) { + return __awaiter(this, void 0, void 0, function* () { + const partRes = yield (0, requestUtils_1.retryHttpClientResponse)('downloadCachePart', () => __awaiter(this, void 0, void 0, function* () { + return yield httpClient.get(archiveLocation, { + Range: `bytes=${offset}-${offset + count - 1}` + }); + })); + if (!partRes.readBodyBuffer) { + throw new Error('Expected HttpClientResponse to implement readBodyBuffer'); + } + return { + offset, + count, + buffer: yield partRes.readBodyBuffer() + }; + }); +} /** * Download the cache using the Azure Storage SDK. Only call this method if the * URL points to an Azure Storage endpoint. @@ -8624,7 +8924,8 @@ function downloadCacheStorageSDK(archiveLocation, archivePath, options) { // If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB // on 64-bit systems), split the download into multiple segments // ~2 GB = 2147483647, beyond this, we start getting out of range error. So, capping it accordingly. - const maxSegmentSize = Math.min(2147483647, buffer.constants.MAX_LENGTH); + // Updated segment size to 128MB = 134217728 bytes, to complete a segment faster and fail fast + const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); const downloadProgress = new DownloadProgress(contentLength); const fd = fs.openSync(archivePath, 'w'); try { @@ -8676,6 +8977,29 @@ const promiseWithTimeout = (timeoutMs, promise) => __awaiter(void 0, void 0, voi "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -8685,14 +9009,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.retryHttpClientResponse = exports.retryTypedResponse = exports.retry = exports.isRetryableStatusCode = exports.isServerErrorStatusCode = exports.isSuccessStatusCode = void 0; const core = __importStar(__nccwpck_require__(42186)); const http_client_1 = __nccwpck_require__(96255); const constants_1 = __nccwpck_require__(88840); @@ -8803,6 +9121,29 @@ exports.retryHttpClientResponse = retryHttpClientResponse; "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -8812,15 +9153,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -const exec_1 = __nccwpck_require__(83878); +exports.createTar = exports.extractTar = exports.listTar = void 0; +const exec_1 = __nccwpck_require__(71514); const io = __importStar(__nccwpck_require__(47351)); const fs_1 = __nccwpck_require__(57147); const path = __importStar(__nccwpck_require__(71017)); @@ -8838,7 +9173,7 @@ function getTarPath() { // Use GNUtar as default on windows return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; } - else if (fs_1.existsSync(systemTar)) { + else if ((0, fs_1.existsSync)(systemTar)) { return { path: systemTar, type: constants_1.ArchiveToolType.BSD }; } break; @@ -9016,7 +9351,7 @@ function execCommands(commands, cwd) { return __awaiter(this, void 0, void 0, function* () { for (const command of commands) { try { - yield exec_1.exec(command, undefined, { + yield (0, exec_1.exec)(command, undefined, { cwd, env: Object.assign(Object.assign({}, process.env), { MSYS: 'winsymlinks:nativestrict' }) }); @@ -9050,7 +9385,7 @@ exports.extractTar = extractTar; function createTar(archiveFolder, sourceDirectories, compressionMethod) { return __awaiter(this, void 0, void 0, function* () { // Write source directories to manifest.txt to avoid command length limits - fs_1.writeFileSync(path.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join('\n')); + (0, fs_1.writeFileSync)(path.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join('\n')); const commands = yield getCommands(compressionMethod, 'create'); yield execCommands(commands, archiveFolder); }); @@ -9065,14 +9400,31 @@ exports.createTar = createTar; "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getDownloadOptions = exports.getUploadOptions = void 0; const core = __importStar(__nccwpck_require__(42186)); /** * Returns a copy of the upload options with defaults filled in. @@ -9104,15 +9456,20 @@ exports.getUploadOptions = getUploadOptions; */ function getDownloadOptions(copy) { const result = { - useAzureSdk: true, + useAzureSdk: false, + concurrentBlobDownloads: true, downloadConcurrency: 8, timeoutInMs: 30000, - segmentTimeoutInMs: 3600000 + segmentTimeoutInMs: 600000, + lookupOnly: false }; if (copy) { if (typeof copy.useAzureSdk === 'boolean') { result.useAzureSdk = copy.useAzureSdk; } + if (typeof copy.concurrentBlobDownloads === 'boolean') { + result.concurrentBlobDownloads = copy.concurrentBlobDownloads; + } if (typeof copy.downloadConcurrency === 'number') { result.downloadConcurrency = copy.downloadConcurrency; } @@ -9122,6 +9479,9 @@ function getDownloadOptions(copy) { if (typeof copy.segmentTimeoutInMs === 'number') { result.segmentTimeoutInMs = copy.segmentTimeoutInMs; } + if (typeof copy.lookupOnly === 'boolean') { + result.lookupOnly = copy.lookupOnly; + } } const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']; if (segmentDownloadTimeoutMins && @@ -9134,6 +9494,7 @@ function getDownloadOptions(copy) { core.debug(`Request timeout (ms): ${result.timeoutInMs}`); core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`); core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); + core.debug(`Lookup only: ${result.lookupOnly}`); return result; } exports.getDownloadOptions = getDownloadOptions; @@ -9141,741 +9502,6 @@ exports.getDownloadOptions = getDownloadOptions; /***/ }), -/***/ 83878: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getExecOutput = exports.exec = void 0; -const string_decoder_1 = __nccwpck_require__(71576); -const tr = __importStar(__nccwpck_require__(18975)); -/** - * Exec a command. - * Output will be streamed to the live console. - * Returns promise with return code - * - * @param commandLine command to execute (can include additional args). Must be correctly escaped. - * @param args optional arguments for tool. Escaping is handled by the lib. - * @param options optional exec options. See ExecOptions - * @returns Promise exit code - */ -function exec(commandLine, args, options) { - return __awaiter(this, void 0, void 0, function* () { - const commandArgs = tr.argStringToArray(commandLine); - if (commandArgs.length === 0) { - throw new Error(`Parameter 'commandLine' cannot be null or empty.`); - } - // Path to tool to execute should be first arg - const toolPath = commandArgs[0]; - args = commandArgs.slice(1).concat(args || []); - const runner = new tr.ToolRunner(toolPath, args, options); - return runner.exec(); - }); -} -exports.exec = exec; -/** - * Exec a command and get the output. - * Output will be streamed to the live console. - * Returns promise with the exit code and collected stdout and stderr - * - * @param commandLine command to execute (can include additional args). Must be correctly escaped. - * @param args optional arguments for tool. Escaping is handled by the lib. - * @param options optional exec options. See ExecOptions - * @returns Promise exit code, stdout, and stderr - */ -function getExecOutput(commandLine, args, options) { - var _a, _b; - return __awaiter(this, void 0, void 0, function* () { - let stdout = ''; - let stderr = ''; - //Using string decoder covers the case where a mult-byte character is split - const stdoutDecoder = new string_decoder_1.StringDecoder('utf8'); - const stderrDecoder = new string_decoder_1.StringDecoder('utf8'); - const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout; - const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr; - const stdErrListener = (data) => { - stderr += stderrDecoder.write(data); - if (originalStdErrListener) { - originalStdErrListener(data); - } - }; - const stdOutListener = (data) => { - stdout += stdoutDecoder.write(data); - if (originalStdoutListener) { - originalStdoutListener(data); - } - }; - const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); - const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); - //flush any remaining characters - stdout += stdoutDecoder.end(); - stderr += stderrDecoder.end(); - return { - exitCode, - stdout, - stderr - }; - }); -} -exports.getExecOutput = getExecOutput; -//# sourceMappingURL=exec.js.map - -/***/ }), - -/***/ 18975: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.argStringToArray = exports.ToolRunner = void 0; -const os = __importStar(__nccwpck_require__(22037)); -const events = __importStar(__nccwpck_require__(82361)); -const child = __importStar(__nccwpck_require__(32081)); -const path = __importStar(__nccwpck_require__(71017)); -const io = __importStar(__nccwpck_require__(47351)); -const ioUtil = __importStar(__nccwpck_require__(81962)); -const timers_1 = __nccwpck_require__(39512); -/* eslint-disable @typescript-eslint/unbound-method */ -const IS_WINDOWS = process.platform === 'win32'; -/* - * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. - */ -class ToolRunner extends events.EventEmitter { - constructor(toolPath, args, options) { - super(); - if (!toolPath) { - throw new Error("Parameter 'toolPath' cannot be null or empty."); - } - this.toolPath = toolPath; - this.args = args || []; - this.options = options || {}; - } - _debug(message) { - if (this.options.listeners && this.options.listeners.debug) { - this.options.listeners.debug(message); - } - } - _getCommandString(options, noPrefix) { - const toolPath = this._getSpawnFileName(); - const args = this._getSpawnArgs(options); - let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool - if (IS_WINDOWS) { - // Windows + cmd file - if (this._isCmdFile()) { - cmd += toolPath; - for (const a of args) { - cmd += ` ${a}`; - } - } - // Windows + verbatim - else if (options.windowsVerbatimArguments) { - cmd += `"${toolPath}"`; - for (const a of args) { - cmd += ` ${a}`; - } - } - // Windows (regular) - else { - cmd += this._windowsQuoteCmdArg(toolPath); - for (const a of args) { - cmd += ` ${this._windowsQuoteCmdArg(a)}`; - } - } - } - else { - // OSX/Linux - this can likely be improved with some form of quoting. - // creating processes on Unix is fundamentally different than Windows. - // on Unix, execvp() takes an arg array. - cmd += toolPath; - for (const a of args) { - cmd += ` ${a}`; - } - } - return cmd; - } - _processLineBuffer(data, strBuffer, onLine) { - try { - let s = strBuffer + data.toString(); - let n = s.indexOf(os.EOL); - while (n > -1) { - const line = s.substring(0, n); - onLine(line); - // the rest of the string ... - s = s.substring(n + os.EOL.length); - n = s.indexOf(os.EOL); - } - return s; - } - catch (err) { - // streaming lines to console is best effort. Don't fail a build. - this._debug(`error processing line. Failed with error ${err}`); - return ''; - } - } - _getSpawnFileName() { - if (IS_WINDOWS) { - if (this._isCmdFile()) { - return process.env['COMSPEC'] || 'cmd.exe'; - } - } - return this.toolPath; - } - _getSpawnArgs(options) { - if (IS_WINDOWS) { - if (this._isCmdFile()) { - let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; - for (const a of this.args) { - argline += ' '; - argline += options.windowsVerbatimArguments - ? a - : this._windowsQuoteCmdArg(a); - } - argline += '"'; - return [argline]; - } - } - return this.args; - } - _endsWith(str, end) { - return str.endsWith(end); - } - _isCmdFile() { - const upperToolPath = this.toolPath.toUpperCase(); - return (this._endsWith(upperToolPath, '.CMD') || - this._endsWith(upperToolPath, '.BAT')); - } - _windowsQuoteCmdArg(arg) { - // for .exe, apply the normal quoting rules that libuv applies - if (!this._isCmdFile()) { - return this._uvQuoteCmdArg(arg); - } - // otherwise apply quoting rules specific to the cmd.exe command line parser. - // the libuv rules are generic and are not designed specifically for cmd.exe - // command line parser. - // - // for a detailed description of the cmd.exe command line parser, refer to - // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 - // need quotes for empty arg - if (!arg) { - return '""'; - } - // determine whether the arg needs to be quoted - const cmdSpecialChars = [ - ' ', - '\t', - '&', - '(', - ')', - '[', - ']', - '{', - '}', - '^', - '=', - ';', - '!', - "'", - '+', - ',', - '`', - '~', - '|', - '<', - '>', - '"' - ]; - let needsQuotes = false; - for (const char of arg) { - if (cmdSpecialChars.some(x => x === char)) { - needsQuotes = true; - break; - } - } - // short-circuit if quotes not needed - if (!needsQuotes) { - return arg; - } - // the following quoting rules are very similar to the rules that by libuv applies. - // - // 1) wrap the string in quotes - // - // 2) double-up quotes - i.e. " => "" - // - // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately - // doesn't work well with a cmd.exe command line. - // - // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. - // for example, the command line: - // foo.exe "myarg:""my val""" - // is parsed by a .NET console app into an arg array: - // [ "myarg:\"my val\"" ] - // which is the same end result when applying libuv quoting rules. although the actual - // command line from libuv quoting rules would look like: - // foo.exe "myarg:\"my val\"" - // - // 3) double-up slashes that precede a quote, - // e.g. hello \world => "hello \world" - // hello\"world => "hello\\""world" - // hello\\"world => "hello\\\\""world" - // hello world\ => "hello world\\" - // - // technically this is not required for a cmd.exe command line, or the batch argument parser. - // the reasons for including this as a .cmd quoting rule are: - // - // a) this is optimized for the scenario where the argument is passed from the .cmd file to an - // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. - // - // b) it's what we've been doing previously (by deferring to node default behavior) and we - // haven't heard any complaints about that aspect. - // - // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be - // escaped when used on the command line directly - even though within a .cmd file % can be escaped - // by using %%. - // - // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts - // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. - // - // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would - // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the - // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args - // to an external program. - // - // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. - // % can be escaped within a .cmd file. - let reverse = '"'; - let quoteHit = true; - for (let i = arg.length; i > 0; i--) { - // walk the string in reverse - reverse += arg[i - 1]; - if (quoteHit && arg[i - 1] === '\\') { - reverse += '\\'; // double the slash - } - else if (arg[i - 1] === '"') { - quoteHit = true; - reverse += '"'; // double the quote - } - else { - quoteHit = false; - } - } - reverse += '"'; - return reverse - .split('') - .reverse() - .join(''); - } - _uvQuoteCmdArg(arg) { - // Tool runner wraps child_process.spawn() and needs to apply the same quoting as - // Node in certain cases where the undocumented spawn option windowsVerbatimArguments - // is used. - // - // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, - // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), - // pasting copyright notice from Node within this function: - // - // Copyright Joyent, Inc. and other Node contributors. All rights reserved. - // - // Permission is hereby granted, free of charge, to any person obtaining a copy - // of this software and associated documentation files (the "Software"), to - // deal in the Software without restriction, including without limitation the - // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - // sell copies of the Software, and to permit persons to whom the Software is - // furnished to do so, subject to the following conditions: - // - // The above copyright notice and this permission notice shall be included in - // all copies or substantial portions of the Software. - // - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - // IN THE SOFTWARE. - if (!arg) { - // Need double quotation for empty argument - return '""'; - } - if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { - // No quotation needed - return arg; - } - if (!arg.includes('"') && !arg.includes('\\')) { - // No embedded double quotes or backslashes, so I can just wrap - // quote marks around the whole thing. - return `"${arg}"`; - } - // Expected input/output: - // input : hello"world - // output: "hello\"world" - // input : hello""world - // output: "hello\"\"world" - // input : hello\world - // output: hello\world - // input : hello\\world - // output: hello\\world - // input : hello\"world - // output: "hello\\\"world" - // input : hello\\"world - // output: "hello\\\\\"world" - // input : hello world\ - // output: "hello world\\" - note the comment in libuv actually reads "hello world\" - // but it appears the comment is wrong, it should be "hello world\\" - let reverse = '"'; - let quoteHit = true; - for (let i = arg.length; i > 0; i--) { - // walk the string in reverse - reverse += arg[i - 1]; - if (quoteHit && arg[i - 1] === '\\') { - reverse += '\\'; - } - else if (arg[i - 1] === '"') { - quoteHit = true; - reverse += '\\'; - } - else { - quoteHit = false; - } - } - reverse += '"'; - return reverse - .split('') - .reverse() - .join(''); - } - _cloneExecOptions(options) { - options = options || {}; - const result = { - cwd: options.cwd || process.cwd(), - env: options.env || process.env, - silent: options.silent || false, - windowsVerbatimArguments: options.windowsVerbatimArguments || false, - failOnStdErr: options.failOnStdErr || false, - ignoreReturnCode: options.ignoreReturnCode || false, - delay: options.delay || 10000 - }; - result.outStream = options.outStream || process.stdout; - result.errStream = options.errStream || process.stderr; - return result; - } - _getSpawnOptions(options, toolPath) { - options = options || {}; - const result = {}; - result.cwd = options.cwd; - result.env = options.env; - result['windowsVerbatimArguments'] = - options.windowsVerbatimArguments || this._isCmdFile(); - if (options.windowsVerbatimArguments) { - result.argv0 = `"${toolPath}"`; - } - return result; - } - /** - * Exec a tool. - * Output will be streamed to the live console. - * Returns promise with return code - * - * @param tool path to tool to exec - * @param options optional exec options. See ExecOptions - * @returns number - */ - exec() { - return __awaiter(this, void 0, void 0, function* () { - // root the tool path if it is unrooted and contains relative pathing - if (!ioUtil.isRooted(this.toolPath) && - (this.toolPath.includes('/') || - (IS_WINDOWS && this.toolPath.includes('\\')))) { - // prefer options.cwd if it is specified, however options.cwd may also need to be rooted - this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); - } - // if the tool is only a file name, then resolve it from the PATH - // otherwise verify it exists (add extension on Windows if necessary) - this.toolPath = yield io.which(this.toolPath, true); - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - this._debug(`exec tool: ${this.toolPath}`); - this._debug('arguments:'); - for (const arg of this.args) { - this._debug(` ${arg}`); - } - const optionsNonNull = this._cloneExecOptions(this.options); - if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); - } - const state = new ExecState(optionsNonNull, this.toolPath); - state.on('debug', (message) => { - this._debug(message); - }); - if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) { - return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`)); - } - const fileName = this._getSpawnFileName(); - const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); - let stdbuffer = ''; - if (cp.stdout) { - cp.stdout.on('data', (data) => { - if (this.options.listeners && this.options.listeners.stdout) { - this.options.listeners.stdout(data); - } - if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(data); - } - stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => { - if (this.options.listeners && this.options.listeners.stdline) { - this.options.listeners.stdline(line); - } - }); - }); - } - let errbuffer = ''; - if (cp.stderr) { - cp.stderr.on('data', (data) => { - state.processStderr = true; - if (this.options.listeners && this.options.listeners.stderr) { - this.options.listeners.stderr(data); - } - if (!optionsNonNull.silent && - optionsNonNull.errStream && - optionsNonNull.outStream) { - const s = optionsNonNull.failOnStdErr - ? optionsNonNull.errStream - : optionsNonNull.outStream; - s.write(data); - } - errbuffer = this._processLineBuffer(data, errbuffer, (line) => { - if (this.options.listeners && this.options.listeners.errline) { - this.options.listeners.errline(line); - } - }); - }); - } - cp.on('error', (err) => { - state.processError = err.message; - state.processExited = true; - state.processClosed = true; - state.CheckComplete(); - }); - cp.on('exit', (code) => { - state.processExitCode = code; - state.processExited = true; - this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); - state.CheckComplete(); - }); - cp.on('close', (code) => { - state.processExitCode = code; - state.processExited = true; - state.processClosed = true; - this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); - state.CheckComplete(); - }); - state.on('done', (error, exitCode) => { - if (stdbuffer.length > 0) { - this.emit('stdline', stdbuffer); - } - if (errbuffer.length > 0) { - this.emit('errline', errbuffer); - } - cp.removeAllListeners(); - if (error) { - reject(error); - } - else { - resolve(exitCode); - } - }); - if (this.options.input) { - if (!cp.stdin) { - throw new Error('child process missing stdin'); - } - cp.stdin.end(this.options.input); - } - })); - }); - } -} -exports.ToolRunner = ToolRunner; -/** - * Convert an arg string to an array of args. Handles escaping - * - * @param argString string of arguments - * @returns string[] array of arguments - */ -function argStringToArray(argString) { - const args = []; - let inQuotes = false; - let escaped = false; - let arg = ''; - function append(c) { - // we only escape double quotes. - if (escaped && c !== '"') { - arg += '\\'; - } - arg += c; - escaped = false; - } - for (let i = 0; i < argString.length; i++) { - const c = argString.charAt(i); - if (c === '"') { - if (!escaped) { - inQuotes = !inQuotes; - } - else { - append(c); - } - continue; - } - if (c === '\\' && escaped) { - append(c); - continue; - } - if (c === '\\' && inQuotes) { - escaped = true; - continue; - } - if (c === ' ' && !inQuotes) { - if (arg.length > 0) { - args.push(arg); - arg = ''; - } - continue; - } - append(c); - } - if (arg.length > 0) { - args.push(arg.trim()); - } - return args; -} -exports.argStringToArray = argStringToArray; -class ExecState extends events.EventEmitter { - constructor(options, toolPath) { - super(); - this.processClosed = false; // tracks whether the process has exited and stdio is closed - this.processError = ''; - this.processExitCode = 0; - this.processExited = false; // tracks whether the process has exited - this.processStderr = false; // tracks whether stderr was written to - this.delay = 10000; // 10 seconds - this.done = false; - this.timeout = null; - if (!toolPath) { - throw new Error('toolPath must not be empty'); - } - this.options = options; - this.toolPath = toolPath; - if (options.delay) { - this.delay = options.delay; - } - } - CheckComplete() { - if (this.done) { - return; - } - if (this.processClosed) { - this._setResult(); - } - else if (this.processExited) { - this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this); - } - } - _debug(message) { - this.emit('debug', message); - } - _setResult() { - // determine whether there is an error - let error; - if (this.processExited) { - if (this.processError) { - error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); - } - else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { - error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); - } - else if (this.processStderr && this.options.failOnStdErr) { - error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); - } - } - // clear the timeout - if (this.timeout) { - clearTimeout(this.timeout); - this.timeout = null; - } - this.done = true; - this.emit('done', error, this.processExitCode); - } - static HandleTimeout(state) { - if (state.done) { - return; - } - if (!state.processClosed && state.processExited) { - const message = `The STDIO streams did not close within ${state.delay / - 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; - state._debug(message); - } - state._setResult(); - } -} -//# sourceMappingURL=toolrunner.js.map - -/***/ }), - /***/ 3771: /***/ ((module, exports) => { @@ -9907,8 +9533,11 @@ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || // Max safe segment length for coercion. var MAX_SAFE_COMPONENT_LENGTH = 16 +var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 + // The actual regexps go on exports.re var re = exports.re = [] +var safeRe = exports.safeRe = [] var src = exports.src = [] var t = exports.tokens = {} var R = 0 @@ -9917,6 +9546,31 @@ function tok (n) { t[n] = R++ } +var LETTERDASHNUMBER = '[a-zA-Z0-9-]' + +// Replace some greedy regex tokens to prevent regex dos issues. These regex are +// used internally via the safeRe object since all inputs in this library get +// normalized first to trim and collapse all extra whitespace. The original +// regexes are exported for userland consumption and lower level usage. A +// future breaking change could export the safer regex only with a note that +// all input should have extra whitespace removed. +var safeRegexReplacements = [ + ['\\s', 1], + ['\\d', MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], +] + +function makeSafeRe (value) { + for (var i = 0; i < safeRegexReplacements.length; i++) { + var token = safeRegexReplacements[i][0] + var max = safeRegexReplacements[i][1] + value = value + .split(token + '*').join(token + '{0,' + max + '}') + .split(token + '+').join(token + '{1,' + max + '}') + } + return value +} + // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. @@ -9926,14 +9580,14 @@ function tok (n) { tok('NUMERICIDENTIFIER') src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' tok('NUMERICIDENTIFIERLOOSE') -src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+' +src[t.NUMERICIDENTIFIERLOOSE] = '\\d+' // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. tok('NONNUMERICIDENTIFIER') -src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' +src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*' // ## Main Version // Three dot-separated numeric identifiers. @@ -9975,7 +9629,7 @@ src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + // Any combination of digits, letters, or hyphens. tok('BUILDIDENTIFIER') -src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+' +src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+' // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata @@ -10055,6 +9709,7 @@ src[t.COERCE] = '(^|[^\\d])' + '(?:$|[^\\d])' tok('COERCERTL') re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g') +safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g') // Tilde ranges. // Meaning is "reasonably at or greater than" @@ -10064,6 +9719,7 @@ src[t.LONETILDE] = '(?:~>?)' tok('TILDETRIM') src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') +safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g') var tildeTrimReplace = '$1~' tok('TILDE') @@ -10079,6 +9735,7 @@ src[t.LONECARET] = '(?:\\^)' tok('CARETTRIM') src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') +safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g') var caretTrimReplace = '$1^' tok('CARET') @@ -10100,6 +9757,7 @@ src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + // this one has to use the /g flag re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') +safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g') var comparatorTrimReplace = '$1$2$3' // Something like `1.2.3 - 1.2.4` @@ -10128,6 +9786,14 @@ for (var i = 0; i < R; i++) { debug(i, src[i]) if (!re[i]) { re[i] = new RegExp(src[i]) + + // Replace all greedy whitespace to prevent regex dos issues. These regex are + // used internally via the safeRe object since all inputs in this library get + // normalized first to trim and collapse all extra whitespace. The original + // regexes are exported for userland consumption and lower level usage. A + // future breaking change could export the safer regex only with a note that + // all input should have extra whitespace removed. + safeRe[i] = new RegExp(makeSafeRe(src[i])) } } @@ -10152,7 +9818,7 @@ function parse (version, options) { return null } - var r = options.loose ? re[t.LOOSE] : re[t.FULL] + var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL] if (!r.test(version)) { return null } @@ -10207,7 +9873,7 @@ function SemVer (version, options) { this.options = options this.loose = !!options.loose - var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) + var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]) if (!m) { throw new TypeError('Invalid Version: ' + version) @@ -10652,6 +10318,7 @@ function Comparator (comp, options) { return new Comparator(comp, options) } + comp = comp.trim().split(/\s+/).join(' ') debug('comparator', comp, options) this.options = options this.loose = !!options.loose @@ -10668,7 +10335,7 @@ function Comparator (comp, options) { var ANY = {} Comparator.prototype.parse = function (comp) { - var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] var m = comp.match(r) if (!m) { @@ -10792,9 +10459,16 @@ function Range (range, options) { this.loose = !!options.loose this.includePrerelease = !!options.includePrerelease - // First, split based on boolean or || + // First reduce all whitespace as much as possible so we do not have to rely + // on potentially slow regexes like \s*. This is then stored and used for + // future error messages as well. this.raw = range - this.set = range.split(/\s*\|\|\s*/).map(function (range) { + .trim() + .split(/\s+/) + .join(' ') + + // First, split based on boolean or || + this.set = this.raw.split('||').map(function (range) { return this.parseRange(range.trim()) }, this).filter(function (c) { // throw out any that are not relevant for whatever reason @@ -10802,7 +10476,7 @@ function Range (range, options) { }) if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range) + throw new TypeError('Invalid SemVer Range: ' + this.raw) } this.format() @@ -10821,20 +10495,19 @@ Range.prototype.toString = function () { Range.prototype.parseRange = function (range) { var loose = this.options.loose - range = range.trim() // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] + var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE] range = range.replace(hr, hyphenReplace) debug('hyphen replace', range) // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range, re[t.COMPARATORTRIM]) + range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, safeRe[t.COMPARATORTRIM]) // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[t.TILDETRIM], tildeTrimReplace) + range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace) // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[t.CARETTRIM], caretTrimReplace) + range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace) // normalize spaces range = range.split(/\s+/).join(' ') @@ -10842,7 +10515,7 @@ Range.prototype.parseRange = function (range) { // At this point, the range is completely trimmed and // ready to be split into comparators. - var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] var set = range.split(' ').map(function (comp) { return parseComparator(comp, this.options) }, this).join(' ').split(/\s+/) @@ -10942,7 +10615,7 @@ function replaceTildes (comp, options) { } function replaceTilde (comp, options) { - var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] + var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE] return comp.replace(r, function (_, M, m, p, pr) { debug('tilde', comp, _, M, m, p, pr) var ret @@ -10983,7 +10656,7 @@ function replaceCarets (comp, options) { function replaceCaret (comp, options) { debug('caret', comp, options) - var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET] return comp.replace(r, function (_, M, m, p, pr) { debug('caret', comp, _, M, m, p, pr) var ret @@ -11042,7 +10715,7 @@ function replaceXRanges (comp, options) { function replaceXRange (comp, options) { comp = comp.trim() - var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] + var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE] return comp.replace(r, function (ret, gtlt, M, m, p, pr) { debug('xRange', comp, ret, gtlt, M, m, p, pr) var xM = isX(M) @@ -11117,7 +10790,7 @@ function replaceXRange (comp, options) { function replaceStars (comp, options) { debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[t.STAR], '') + return comp.trim().replace(safeRe[t.STAR], '') } // This function is passed to string.replace(re[t.HYPHENRANGE]) @@ -11443,7 +11116,7 @@ function coerce (version, options) { var match = null if (!options.rtl) { - match = version.match(re[t.COERCE]) + match = version.match(safeRe[t.COERCE]) } else { // Find the right-most coercible string that does not share // a terminus with a more left-ward coercible string. @@ -11454,17 +11127,17 @@ function coerce (version, options) { // Stop when we get a match that ends at the string end, since no // coercible string can be more right-ward without the same terminus. var next - while ((next = re[t.COERCERTL].exec(version)) && + while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length) ) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next } - re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length } // leave it in a clean state - re[t.COERCERTL].lastIndex = -1 + safeRe[t.COERCERTL].lastIndex = -1 } if (match === null) { @@ -15348,6 +15021,19 @@ class HttpClientResponse { })); }); } + readBodyBuffer() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { + const chunks = []; + this.message.on('data', (chunk) => { + chunks.push(chunk); + }); + this.message.on('end', () => { + resolve(Buffer.concat(chunks)); + }); + })); + }); + } } exports.HttpClientResponse = HttpClientResponse; function isHttps(requestUrl) { @@ -15852,7 +15538,13 @@ function getProxyUrl(reqUrl) { } })(); if (proxyVar) { - return new URL(proxyVar); + try { + return new URL(proxyVar); + } + catch (_a) { + if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) + return new URL(`http://${proxyVar}`); + } } else { return undefined; @@ -15863,6 +15555,10 @@ function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; } + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; + } const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; if (!noProxy) { return false; @@ -15888,13 +15584,24 @@ function checkBypass(reqUrl) { .split(',') .map(x => x.trim().toUpperCase()) .filter(x => x)) { - if (upperReqHosts.some(x => x === upperNoProxyItem)) { + if (upperNoProxyItem === '*' || + upperReqHosts.some(x => x === upperNoProxyItem || + x.endsWith(`.${upperNoProxyItem}`) || + (upperNoProxyItem.startsWith('.') && + x.endsWith(`${upperNoProxyItem}`)))) { return true; } } return false; } exports.checkBypass = checkBypass; +function isLoopbackAddress(host) { + const hostLower = host.toLowerCase(); + return (hostLower === 'localhost' || + hostLower.startsWith('127.') || + hostLower.startsWith('[::1]') || + hostLower.startsWith('[0:0:0:0:0:0:0:1]')); +} //# sourceMappingURL=proxy.js.map /***/ }), @@ -15904,6 +15611,25 @@ exports.checkBypass = checkBypass; "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -15913,20 +15639,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); -const assert_1 = __nccwpck_require__(39491); +exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; const fs = __importStar(__nccwpck_require__(57147)); const path = __importStar(__nccwpck_require__(71017)); -_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; +_a = fs.promises +// export const {open} = 'fs' +, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; +// export const {open} = 'fs' exports.IS_WINDOWS = process.platform === 'win32'; +// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691 +exports.UV_FS_O_EXLOCK = 0x10000000; +exports.READONLY = fs.constants.O_RDONLY; function exists(fsPath) { return __awaiter(this, void 0, void 0, function* () { try { @@ -15965,49 +15690,6 @@ function isRooted(p) { return p.startsWith('/'); } exports.isRooted = isRooted; -/** - * Recursively create a directory at `fsPath`. - * - * This implementation is optimistic, meaning it attempts to create the full - * path first, and backs up the path stack from there. - * - * @param fsPath The path to create - * @param maxDepth The maximum recursion depth - * @param depth The current recursion depth - */ -function mkdirP(fsPath, maxDepth = 1000, depth = 1) { - return __awaiter(this, void 0, void 0, function* () { - assert_1.ok(fsPath, 'a path argument must be provided'); - fsPath = path.resolve(fsPath); - if (depth >= maxDepth) - return exports.mkdir(fsPath); - try { - yield exports.mkdir(fsPath); - return; - } - catch (err) { - switch (err.code) { - case 'ENOENT': { - yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1); - yield exports.mkdir(fsPath); - return; - } - default: { - let stats; - try { - stats = yield exports.stat(fsPath); - } - catch (err2) { - throw err; - } - if (!stats.isDirectory()) - throw err; - } - } - } - }); -} -exports.mkdirP = mkdirP; /** * Best effort attempt to determine whether a file exists and is executable. * @param filePath file path to check @@ -16104,6 +15786,12 @@ function isUnixExecutable(stats) { ((stats.mode & 8) > 0 && stats.gid === process.getgid()) || ((stats.mode & 64) > 0 && stats.uid === process.getuid())); } +// Get the path of cmd.exe in windows +function getCmdPath() { + var _a; + return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`; +} +exports.getCmdPath = getCmdPath; //# sourceMappingURL=io-util.js.map /***/ }), @@ -16113,6 +15801,25 @@ function isUnixExecutable(stats) { "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -16122,19 +15829,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -const childProcess = __importStar(__nccwpck_require__(32081)); +exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; +const assert_1 = __nccwpck_require__(39491); const path = __importStar(__nccwpck_require__(71017)); -const util_1 = __nccwpck_require__(73837); const ioUtil = __importStar(__nccwpck_require__(81962)); -const exec = util_1.promisify(childProcess.exec); /** * Copies a file or folder. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js @@ -16145,14 +15844,14 @@ const exec = util_1.promisify(childProcess.exec); */ function cp(source, dest, options = {}) { return __awaiter(this, void 0, void 0, function* () { - const { force, recursive } = readCopyOptions(options); + const { force, recursive, copySourceDirectory } = readCopyOptions(options); const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; // Dest is an existing file, but not forcing if (destStat && destStat.isFile() && !force) { return; } // If dest is an existing directory, should copy inside. - const newDest = destStat && destStat.isDirectory() + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path.join(dest, path.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { @@ -16215,51 +15914,23 @@ exports.mv = mv; function rmRF(inputPath) { return __awaiter(this, void 0, void 0, function* () { if (ioUtil.IS_WINDOWS) { - // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another - // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del. - try { - if (yield ioUtil.isDirectory(inputPath, true)) { - yield exec(`rd /s /q "${inputPath}"`); - } - else { - yield exec(`del /f /a "${inputPath}"`); - } - } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; - } - // Shelling out fails to remove a symlink folder with missing source, this unlink catches that - try { - yield ioUtil.unlink(inputPath); - } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; + // Check for invalid characters + // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file + if (/[*"<>|]/.test(inputPath)) { + throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); } } - else { - let isDir = false; - try { - isDir = yield ioUtil.isDirectory(inputPath); - } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; - return; - } - if (isDir) { - yield exec(`rm -rf "${inputPath}"`); - } - else { - yield ioUtil.unlink(inputPath); - } + try { + // note if path does not exist, error is silent + yield ioUtil.rm(inputPath, { + force: true, + maxRetries: 3, + recursive: true, + retryDelay: 300 + }); + } + catch (err) { + throw new Error(`File was unable to be removed ${err}`); } }); } @@ -16273,7 +15944,8 @@ exports.rmRF = rmRF; */ function mkdirP(fsPath) { return __awaiter(this, void 0, void 0, function* () { - yield ioUtil.mkdirP(fsPath); + assert_1.ok(fsPath, 'a path argument must be provided'); + yield ioUtil.mkdir(fsPath, { recursive: true }); }); } exports.mkdirP = mkdirP; @@ -16371,7 +16043,10 @@ exports.findInPath = findInPath; function readCopyOptions(options) { const force = options.force == null ? true : options.force; const recursive = Boolean(options.recursive); - return { force, recursive }; + const copySourceDirectory = options.copySourceDirectory == null + ? true + : Boolean(options.copySourceDirectory); + return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { return __awaiter(this, void 0, void 0, function* () { @@ -16675,13 +16350,15 @@ exports.AbortSignal = AbortSignal; /***/ }), /***/ 39645: -/***/ ((__unused_webpack_module, exports) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +var coreUtil = __nccwpck_require__(51333); + // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. /** @@ -16689,6 +16366,12 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * the underlying key value. */ class AzureKeyCredential { + /** + * The value of the key to be used in authentication + */ + get key() { + return this._key; + } /** * Create an instance of an AzureKeyCredential for use * with a service client. @@ -16701,12 +16384,6 @@ class AzureKeyCredential { } this._key = key; } - /** - * The value of the key to be used in authentication - */ - get key() { - return this._key; - } /** * Change the value of the key. * @@ -16720,51 +16397,24 @@ class AzureKeyCredential { } } -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Helper TypeGuard that checks if something is defined or not. - * @param thing - Anything - * @internal - */ -function isDefined(thing) { - return typeof thing !== "undefined" && thing !== null; -} -/** - * Helper TypeGuard that checks if the input is an object with the specified properties. - * Note: The properties may be inherited. - * @param thing - Anything. - * @param properties - The name of the properties that should appear in the object. - * @internal - */ -function isObjectWithProperties(thing, properties) { - if (!isDefined(thing) || typeof thing !== "object") { - return false; - } - for (const property of properties) { - if (!objectHasProperty(thing, property)) { - return false; - } - } - return true; -} -/** - * Helper TypeGuard that checks if the input is an object with the specified property. - * Note: The property may be inherited. - * @param thing - Any object. - * @param property - The name of the property that should appear in the object. - * @internal - */ -function objectHasProperty(thing, property) { - return typeof thing === "object" && property in thing; -} - // Copyright (c) Microsoft Corporation. /** * A static name/key-based credential that supports updating * the underlying name and key values. */ class AzureNamedKeyCredential { + /** + * The value of the key to be used in authentication. + */ + get key() { + return this._key; + } + /** + * The value of the name to be used in authentication. + */ + get name() { + return this._name; + } /** * Create an instance of an AzureNamedKeyCredential for use * with a service client. @@ -16779,18 +16429,6 @@ class AzureNamedKeyCredential { this._name = name; this._key = key; } - /** - * The value of the key to be used in authentication. - */ - get key() { - return this._key; - } - /** - * The value of the name to be used in authentication. - */ - get name() { - return this._name; - } /** * Change the value of the key. * @@ -16814,7 +16452,7 @@ class AzureNamedKeyCredential { * @param credential - The assumed NamedKeyCredential to be tested. */ function isNamedKeyCredential(credential) { - return (isObjectWithProperties(credential, ["name", "key"]) && + return (coreUtil.isObjectWithProperties(credential, ["name", "key"]) && typeof credential.key === "string" && typeof credential.name === "string"); } @@ -16825,6 +16463,12 @@ function isNamedKeyCredential(credential) { * the underlying signature value. */ class AzureSASCredential { + /** + * The value of the shared access signature to be used in authentication + */ + get signature() { + return this._signature; + } /** * Create an instance of an AzureSASCredential for use * with a service client. @@ -16837,12 +16481,6 @@ class AzureSASCredential { } this._signature = signature; } - /** - * The value of the shared access signature to be used in authentication - */ - get signature() { - return this._signature; - } /** * Change the value of the signature. * @@ -16864,7 +16502,7 @@ class AzureSASCredential { * @param credential - The assumed SASCredential to be tested. */ function isSASCredential(credential) { - return (isObjectWithProperties(credential, ["signature"]) && typeof credential.signature === "string"); + return (coreUtil.isObjectWithProperties(credential, ["signature"]) && typeof credential.signature === "string"); } // Copyright (c) Microsoft Corporation. @@ -16915,7 +16553,6 @@ var coreAuth = __nccwpck_require__(39645); var os = __nccwpck_require__(22037); var http = __nccwpck_require__(13685); var https = __nccwpck_require__(95687); -var tough = __nccwpck_require__(47372); var abortController = __nccwpck_require__(52557); var tunnel = __nccwpck_require__(74294); var stream = __nccwpck_require__(12781); @@ -16947,7 +16584,6 @@ var xml2js__namespace = /*#__PURE__*/_interopNamespace(xml2js); var os__namespace = /*#__PURE__*/_interopNamespace(os); var http__namespace = /*#__PURE__*/_interopNamespace(http); var https__namespace = /*#__PURE__*/_interopNamespace(https); -var tough__namespace = /*#__PURE__*/_interopNamespace(tough); var tunnel__namespace = /*#__PURE__*/_interopNamespace(tunnel); var FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData); var node_fetch__default = /*#__PURE__*/_interopDefaultLegacy(node_fetch); @@ -17139,7 +16775,7 @@ const Constants = { /** * The core-http version */ - coreHttpVersion: "2.3.1", + coreHttpVersion: "3.0.2", /** * Specifies HTTP. */ @@ -17217,13 +16853,6 @@ const XML_CHARKEY = "_"; // Copyright (c) Microsoft Corporation. const validUuidRegex = /^[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}$/i; -/** - * A constant that indicates whether the environment is node.js or browser based. - */ -const isNode = typeof process !== "undefined" && - !!process.version && - !!process.versions && - !!process.versions.node; /** * Encodes an URI. * @@ -18118,10 +17747,12 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName, const wrapped = responseBody[xmlName]; const elementList = (_b = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b !== void 0 ? _b : []; instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName, options); + handledPropertyNames.push(xmlName); } else { const property = responseBody[propertyName]; instance[key] = serializer.deserialize(propertyMapper, property, propertyObjectName, options); + handledPropertyNames.push(propertyName); } } } @@ -19454,7 +19085,6 @@ class NodeFetchHttpClient { // a mapping of proxy settings string `${host}:${port}:${username}:${password}` to agent this.proxyAgentMap = new Map(); this.keepAliveAgents = {}; - this.cookieJar = new tough__namespace.CookieJar(undefined, { looseMode: true }); } /** * Provides minimum viable error handling and the logic that executes the abstract methods. @@ -19671,43 +19301,16 @@ class NodeFetchHttpClient { */ async prepareRequest(httpRequest) { const requestInit = {}; - if (this.cookieJar && !httpRequest.headers.get("Cookie")) { - const cookieString = await new Promise((resolve, reject) => { - this.cookieJar.getCookieString(httpRequest.url, (err, cookie) => { - if (err) { - reject(err); - } - else { - resolve(cookie); - } - }); - }); - httpRequest.headers.set("Cookie", cookieString); - } // Set the http(s) agent requestInit.agent = this.getOrCreateAgent(httpRequest); requestInit.compress = httpRequest.decompressResponse; return requestInit; } /** - * Process an HTTP response. Handles persisting a cookie for subsequent requests if the response has a "Set-Cookie" header. + * Process an HTTP response. */ - async processRequest(operationResponse) { - if (this.cookieJar) { - const setCookieHeader = operationResponse.headers.get("Set-Cookie"); - if (setCookieHeader !== undefined) { - await new Promise((resolve, reject) => { - this.cookieJar.setCookie(setCookieHeader, operationResponse.request.url, { ignoreError: true }, (err) => { - if (err) { - reject(err); - } - else { - resolve(); - } - }); - }); - } - } + async processRequest(_operationResponse) { + /* no_op */ } } @@ -21930,7 +21533,7 @@ function createDefaultRequestPolicyFactories(authPolicyFactory, options) { factories.push(throttlingRetryPolicy()); } factories.push(deserializationPolicy(options.deserializationContentTypes)); - if (isNode) { + if (coreUtil.isNode) { factories.push(proxyPolicy(options.proxySettings)); } factories.push(logPolicy({ logger: logger.info })); @@ -21962,7 +21565,7 @@ function createPipelineFromOptions(pipelineOptions, authPolicyFactory) { const keepAliveOptions = Object.assign(Object.assign({}, DefaultKeepAliveOptions), pipelineOptions.keepAliveOptions); const retryOptions = Object.assign(Object.assign({}, DefaultRetryOptions), pipelineOptions.retryOptions); const redirectOptions = Object.assign(Object.assign({}, DefaultRedirectOptions), pipelineOptions.redirectOptions); - if (isNode) { + if (coreUtil.isNode) { requestPolicyFactories.push(proxyPolicy(pipelineOptions.proxyOptions)); } const deserializationOptions = Object.assign(Object.assign({}, DefaultDeserializationOptions), pipelineOptions.deserializationOptions); @@ -21975,7 +21578,7 @@ function createPipelineFromOptions(pipelineOptions, authPolicyFactory) { requestPolicyFactories.push(authPolicyFactory); } requestPolicyFactories.push(logPolicy(loggingOptions)); - if (isNode && pipelineOptions.decompressResponse === false) { + if (coreUtil.isNode && pipelineOptions.decompressResponse === false) { requestPolicyFactories.push(disableResponseDecompressionPolicy()); } return { @@ -22106,10 +21709,7 @@ function flattenResponse(_response, responseSpec) { } function getCredentialScopes(options, baseUri) { if (options === null || options === void 0 ? void 0 : options.credentialScopes) { - const scopes = options.credentialScopes; - return Array.isArray(scopes) - ? scopes.map((scope) => new URL(scope).toString()) - : new URL(scopes).toString(); + return options.credentialScopes; } if (baseUri) { return `${baseUri}/.default`; @@ -22342,6 +21942,10 @@ Object.defineProperty(exports, "delay", ({ enumerable: true, get: function () { return coreUtil.delay; } })); +Object.defineProperty(exports, "isNode", ({ + enumerable: true, + get: function () { return coreUtil.isNode; } +})); Object.defineProperty(exports, "isTokenCredential", ({ enumerable: true, get: function () { return coreAuth.isTokenCredential; } @@ -22381,7 +21985,6 @@ exports.generateUuid = generateUuid; exports.getDefaultProxySettings = getDefaultProxySettings; exports.getDefaultUserAgentValue = getDefaultUserAgentValue; exports.isDuration = isDuration; -exports.isNode = isNode; exports.isValidUuid = isValidUuid; exports.keepAlivePolicy = keepAlivePolicy; exports.logPolicy = logPolicy; @@ -23586,6 +23189,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); var logger$1 = __nccwpck_require__(3233); var abortController = __nccwpck_require__(52557); +var coreUtil = __nccwpck_require__(51333); // Copyright (c) Microsoft Corporation. /** @@ -23627,16 +23231,45 @@ function setStateError(inputs) { throw error; }; } +function appendReadableErrorMessage(currentMessage, innerMessage) { + let message = currentMessage; + if (message.slice(-1) !== ".") { + message = message + "."; + } + return message + " " + innerMessage; +} +function simplifyError(err) { + let message = err.message; + let code = err.code; + let curErr = err; + while (curErr.innererror) { + curErr = curErr.innererror; + code = curErr.code; + message = appendReadableErrorMessage(message, curErr.message); + } + return { + code, + message, + }; +} function processOperationStatus(result) { - const { state, stateProxy, status, isDone, processResult, response, setErrorAsResult } = result; + const { state, stateProxy, status, isDone, processResult, getError, response, setErrorAsResult } = result; switch (status) { case "succeeded": { stateProxy.setSucceeded(state); break; } case "failed": { - stateProxy.setError(state, new Error(`The long-running operation has failed`)); + const err = getError === null || getError === void 0 ? void 0 : getError(response); + let postfix = ""; + if (err) { + const { code, message } = simplifyError(err); + postfix = `. ${code}. ${message}`; + } + const errStr = `The long-running operation has failed${postfix}`; + stateProxy.setError(state, new Error(errStr)); stateProxy.setFailed(state); + logger.warning(errStr); break; } case "canceled": { @@ -23699,7 +23332,7 @@ async function pollOperationHelper(inputs) { } /** Polls the long-running operation. */ async function pollOperation(inputs) { - const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, isOperationError, withOperationLocation, getPollingInterval, processResult, updateState, setDelay, isDone, setErrorAsResult, } = inputs; + const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, isOperationError, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult, } = inputs; const { operationLocation } = state.config; if (operationLocation !== undefined) { const { response, status } = await pollOperationHelper({ @@ -23719,6 +23352,7 @@ async function pollOperation(inputs) { stateProxy, isDone, processResult, + getError, setErrorAsResult, }); if (!terminalStates.includes(status)) { @@ -23753,6 +23387,7 @@ function getAzureAsyncOperationHeader(rawResponse) { return rawResponse.headers["azure-asyncoperation"]; } function findResourceLocation(inputs) { + var _a; const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; switch (requestMethod) { case "PUT": { @@ -23761,18 +23396,24 @@ function findResourceLocation(inputs) { case "DELETE": { return undefined; } + case "PATCH": { + return (_a = getDefault()) !== null && _a !== void 0 ? _a : requestPath; + } default: { - switch (resourceLocationConfig) { - case "azure-async-operation": { - return undefined; - } - case "original-uri": { - return requestPath; - } - case "location": - default: { - return location; - } + return getDefault(); + } + } + function getDefault() { + switch (resourceLocationConfig) { + case "azure-async-operation": { + return undefined; + } + case "original-uri": { + return requestPath; + } + case "location": + default: { + return location; } } } @@ -23834,7 +23475,7 @@ function transformStatus(inputs) { case "cancelled": return "canceled"; default: { - logger.warning(`LRO: unrecognized operation status: ${status}`); + logger.verbose(`LRO: unrecognized operation status: ${status}`); return status; } } @@ -23872,6 +23513,18 @@ function parseRetryAfter({ rawResponse }) { } return undefined; } +function getErrorFromResponse(response) { + const error = response.flatResponse.error; + if (!error) { + logger.warning(`The long-running operation failed but there is no error property in the response's body`); + return; + } + if (!error.code || !error.message) { + logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); + return; + } + return error; +} function calculatePollingIntervalFromDate(retryAfterDate) { const timeNow = Math.floor(new Date().getTime()); const retryAfterTime = retryAfterDate.getTime(); @@ -23979,6 +23632,7 @@ async function pollHttpOperation(inputs) { processResult: processResult ? ({ flatResponse }, inputState) => processResult(flatResponse, inputState) : ({ flatResponse }) => flatResponse, + getError: getErrorFromResponse, updateState, getPollingInterval: parseRetryAfter, getOperationLocation, @@ -23995,58 +23649,6 @@ async function pollHttpOperation(inputs) { }); } -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Map an optional value through a function - * @internal - */ -const maybemap = (value, f) => value === undefined ? undefined : f(value); -const INTERRUPTED = new Error("The poller is already stopped"); -/** - * A promise that delays resolution until a certain amount of time (in milliseconds) has passed, with facilities for - * robust cancellation. - * - * ### Example: - * - * ```javascript - * let toCancel; - * - * // Wait 20 seconds, and optionally allow the function to be cancelled. - * await delayMs(20000, (cancel) => { toCancel = cancel }); - * - * // ... if `toCancel` is called before the 20 second timer expires, then the delayMs promise will reject. - * ``` - * - * @internal - * @param ms - the number of milliseconds to wait before resolving - * @param cb - a callback that can provide the caller with a cancellation function - */ -function delayMs(ms) { - let aborted = false; - let toReject; - return Object.assign(new Promise((resolve, reject) => { - let token; - toReject = () => { - maybemap(token, clearTimeout); - reject(INTERRUPTED); - }; - // In the rare case that the operation is _already_ aborted, we will reject instantly. This could happen, for - // example, if the user calls the cancellation function immediately without yielding execution. - if (aborted) { - toReject(); - } - else { - token = setTimeout(resolve, ms); - } - }), { - cancel: () => { - aborted = true; - toReject === null || toReject === void 0 ? void 0 : toReject(); - }, - }); -} - // Copyright (c) Microsoft Corporation. const createStateProxy$1 = () => ({ /** @@ -24072,7 +23674,7 @@ const createStateProxy$1 = () => ({ * Returns a poller factory. */ function buildCreatePoller(inputs) { - const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, isOperationError, getResourceLocation, getPollingInterval, resolveOnUnsuccessful, } = inputs; + const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, isOperationError, getResourceLocation, getPollingInterval, getError, resolveOnUnsuccessful, } = inputs; return async ({ init, poll }, options) => { const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom, } = options || {}; const stateProxy = createStateProxy$1(); @@ -24099,7 +23701,6 @@ function buildCreatePoller(inputs) { setErrorAsResult: !resolveOnUnsuccessful, }); let resultPromise; - let cancelJob; const abortController$1 = new abortController.AbortController(); const handlers = new Map(); const handleProgressEvents = async () => handlers.forEach((h) => h(state)); @@ -24112,7 +23713,6 @@ function buildCreatePoller(inputs) { isStopped: () => resultPromise === undefined, stopPolling: () => { abortController$1.abort(); - cancelJob === null || cancelJob === void 0 ? void 0 : cancelJob(); }, toString: () => JSON.stringify({ state, @@ -24130,9 +23730,7 @@ function buildCreatePoller(inputs) { if (!poller.isDone()) { await poller.poll({ abortSignal }); while (!poller.isDone()) { - const delay = delayMs(currentPollIntervalInMs); - cancelJob = delay.cancel; - await delay; + await coreUtil.delay(currentPollIntervalInMs, { abortSignal }); await poller.poll({ abortSignal }); } } @@ -24181,6 +23779,7 @@ function buildCreatePoller(inputs) { getOperationStatus: getStatusFromPollResponse, getResourceLocation, processResult, + getError, updateState, options: pollOptions, setDelay: (pollIntervalInMs) => { @@ -24219,6 +23818,7 @@ async function createHttpPoller(lro, options) { getOperationLocation, getResourceLocation, getPollingInterval: parseRetryAfter, + getError: getErrorFromResponse, resolveOnUnsuccessful, })({ init: async () => { @@ -25106,49 +24706,47 @@ var abortController = __nccwpck_require__(52557); var crypto = __nccwpck_require__(6113); // Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -var _a; /** - * A constant that indicates whether the environment the code is running is Node.JS. + * Creates an abortable promise. + * @param buildPromise - A function that takes the resolve and reject functions as parameters. + * @param options - The options for the abortable promise. + * @returns A promise that can be aborted. */ -const isNode = typeof process !== "undefined" && Boolean(process.version) && Boolean((_a = process.versions) === null || _a === void 0 ? void 0 : _a.node); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Helper TypeGuard that checks if something is defined or not. - * @param thing - Anything - */ -function isDefined(thing) { - return typeof thing !== "undefined" && thing !== null; -} -/** - * Helper TypeGuard that checks if the input is an object with the specified properties. - * @param thing - Anything. - * @param properties - The name of the properties that should appear in the object. - */ -function isObjectWithProperties(thing, properties) { - if (!isDefined(thing) || typeof thing !== "object") { - return false; - } - for (const property of properties) { - if (!objectHasProperty(thing, property)) { - return false; +function createAbortablePromise(buildPromise, options) { + const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; + return new Promise((resolve, reject) => { + function rejectOnAbort() { + reject(new abortController.AbortError(abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : "The operation was aborted.")); } - } - return true; -} -/** - * Helper TypeGuard that checks if the input is an object with the specified property. - * @param thing - Any object. - * @param property - The name of the property that should appear in the object. - */ -function objectHasProperty(thing, property) { - return (isDefined(thing) && typeof thing === "object" && property in thing); + function removeListeners() { + abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener("abort", onAbort); + } + function onAbort() { + cleanupBeforeAbort === null || cleanupBeforeAbort === void 0 ? void 0 : cleanupBeforeAbort(); + removeListeners(); + rejectOnAbort(); + } + if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { + return rejectOnAbort(); + } + try { + buildPromise((x) => { + removeListeners(); + resolve(x); + }, (x) => { + removeListeners(); + reject(x); + }); + } + catch (err) { + reject(err); + } + abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener("abort", onAbort); + }); } // Copyright (c) Microsoft Corporation. -const StandardAbortMessage = "The operation was aborted."; +const StandardAbortMessage = "The delay was aborted."; /** * A wrapper for setTimeout that resolves a promise after timeInMs milliseconds. * @param timeInMs - The number of milliseconds to be delayed. @@ -25156,35 +24754,14 @@ const StandardAbortMessage = "The operation was aborted."; * @returns Promise that is resolved after timeInMs */ function delay(timeInMs, options) { - return new Promise((resolve, reject) => { - let timer = undefined; - let onAborted = undefined; - const rejectOnAbort = () => { - var _a; - return reject(new abortController.AbortError((_a = options === null || options === void 0 ? void 0 : options.abortErrorMsg) !== null && _a !== void 0 ? _a : StandardAbortMessage)); - }; - const removeListeners = () => { - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && onAborted) { - options.abortSignal.removeEventListener("abort", onAborted); - } - }; - onAborted = () => { - if (isDefined(timer)) { - clearTimeout(timer); - } - removeListeners(); - return rejectOnAbort(); - }; - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && options.abortSignal.aborted) { - return rejectOnAbort(); - } - timer = setTimeout(() => { - removeListeners(); - resolve(); - }, timeInMs); - if (options === null || options === void 0 ? void 0 : options.abortSignal) { - options.abortSignal.addEventListener("abort", onAborted); - } + let token; + const { abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; + return createAbortablePromise((resolve) => { + token = setTimeout(resolve, timeInMs); + }, { + cleanupBeforeAbort: () => clearTimeout(token), + abortSignal, + abortErrorMsg: abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : StandardAbortMessage, }); } @@ -25283,17 +24860,228 @@ async function computeSha256Hash(content, encoding) { return crypto.createHash("sha256").update(content).digest(encoding); } +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * Helper TypeGuard that checks if something is defined or not. + * @param thing - Anything + */ +function isDefined(thing) { + return typeof thing !== "undefined" && thing !== null; +} +/** + * Helper TypeGuard that checks if the input is an object with the specified properties. + * @param thing - Anything. + * @param properties - The name of the properties that should appear in the object. + */ +function isObjectWithProperties(thing, properties) { + if (!isDefined(thing) || typeof thing !== "object") { + return false; + } + for (const property of properties) { + if (!objectHasProperty(thing, property)) { + return false; + } + } + return true; +} +/** + * Helper TypeGuard that checks if the input is an object with the specified property. + * @param thing - Any object. + * @param property - The name of the property that should appear in the object. + */ +function objectHasProperty(thing, property) { + return (isDefined(thing) && typeof thing === "object" && property in thing); +} + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/* + * NOTE: When moving this file, please update "react-native" section in package.json. + */ +/** + * Generated Universally Unique Identifier + * + * @returns RFC4122 v4 UUID. + */ +function generateUUID() { + let uuid = ""; + for (let i = 0; i < 32; i++) { + // Generate a random number between 0 and 15 + const randomNumber = Math.floor(Math.random() * 16); + // Set the UUID version to 4 in the 13th position + if (i === 12) { + uuid += "4"; + } + else if (i === 16) { + // Set the UUID variant to "10" in the 17th position + uuid += (randomNumber & 0x3) | 0x8; + } + else { + // Add a random hexadecimal digit to the UUID string + uuid += randomNumber.toString(16); + } + // Add hyphens to the UUID string at the appropriate positions + if (i === 7 || i === 11 || i === 15 || i === 19) { + uuid += "-"; + } + } + return uuid; +} + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +var _a$1; +// NOTE: This is a workaround until we can use `globalThis.crypto.randomUUID` in Node.js 19+. +let uuidFunction = typeof ((_a$1 = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a$1 === void 0 ? void 0 : _a$1.randomUUID) === "function" + ? globalThis.crypto.randomUUID.bind(globalThis.crypto) + : crypto.randomUUID; +// Not defined in earlier versions of Node.js 14 +if (!uuidFunction) { + uuidFunction = generateUUID; +} +/** + * Generated Universally Unique Identifier + * + * @returns RFC4122 v4 UUID. + */ +function randomUUID() { + return uuidFunction(); +} + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +var _a, _b, _c, _d; +/** + * A constant that indicates whether the environment the code is running is a Web Browser. + */ +// eslint-disable-next-line @azure/azure-sdk/ts-no-window +const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined"; +/** + * A constant that indicates whether the environment the code is running is a Web Worker. + */ +const isWebWorker = typeof self === "object" && + typeof (self === null || self === void 0 ? void 0 : self.importScripts) === "function" && + (((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" || + ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" || + ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.name) === "SharedWorkerGlobalScope"); +/** + * A constant that indicates whether the environment the code is running is Node.JS. + */ +const isNode = typeof process !== "undefined" && Boolean(process.version) && Boolean((_d = process.versions) === null || _d === void 0 ? void 0 : _d.node); +/** + * A constant that indicates whether the environment the code is running is Deno. + */ +const isDeno = typeof Deno !== "undefined" && + typeof Deno.version !== "undefined" && + typeof Deno.version.deno !== "undefined"; +/** + * A constant that indicates whether the environment the code is running is Bun.sh. + */ +const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined"; +/** + * A constant that indicates whether the environment the code is running is in React-Native. + */ +// https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js +const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative"; + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * The helper that transforms bytes with specific character encoding into string + * @param bytes - the uint8array bytes + * @param format - the format we use to encode the byte + * @returns a string of the encoded string + */ +function uint8ArrayToString(bytes, format) { + switch (format) { + case "utf-8": + return uint8ArrayToUtf8String(bytes); + case "base64": + return uint8ArrayToBase64(bytes); + case "base64url": + return uint8ArrayToBase64Url(bytes); + } +} +/** + * The helper that transforms string to specific character encoded bytes array. + * @param value - the string to be converted + * @param format - the format we use to decode the value + * @returns a uint8array + */ +function stringToUint8Array(value, format) { + switch (format) { + case "utf-8": + return utf8StringToUint8Array(value); + case "base64": + return base64ToUint8Array(value); + case "base64url": + return base64UrlToUint8Array(value); + } +} +/** + * Decodes a Uint8Array into a Base64 string. + * @internal + */ +function uint8ArrayToBase64(bytes) { + return Buffer.from(bytes).toString("base64"); +} +/** + * Decodes a Uint8Array into a Base64Url string. + * @internal + */ +function uint8ArrayToBase64Url(bytes) { + return Buffer.from(bytes).toString("base64url"); +} +/** + * Decodes a Uint8Array into a javascript string. + * @internal + */ +function uint8ArrayToUtf8String(bytes) { + return Buffer.from(bytes).toString("utf-8"); +} +/** + * Encodes a JavaScript string into a Uint8Array. + * @internal + */ +function utf8StringToUint8Array(value) { + return Buffer.from(value); +} +/** + * Encodes a Base64 string into a Uint8Array. + * @internal + */ +function base64ToUint8Array(value) { + return Buffer.from(value, "base64"); +} +/** + * Encodes a Base64Url string into a Uint8Array. + * @internal + */ +function base64UrlToUint8Array(value) { + return Buffer.from(value, "base64url"); +} + exports.computeSha256Hash = computeSha256Hash; exports.computeSha256Hmac = computeSha256Hmac; +exports.createAbortablePromise = createAbortablePromise; exports.delay = delay; exports.getErrorMessage = getErrorMessage; exports.getRandomIntegerInclusive = getRandomIntegerInclusive; +exports.isBrowser = isBrowser; +exports.isBun = isBun; exports.isDefined = isDefined; +exports.isDeno = isDeno; exports.isError = isError; exports.isNode = isNode; exports.isObject = isObject; exports.isObjectWithProperties = isObjectWithProperties; +exports.isReactNative = isReactNative; +exports.isWebWorker = isWebWorker; exports.objectHasProperty = objectHasProperty; +exports.randomUUID = randomUUID; +exports.stringToUint8Array = stringToUint8Array; +exports.uint8ArrayToString = uint8ArrayToString; //# sourceMappingURL=index.js.map @@ -25307,14 +25095,16 @@ exports.objectHasProperty = objectHasProperty; Object.defineProperty(exports, "__esModule", ({ value: true })); -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var util = _interopDefault(__nccwpck_require__(73837)); var os = __nccwpck_require__(22037); +var util = __nccwpck_require__(73837); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +var util__default = /*#__PURE__*/_interopDefaultLegacy(util); // Copyright (c) Microsoft Corporation. function log(message, ...args) { - process.stderr.write(`${util.format(message, ...args)}${os.EOL}`); + process.stderr.write(`${util__default["default"].format(message, ...args)}${os.EOL}`); } // Copyright (c) Microsoft Corporation. @@ -25332,7 +25122,7 @@ const debugObj = Object.assign((namespace) => { enable, enabled, disable, - log + log, }); function enable(namespaces) { enabledString = namespaces; @@ -25379,7 +25169,7 @@ function createDebugger(namespace) { destroy, log: debugObj.log, namespace, - extend + extend, }); function debug(...args) { if (!newDebugger.enabled) { @@ -25406,6 +25196,7 @@ function extend(namespace) { newDebugger.log = this.log; return newDebugger; } +var debug = debugObj; // Copyright (c) Microsoft Corporation. const registeredLoggers = new Set(); @@ -25416,9 +25207,9 @@ let azureLogLevel; * By default, logs are sent to stderr. * Override the `log` method to redirect logs to another location. */ -const AzureLogger = debugObj("azure"); +const AzureLogger = debug("azure"); AzureLogger.log = (...args) => { - debugObj.log(...args); + debug.log(...args); }; const AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; if (logLevelFromEnv) { @@ -25431,7 +25222,7 @@ if (logLevelFromEnv) { } } /** - * Immediately enables logging at the specified log level. + * Immediately enables logging at the specified log level. If no level is specified, logging is disabled. * @param level - The log level to enable for logging. * Options from most verbose to least verbose are: * - verbose @@ -25450,7 +25241,7 @@ function setLogLevel(level) { enabledNamespaces.push(logger.namespace); } } - debugObj.enable(enabledNamespaces.join(",")); + debug.enable(enabledNamespaces.join(",")); } /** * Retrieves the currently specified log level. @@ -25462,7 +25253,7 @@ const levelMap = { verbose: 400, info: 300, warning: 200, - error: 100 + error: 100, }; /** * Creates a logger for use by the Azure SDKs that inherits from `AzureLogger`. @@ -25476,7 +25267,7 @@ function createClientLogger(namespace) { error: createLogger(clientRootLogger, "error"), warning: createLogger(clientRootLogger, "warning"), info: createLogger(clientRootLogger, "info"), - verbose: createLogger(clientRootLogger, "verbose") + verbose: createLogger(clientRootLogger, "verbose"), }; } function patchLogMethod(parent, child) { @@ -25486,23 +25277,18 @@ function patchLogMethod(parent, child) { } function createLogger(parent, level) { const logger = Object.assign(parent.extend(level), { - level + level, }); patchLogMethod(parent, logger); if (shouldEnable(logger)) { - const enabledNamespaces = debugObj.disable(); - debugObj.enable(enabledNamespaces + "," + logger.namespace); + const enabledNamespaces = debug.disable(); + debug.enable(enabledNamespaces + "," + logger.namespace); } registeredLoggers.add(logger); return logger; } function shouldEnable(logger) { - if (azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]) { - return true; - } - else { - return false; - } + return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]); } function isAzureLogLevel(logLevel) { return AZURE_LOG_LEVELS.includes(logLevel); @@ -26611,6 +26397,7 @@ const BlobName = { content: { serializedName: "content", xmlName: "content", + xmlIsMsText: true, type: { name: "String" } @@ -26839,7 +26626,8 @@ const BlobPropertiesInternal = { "P80", "Hot", "Cool", - "Archive" + "Archive", + "Cold" ] } }, @@ -29338,6 +29126,13 @@ const BlobDownloadHeaders = { name: "DateTimeRfc1123" } }, + createdOn: { + serializedName: "x-ms-creation-time", + xmlName: "x-ms-creation-time", + type: { + name: "DateTimeRfc1123" + } + }, metadata: { serializedName: "x-ms-meta", xmlName: "x-ms-meta", @@ -34020,7 +33815,7 @@ const timeoutInSeconds = { const version = { parameterPath: "version", mapper: { - defaultValue: "2021-10-04", + defaultValue: "2023-01-03", isConstant: true, serializedName: "x-ms-version", type: { @@ -34885,7 +34680,8 @@ const tier = { "P80", "Hot", "Cool", - "Archive" + "Archive", + "Cold" ] } } @@ -35112,7 +34908,8 @@ const tier1 = { "P80", "Hot", "Cool", - "Archive" + "Archive", + "Cold" ] } } @@ -38621,6 +38418,7 @@ const uploadOperationSpec = { blobTagsString, legalHold1, transactionalContentMD5, + transactionalContentCrc64, contentType1, accept2, blobType2 @@ -38848,8 +38646,8 @@ const logger = logger$1.createClientLogger("storage-blob"); // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -const SDK_VERSION = "12.12.0"; -const SERVICE_VERSION = "2021-10-04"; +const SDK_VERSION = "12.15.0"; +const SERVICE_VERSION = "2023-01-03"; const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB const BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB const BLOCK_BLOB_MAX_BLOCKS = 50000; @@ -39248,7 +39046,8 @@ function appendToURLPath(url, name) { let path = urlParsed.getPath(); path = path ? (path.endsWith("/") ? `${path}${name}` : `${path}/${name}`) : name; urlParsed.setPath(path); - return urlParsed.toString(); + const normalizedUrl = new URL(urlParsed.toString()); + return normalizedUrl.toString(); } /** * Set URL parameter name and value. If name exists in URL parameters, old value @@ -39685,9 +39484,7 @@ function ConvertInternalResponseOfListBlobHierarchy(internalResponse) { var _a; return Object.assign(Object.assign({}, internalResponse), { segment: { blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = { - name: BlobNameToString(blobPrefixInternal.name), - }; + const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); return blobPrefix; }), blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { @@ -39696,296 +39493,6 @@ function ConvertInternalResponseOfListBlobHierarchy(internalResponse) { }), } }); } -function decodeBase64String(value) { - if (coreHttp.isNode) { - return Buffer.from(value, "base64"); - } - else { - const byteString = atob(value); - const arr = new Uint8Array(byteString.length); - for (let i = 0; i < byteString.length; i++) { - arr[i] = byteString.charCodeAt(i); - } - return arr; - } -} -function ParseBoolean(content) { - if (content === undefined) - return undefined; - if (content === "true") - return true; - if (content === "false") - return false; - return undefined; -} -function ParseBlobName(blobNameInXML) { - if (blobNameInXML["$"] !== undefined && blobNameInXML["#"] !== undefined) { - return { - encoded: ParseBoolean(blobNameInXML["$"]["Encoded"]), - content: blobNameInXML["#"], - }; - } - else { - return { - encoded: false, - content: blobNameInXML, - }; - } -} -function ParseBlobProperties(blobPropertiesInXML) { - const blobProperties = blobPropertiesInXML; - if (blobPropertiesInXML["Creation-Time"]) { - blobProperties.createdOn = new Date(blobPropertiesInXML["Creation-Time"]); - delete blobProperties["Creation-Time"]; - } - if (blobPropertiesInXML["Last-Modified"]) { - blobProperties.lastModified = new Date(blobPropertiesInXML["Last-Modified"]); - delete blobProperties["Last-Modified"]; - } - if (blobPropertiesInXML["Etag"]) { - blobProperties.etag = blobPropertiesInXML["Etag"]; - delete blobProperties["Etag"]; - } - if (blobPropertiesInXML["Content-Length"]) { - blobProperties.contentLength = parseFloat(blobPropertiesInXML["Content-Length"]); - delete blobProperties["Content-Length"]; - } - if (blobPropertiesInXML["Content-Type"]) { - blobProperties.contentType = blobPropertiesInXML["Content-Type"]; - delete blobProperties["Content-Type"]; - } - if (blobPropertiesInXML["Content-Encoding"]) { - blobProperties.contentEncoding = blobPropertiesInXML["Content-Encoding"]; - delete blobProperties["Content-Encoding"]; - } - if (blobPropertiesInXML["Content-Language"]) { - blobProperties.contentLanguage = blobPropertiesInXML["Content-Language"]; - delete blobProperties["Content-Language"]; - } - if (blobPropertiesInXML["Content-MD5"]) { - blobProperties.contentMD5 = decodeBase64String(blobPropertiesInXML["Content-MD5"]); - delete blobProperties["Content-MD5"]; - } - if (blobPropertiesInXML["Content-Disposition"]) { - blobProperties.contentDisposition = blobPropertiesInXML["Content-Disposition"]; - delete blobProperties["Content-Disposition"]; - } - if (blobPropertiesInXML["Cache-Control"]) { - blobProperties.cacheControl = blobPropertiesInXML["Cache-Control"]; - delete blobProperties["Cache-Control"]; - } - if (blobPropertiesInXML["x-ms-blob-sequence-number"]) { - blobProperties.blobSequenceNumber = parseFloat(blobPropertiesInXML["x-ms-blob-sequence-number"]); - delete blobProperties["x-ms-blob-sequence-number"]; - } - if (blobPropertiesInXML["BlobType"]) { - blobProperties.blobType = blobPropertiesInXML["BlobType"]; - delete blobProperties["BlobType"]; - } - if (blobPropertiesInXML["LeaseStatus"]) { - blobProperties.leaseStatus = blobPropertiesInXML["LeaseStatus"]; - delete blobProperties["LeaseStatus"]; - } - if (blobPropertiesInXML["LeaseState"]) { - blobProperties.leaseState = blobPropertiesInXML["LeaseState"]; - delete blobProperties["LeaseState"]; - } - if (blobPropertiesInXML["LeaseDuration"]) { - blobProperties.leaseDuration = blobPropertiesInXML["LeaseDuration"]; - delete blobProperties["LeaseDuration"]; - } - if (blobPropertiesInXML["CopyId"]) { - blobProperties.copyId = blobPropertiesInXML["CopyId"]; - delete blobProperties["CopyId"]; - } - if (blobPropertiesInXML["CopyStatus"]) { - blobProperties.copyStatus = blobPropertiesInXML["CopyStatus"]; - delete blobProperties["CopyStatus"]; - } - if (blobPropertiesInXML["CopySource"]) { - blobProperties.copySource = blobPropertiesInXML["CopySource"]; - delete blobProperties["CopySource"]; - } - if (blobPropertiesInXML["CopyProgress"]) { - blobProperties.copyProgress = blobPropertiesInXML["CopyProgress"]; - delete blobProperties["CopyProgress"]; - } - if (blobPropertiesInXML["CopyCompletionTime"]) { - blobProperties.copyCompletedOn = new Date(blobPropertiesInXML["CopyCompletionTime"]); - delete blobProperties["CopyCompletionTime"]; - } - if (blobPropertiesInXML["CopyStatusDescription"]) { - blobProperties.copyStatusDescription = blobPropertiesInXML["CopyStatusDescription"]; - delete blobProperties["CopyStatusDescription"]; - } - if (blobPropertiesInXML["ServerEncrypted"]) { - blobProperties.serverEncrypted = ParseBoolean(blobPropertiesInXML["ServerEncrypted"]); - delete blobProperties["ServerEncrypted"]; - } - if (blobPropertiesInXML["IncrementalCopy"]) { - blobProperties.incrementalCopy = ParseBoolean(blobPropertiesInXML["IncrementalCopy"]); - delete blobProperties["IncrementalCopy"]; - } - if (blobPropertiesInXML["DestinationSnapshot"]) { - blobProperties.destinationSnapshot = blobPropertiesInXML["DestinationSnapshot"]; - delete blobProperties["DestinationSnapshot"]; - } - if (blobPropertiesInXML["DeletedTime"]) { - blobProperties.deletedOn = new Date(blobPropertiesInXML["DeletedTime"]); - delete blobProperties["DeletedTime"]; - } - if (blobPropertiesInXML["RemainingRetentionDays"]) { - blobProperties.remainingRetentionDays = parseFloat(blobPropertiesInXML["RemainingRetentionDays"]); - delete blobProperties["RemainingRetentionDays"]; - } - if (blobPropertiesInXML["AccessTier"]) { - blobProperties.accessTier = blobPropertiesInXML["AccessTier"]; - delete blobProperties["AccessTier"]; - } - if (blobPropertiesInXML["AccessTierInferred"]) { - blobProperties.accessTierInferred = ParseBoolean(blobPropertiesInXML["AccessTierInferred"]); - delete blobProperties["AccessTierInferred"]; - } - if (blobPropertiesInXML["ArchiveStatus"]) { - blobProperties.archiveStatus = blobPropertiesInXML["ArchiveStatus"]; - delete blobProperties["ArchiveStatus"]; - } - if (blobPropertiesInXML["CustomerProvidedKeySha256"]) { - blobProperties.customerProvidedKeySha256 = blobPropertiesInXML["CustomerProvidedKeySha256"]; - delete blobProperties["CustomerProvidedKeySha256"]; - } - if (blobPropertiesInXML["EncryptionScope"]) { - blobProperties.encryptionScope = blobPropertiesInXML["EncryptionScope"]; - delete blobProperties["EncryptionScope"]; - } - if (blobPropertiesInXML["AccessTierChangeTime"]) { - blobProperties.accessTierChangedOn = new Date(blobPropertiesInXML["AccessTierChangeTime"]); - delete blobProperties["AccessTierChangeTime"]; - } - if (blobPropertiesInXML["TagCount"]) { - blobProperties.tagCount = parseFloat(blobPropertiesInXML["TagCount"]); - delete blobProperties["TagCount"]; - } - if (blobPropertiesInXML["Expiry-Time"]) { - blobProperties.expiresOn = new Date(blobPropertiesInXML["Expiry-Time"]); - delete blobProperties["Expiry-Time"]; - } - if (blobPropertiesInXML["Sealed"]) { - blobProperties.isSealed = ParseBoolean(blobPropertiesInXML["Sealed"]); - delete blobProperties["Sealed"]; - } - if (blobPropertiesInXML["RehydratePriority"]) { - blobProperties.rehydratePriority = blobPropertiesInXML["RehydratePriority"]; - delete blobProperties["RehydratePriority"]; - } - if (blobPropertiesInXML["LastAccessTime"]) { - blobProperties.lastAccessedOn = new Date(blobPropertiesInXML["LastAccessTime"]); - delete blobProperties["LastAccessTime"]; - } - if (blobPropertiesInXML["ImmutabilityPolicyUntilDate"]) { - blobProperties.immutabilityPolicyExpiresOn = new Date(blobPropertiesInXML["ImmutabilityPolicyUntilDate"]); - delete blobProperties["ImmutabilityPolicyUntilDate"]; - } - if (blobPropertiesInXML["ImmutabilityPolicyMode"]) { - blobProperties.immutabilityPolicyMode = blobPropertiesInXML["ImmutabilityPolicyMode"]; - delete blobProperties["ImmutabilityPolicyMode"]; - } - if (blobPropertiesInXML["LegalHold"]) { - blobProperties.legalHold = ParseBoolean(blobPropertiesInXML["LegalHold"]); - delete blobProperties["LegalHold"]; - } - return blobProperties; -} -function ParseBlobItem(blobInXML) { - const blobItem = blobInXML; - blobItem.properties = ParseBlobProperties(blobInXML["Properties"]); - delete blobItem["Properties"]; - blobItem.name = ParseBlobName(blobInXML["Name"]); - delete blobItem["Name"]; - blobItem.deleted = ParseBoolean(blobInXML["Deleted"]); - delete blobItem["Deleted"]; - if (blobInXML["Snapshot"]) { - blobItem.snapshot = blobInXML["Snapshot"]; - delete blobItem["Snapshot"]; - } - if (blobInXML["VersionId"]) { - blobItem.versionId = blobInXML["VersionId"]; - delete blobItem["VersionId"]; - } - if (blobInXML["IsCurrentVersion"]) { - blobItem.isCurrentVersion = ParseBoolean(blobInXML["IsCurrentVersion"]); - delete blobItem["IsCurrentVersion"]; - } - if (blobInXML["Metadata"]) { - blobItem.metadata = blobInXML["Metadata"]; - delete blobItem["Metadata"]; - } - if (blobInXML["Tags"]) { - blobItem.blobTags = ParseBlobTags(blobInXML["Tags"]); - delete blobItem["Tags"]; - } - if (blobInXML["OrMetadata"]) { - blobItem.objectReplicationMetadata = blobInXML["OrMetadata"]; - delete blobItem["OrMetadata"]; - } - if (blobInXML["HasVersionsOnly"]) { - blobItem.hasVersionsOnly = ParseBoolean(blobInXML["HasVersionsOnly"]); - delete blobItem["HasVersionsOnly"]; - } - return blobItem; -} -function ParseBlobPrefix(blobPrefixInXML) { - return { - name: ParseBlobName(blobPrefixInXML["Name"]), - }; -} -function ParseBlobTag(blobTagInXML) { - return { - key: blobTagInXML["Key"], - value: blobTagInXML["Value"], - }; -} -function ParseBlobTags(blobTagsInXML) { - if (blobTagsInXML === undefined || - blobTagsInXML["TagSet"] === undefined || - blobTagsInXML["TagSet"]["Tag"] === undefined) { - return undefined; - } - const blobTagSet = []; - if (blobTagsInXML["TagSet"]["Tag"] instanceof Array) { - blobTagsInXML["TagSet"]["Tag"].forEach((blobTagInXML) => { - blobTagSet.push(ParseBlobTag(blobTagInXML)); - }); - } - else { - blobTagSet.push(ParseBlobTag(blobTagsInXML["TagSet"]["Tag"])); - } - return { blobTagSet: blobTagSet }; -} -function ProcessBlobItems(blobArrayInXML) { - const blobItems = []; - if (blobArrayInXML instanceof Array) { - blobArrayInXML.forEach((blobInXML) => { - blobItems.push(ParseBlobItem(blobInXML)); - }); - } - else { - blobItems.push(ParseBlobItem(blobArrayInXML)); - } - return blobItems; -} -function ProcessBlobPrefixes(blobPrefixesInXML) { - const blobPrefixes = []; - if (blobPrefixesInXML instanceof Array) { - blobPrefixesInXML.forEach((blobPrefixInXML) => { - blobPrefixes.push(ParseBlobPrefix(blobPrefixInXML)); - }); - } - else { - blobPrefixes.push(ParseBlobPrefix(blobPrefixesInXML)); - } - return blobPrefixes; -} function* ExtractPageRangeInfoItems(getPageRangesSegment) { let pageRange = []; let clearRange = []; @@ -40996,7 +40503,7 @@ class StorageSharedKeyCredential extends Credential { * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ const packageName = "azure-storage-blob"; -const packageVersion = "12.12.0"; +const packageVersion = "12.15.0"; class StorageClientContext extends coreHttp__namespace.ServiceClient { /** * Initializes a new instance of the StorageClientContext class. @@ -41022,7 +40529,7 @@ class StorageClientContext extends coreHttp__namespace.ServiceClient { // Parameter assignments this.url = url; // Assigning values to Constant parameters - this.version = options.version || "2021-10-04"; + this.version = options.version || "2023-01-03"; } } @@ -42951,6 +42458,14 @@ class BlobDownloadResponse { get lastAccessed() { return this.originalResponse.lastAccessed; } + /** + * Returns the date and time the blob was created. + * + * @readonly + */ + get createdOn() { + return this.originalResponse.createdOn; + } /** * A name-value pair * to associate with a file storage object. @@ -43381,6 +42896,7 @@ class AvroUnionType extends AvroType { this._types = types; } async read(stream, options = {}) { + // eslint-disable-line @typescript-eslint/ban-types const typeIndex = await AvroParser.readInt(stream, options); return this._types[typeIndex].read(stream, options); } @@ -44104,6 +43620,10 @@ exports.BlockBlobTier = void 0; * Optimized for storing data that is infrequently accessed and stored for at least 30 days. */ BlockBlobTier["Cool"] = "Cool"; + /** + * Optimized for storing data that is rarely accessed. + */ + BlockBlobTier["Cold"] = "Cold"; /** * Optimized for storing data that is rarely accessed and stored for at least 180 days * with flexible latency requirements (on the order of hours). @@ -45035,6 +44555,9 @@ class BlobClient extends StorageClient { // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions) // The second parameter is undefined. Use anonymous credential. url = urlOrConnectionString; + if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { + options = blobNameOrOptions; + } pipeline = newPipeline(new AnonymousCredential(), options); } else if (credentialOrPipelineOrContainerName && @@ -45705,7 +45228,7 @@ class BlobClient extends StorageClient { sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, sourceIfNoneMatch: options.sourceConditions.ifNoneMatch, sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, - }, sourceContentMD5: options.sourceContentMD5, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), blobTagsString: toBlobTagsString(options.tags), immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, encryptionScope: options.encryptionScope, copySourceTags: options.copySourceTags }, convertTracingToRequestOptionsBase(updatedOptions))); + }, sourceContentMD5: options.sourceContentMD5, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, encryptionScope: options.encryptionScope, copySourceTags: options.copySourceTags }, convertTracingToRequestOptionsBase(updatedOptions))); } catch (e) { span.setStatus({ @@ -46338,6 +45861,9 @@ class BlockBlobClient extends BlobClient { // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions) // The second parameter is undefined. Use anonymous credential. url = urlOrConnectionString; + if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { + options = blobNameOrOptions; + } pipeline = newPipeline(new AnonymousCredential(), options); } else if (credentialOrPipelineOrContainerName && @@ -48431,6 +47957,7 @@ class ContainerClient extends StorageClient { * Creates a new container under the specified account. If the container with * the same name already exists, the operation fails. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata * * @param options - Options to Container Create operation. * @@ -48465,6 +47992,7 @@ class ContainerClient extends StorageClient { * Creates a new container under the specified account. If the container with * the same name already exists, it is not changed. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata * * @param options - */ @@ -48902,10 +48430,6 @@ class ContainerClient extends StorageClient { const { span, updatedOptions } = createSpan("ContainerClient-listBlobFlatSegment", options); try { const response = await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions))); - response.segment.blobItems = []; - if (response.segment["Blob"] !== undefined) { - response.segment.blobItems = ProcessBlobItems(response.segment["Blob"]); - } const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => { const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) }); return blobItem; @@ -48939,21 +48463,11 @@ class ContainerClient extends StorageClient { const { span, updatedOptions } = createSpan("ContainerClient-listBlobHierarchySegment", options); try { const response = await this.containerContext.listBlobHierarchySegment(delimiter, Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions))); - response.segment.blobItems = []; - if (response.segment["Blob"] !== undefined) { - response.segment.blobItems = ProcessBlobItems(response.segment["Blob"]); - } - response.segment.blobPrefixes = []; - if (response.segment["BlobPrefix"] !== undefined) { - response.segment.blobPrefixes = ProcessBlobPrefixes(response.segment["BlobPrefix"]); - } const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => { const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) }); return blobItem; }), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = { - name: BlobNameToString(blobPrefixInternal.name), - }; + const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); return blobPrefix; }) }) }); return wrappedResponse; @@ -50158,7 +49672,7 @@ class BlobServiceClient extends StorageClient { return new ContainerClient(appendToURLPath(this.url, encodeURIComponent(containerName)), this.pipeline); } /** - * Create a Blob container. + * Create a Blob container. @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container * * @param containerName - Name of the container to create. * @param options - Options to configure Container Create operation. @@ -50845,6 +50359,14 @@ class BlobServiceClient extends StorageClient { } } +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** Known values of {@link EncryptionAlgorithmType} that the service accepts. */ +exports.KnownEncryptionAlgorithmType = void 0; +(function (KnownEncryptionAlgorithmType) { + KnownEncryptionAlgorithmType["AES256"] = "AES256"; +})(exports.KnownEncryptionAlgorithmType || (exports.KnownEncryptionAlgorithmType = {})); + Object.defineProperty(exports, "BaseRequestPolicy", ({ enumerable: true, get: function () { return coreHttp.BaseRequestPolicy; } @@ -51094,6 +50616,12 @@ class Conn extends FsFile_js_1.FsFile { setKeepAlive(enable) { __classPrivateFieldGet(this, _Conn_socket, "f").setKeepAlive(enable); } + ref() { + __classPrivateFieldGet(this, _Conn_socket, "f").ref(); + } + unref() { + __classPrivateFieldGet(this, _Conn_socket, "f").unref(); + } } exports.Conn = Conn; _Conn_socket = new WeakMap(); @@ -51557,8 +51085,8 @@ _StreamWriter_stream = new WeakMap(); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.typescript = exports.deno = void 0; -exports.deno = "1.22.1"; -exports.typescript = "4.6.2"; +exports.deno = "1.29.2"; +exports.typescript = "4.9.4"; /***/ }), @@ -51761,7 +51289,7 @@ var SeekMode; // Command palette -> Organize imports Object.defineProperty(exports, "__esModule", ({ value: true })); exports.readSync = exports.readLinkSync = exports.readLink = exports.readFileSync = exports.readFile = exports.readDirSync = exports.readDir = exports.read = exports.openSync = exports.open = exports.mkdirSync = exports.mkdir = exports.memoryUsage = exports.makeTempFileSync = exports.makeTempFile = exports.makeTempDirSync = exports.makeTempDir = exports.lstatSync = exports.lstat = exports.listenTls = exports.listen = exports.linkSync = exports.link = exports.kill = exports.inspect = exports.ftruncateSync = exports.ftruncate = exports.fsyncSync = exports.fsync = exports.fstatSync = exports.fstat = exports.fdatasyncSync = exports.fdatasync = exports.exit = exports.execPath = exports.cwd = exports.createSync = exports.create = exports.copyFileSync = exports.copyFile = exports.copy = exports.connectTls = exports.connect = exports.close = exports.chownSync = exports.chown = exports.chmodSync = exports.chmod = exports.chdir = exports.isatty = void 0; -exports.args = exports.writeTextFileSync = exports.writeTextFile = exports.writeSync = exports.writeFileSync = exports.writeFile = exports.write = exports.watchFs = exports.truncateSync = exports.truncate = exports.test = exports.symlinkSync = exports.symlink = exports.statSync = exports.stat = exports.shutdown = exports.run = exports.Process = exports.renameSync = exports.rename = exports.removeSync = exports.remove = exports.realPathSync = exports.realPath = exports.readTextFileSync = exports.readTextFile = void 0; +exports.args = exports.writeTextFileSync = exports.writeTextFile = exports.writeSync = exports.writeFileSync = exports.writeFile = exports.write = exports.watchFs = exports.truncateSync = exports.truncate = exports.test = exports.symlinkSync = exports.symlink = exports.statSync = exports.stat = exports.shutdown = exports.run = exports.Process = exports.resolveDns = exports.renameSync = exports.rename = exports.removeSync = exports.remove = exports.realPathSync = exports.realPath = exports.readTextFileSync = exports.readTextFile = void 0; var tty_1 = __nccwpck_require__(76224); Object.defineProperty(exports, "isatty", ({ enumerable: true, get: function () { return tty_1.isatty; } })); var chdir_js_1 = __nccwpck_require__(58914); @@ -51878,6 +51406,8 @@ var rename_js_1 = __nccwpck_require__(72946); Object.defineProperty(exports, "rename", ({ enumerable: true, get: function () { return rename_js_1.rename; } })); var renameSync_js_1 = __nccwpck_require__(29995); Object.defineProperty(exports, "renameSync", ({ enumerable: true, get: function () { return renameSync_js_1.renameSync; } })); +var resolveDns_js_1 = __nccwpck_require__(66711); +Object.defineProperty(exports, "resolveDns", ({ enumerable: true, get: function () { return resolveDns_js_1.resolveDns; } })); var run_js_1 = __nccwpck_require__(81158); Object.defineProperty(exports, "Process", ({ enumerable: true, get: function () { return run_js_1.Process; } })); Object.defineProperty(exports, "run", ({ enumerable: true, get: function () { return run_js_1.run; } })); @@ -53749,6 +53279,55 @@ const fs = __importStar(__nccwpck_require__(57147)); exports.renameSync = fs.renameSync; +/***/ }), + +/***/ 66711: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/// +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.resolveDns = void 0; +const dns_1 = __importDefault(__nccwpck_require__(17578)); +const resolveDns = function resolveDns(query, recordType, options) { + if (options) { + throw Error(`resolveDns option not implemnted yet`); + } + switch (recordType) { + case "A": + /* falls through */ + case "AAAA": + case "CNAME": + case "NS": + case "PTR": + return new Promise((resolve, reject) => { + dns_1.default.resolve(query, recordType, (err, addresses) => { + if (err) { + reject(err); + } + else { + resolve(addresses); + } + }); + }); + case "ANAME": + case "CAA": + case "MX": + case "NAPTR": + case "SOA": + case "SRV": + case "TXT": + default: + throw Error(`resolveDns type ${recordType} not implemnted yet`); + } +}; +exports.resolveDns = resolveDns; + + /***/ }), /***/ 81158: @@ -53958,7 +53537,7 @@ class Process { __classPrivateFieldGet(this, _Process_process, "f").unref(); __classPrivateFieldGet(this, _Process_process, "f").kill(); } - kill(signo) { + kill(signo = "SIGTERM") { if (__classPrivateFieldGet(this, _Process_receivedStatus, "f")) { throw new errors.NotFound("entity not found"); } @@ -54444,12 +54023,12 @@ exports.writeFile = void 0; const fs = __importStar(__nccwpck_require__(73292)); const errorMap_js_1 = __importDefault(__nccwpck_require__(50937)); const fs_flags_js_1 = __nccwpck_require__(8423); -const writeFile = async function writeFile(path, data, { append = false, create = true, mode, signal } = {}) { +const writeFile = async function writeFile(path, data, { append = false, create = true, createNew = false, mode, signal } = {}) { const truncate = create && !append; - const flag = (0, fs_flags_js_1.getFsFlag)({ append, create, truncate, write: true }); + const flag = (0, fs_flags_js_1.getFsFlag)({ append, create, createNew, truncate, write: true }); try { await fs.writeFile(path, data, { flag, signal }); - if (mode !== undefined) + if (mode != null) await fs.chmod(path, mode); } catch (error) { @@ -54486,9 +54065,13 @@ const writeFileSync = function writeFileSync(path, data, options = {}) { (0, statSync_js_1.statSync)(path); } } - const openOptions = options.append - ? { write: true, create: true, append: true } - : { write: true, create: true, truncate: true }; + const openOptions = { + write: true, + create: true, + createNew: options.createNew, + append: !!options.append, + truncate: !options.append, + }; const file = (0, openSync_js_1.openSync)(path, openOptions); if (options.mode !== undefined && options.mode !== null && @@ -55093,6 +54676,12 @@ exports.stdin = { close() { process.stdin.destroy(); }, + setRaw(mode, options) { + if (options === null || options === void 0 ? void 0 : options.cbreak) { + throw new Error("The cbreak option is not implemented."); + } + process.stdin.setRawMode(mode); + }, }; exports.stdout = { rid: 1, @@ -55174,7 +54763,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.sleepSync = exports.utimeSync = exports.utime = exports.futimeSync = exports.futime = void 0; +exports.utimeSync = exports.utime = exports.futimeSync = exports.futime = void 0; const fs_1 = __importDefault(__nccwpck_require__(57147)); const errorMap_js_1 = __importDefault(__nccwpck_require__(50937)); const variables_js_1 = __nccwpck_require__(9335); @@ -55230,11 +54819,6 @@ const utimeSync = function (path, atime, mtime) { } }; exports.utimeSync = utimeSync; -const sleepSync = function (milliseconds) { - // https://github.com/sindresorhus/sleep-synchronously/blob/main/index.js - Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, milliseconds); -}; -exports.sleepSync = sleepSync; /***/ }), @@ -129282,7 +128866,7 @@ tslib_1.__exportStar(__nccwpck_require__(55398), exports); tslib_1.__exportStar(__nccwpck_require__(34981), exports); tslib_1.__exportStar(__nccwpck_require__(38099), exports); tslib_1.__exportStar(__nccwpck_require__(78901), exports); -tslib_1.__exportStar(__nccwpck_require__(19493), exports); +tslib_1.__exportStar(__nccwpck_require__(19562), exports); tslib_1.__exportStar(__nccwpck_require__(11672), exports); tslib_1.__exportStar(__nccwpck_require__(17252), exports); tslib_1.__exportStar(__nccwpck_require__(57151), exports); @@ -129350,7 +128934,7 @@ tslib_1.__exportStar(__nccwpck_require__(22567), exports); tslib_1.__exportStar(__nccwpck_require__(50993), exports); tslib_1.__exportStar(__nccwpck_require__(98844), exports); tslib_1.__exportStar(__nccwpck_require__(76838), exports); -tslib_1.__exportStar(__nccwpck_require__(79083), exports); +tslib_1.__exportStar(__nccwpck_require__(44603), exports); tslib_1.__exportStar(__nccwpck_require__(41500), exports); tslib_1.__exportStar(__nccwpck_require__(86280), exports); tslib_1.__exportStar(__nccwpck_require__(91128), exports); @@ -129644,7 +129228,7 @@ tslib_1.__exportStar(__nccwpck_require__(5461), exports); tslib_1.__exportStar(__nccwpck_require__(65831), exports); tslib_1.__exportStar(__nccwpck_require__(31079), exports); tslib_1.__exportStar(__nccwpck_require__(75281), exports); -tslib_1.__exportStar(__nccwpck_require__(8109), exports); +tslib_1.__exportStar(__nccwpck_require__(47306), exports); tslib_1.__exportStar(__nccwpck_require__(50769), exports); tslib_1.__exportStar(__nccwpck_require__(49098), exports); tslib_1.__exportStar(__nccwpck_require__(34651), exports); @@ -129807,7 +129391,7 @@ const v1DeploymentStatus_1 = __nccwpck_require__(55398); const v1DeploymentStrategy_1 = __nccwpck_require__(34981); const v1DownwardAPIProjection_1 = __nccwpck_require__(38099); const v1DownwardAPIVolumeFile_1 = __nccwpck_require__(78901); -const v1DownwardAPIVolumeSource_1 = __nccwpck_require__(19493); +const v1DownwardAPIVolumeSource_1 = __nccwpck_require__(19562); const v1EmptyDirVolumeSource_1 = __nccwpck_require__(11672); const v1Endpoint_1 = __nccwpck_require__(17252); const v1EndpointAddress_1 = __nccwpck_require__(57151); @@ -129875,7 +129459,7 @@ const v1LabelSelector_1 = __nccwpck_require__(22567); const v1LabelSelectorRequirement_1 = __nccwpck_require__(50993); const v1Lease_1 = __nccwpck_require__(98844); const v1LeaseList_1 = __nccwpck_require__(76838); -const v1LeaseSpec_1 = __nccwpck_require__(79083); +const v1LeaseSpec_1 = __nccwpck_require__(44603); const v1Lifecycle_1 = __nccwpck_require__(41500); const v1LimitRange_1 = __nccwpck_require__(86280); const v1LimitRangeItem_1 = __nccwpck_require__(91128); @@ -130169,7 +129753,7 @@ const v1beta1ResourcePolicyRule_1 = __nccwpck_require__(5461); const v1beta1RunAsGroupStrategyOptions_1 = __nccwpck_require__(65831); const v1beta1RunAsUserStrategyOptions_1 = __nccwpck_require__(31079); const v1beta1RuntimeClass_1 = __nccwpck_require__(75281); -const v1beta1RuntimeClassList_1 = __nccwpck_require__(8109); +const v1beta1RuntimeClassList_1 = __nccwpck_require__(47306); const v1beta1RuntimeClassStrategyOptions_1 = __nccwpck_require__(50769); const v1beta1SELinuxStrategyOptions_1 = __nccwpck_require__(49098); const v1beta1Scheduling_1 = __nccwpck_require__(34651); @@ -136509,7 +136093,7 @@ V1DownwardAPIVolumeFile.attributeTypeMap = [ /***/ }), -/***/ 19493: +/***/ 19562: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -140366,7 +139950,7 @@ V1LeaseList.attributeTypeMap = [ /***/ }), -/***/ 79083: +/***/ 44603: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -156794,7 +156378,7 @@ V1beta1RuntimeClass.attributeTypeMap = [ /***/ }), -/***/ 8109: +/***/ 47306: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -161593,7 +161177,7 @@ module.exports.node = options => { "use strict"; const isStream = __nccwpck_require__(41554); -const getStream = __nccwpck_require__(92595); +const getStream = __nccwpck_require__(21766); const mergeStream = __nccwpck_require__(2621); // `input` option @@ -161690,135 +161274,6 @@ module.exports = { -/***/ }), - -/***/ 66443: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -const {PassThrough: PassThroughStream} = __nccwpck_require__(12781); - -module.exports = options => { - options = {...options}; - - const {array} = options; - let {encoding} = options; - const isBuffer = encoding === 'buffer'; - let objectMode = false; - - if (array) { - objectMode = !(encoding || isBuffer); - } else { - encoding = encoding || 'utf8'; - } - - if (isBuffer) { - encoding = null; - } - - const stream = new PassThroughStream({objectMode}); - - if (encoding) { - stream.setEncoding(encoding); - } - - let length = 0; - const chunks = []; - - stream.on('data', chunk => { - chunks.push(chunk); - - if (objectMode) { - length = chunks.length; - } else { - length += chunk.length; - } - }); - - stream.getBufferedValue = () => { - if (array) { - return chunks; - } - - return isBuffer ? Buffer.concat(chunks, length) : chunks.join(''); - }; - - stream.getBufferedLength = () => length; - - return stream; -}; - - -/***/ }), - -/***/ 92595: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -const {constants: BufferConstants} = __nccwpck_require__(14300); -const stream = __nccwpck_require__(12781); -const {promisify} = __nccwpck_require__(73837); -const bufferStream = __nccwpck_require__(66443); - -const streamPipelinePromisified = promisify(stream.pipeline); - -class MaxBufferError extends Error { - constructor() { - super('maxBuffer exceeded'); - this.name = 'MaxBufferError'; - } -} - -async function getStream(inputStream, options) { - if (!inputStream) { - throw new Error('Expected a stream'); - } - - options = { - maxBuffer: Infinity, - ...options - }; - - const {maxBuffer} = options; - const stream = bufferStream(options); - - await new Promise((resolve, reject) => { - const rejectPromise = error => { - // Don't retrieve an oversized buffer. - if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) { - error.bufferedData = stream.getBufferedValue(); - } - - reject(error); - }; - - (async () => { - try { - await streamPipelinePromisified(inputStream, stream); - resolve(); - } catch (error) { - rejectPromise(error); - } - })(); - - stream.on('data', () => { - if (stream.getBufferedLength() > maxBuffer) { - rejectPromise(new MaxBufferError()); - } - }); - }); - - return stream.getBufferedValue(); -} - -module.exports = getStream; -module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); -module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); -module.exports.MaxBufferError = MaxBufferError; - - /***/ }), /***/ 35132: @@ -163474,7 +162929,7 @@ module.exports = (str) => { /***/ }), -/***/ 15300: +/***/ 93570: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { timingSafeEqual: TSE } = __nccwpck_require__(6113) @@ -163585,7 +163040,7 @@ module.exports = { const { createCipheriv, createDecipheriv, getCiphers } = __nccwpck_require__(6113) const uint64be = __nccwpck_require__(82267) -const timingSafeEqual = __nccwpck_require__(15300) +const timingSafeEqual = __nccwpck_require__(93570) const { KEYOBJECT } = __nccwpck_require__(62928) const { JWEInvalid, JWEDecryptionFailed } = __nccwpck_require__(35132) @@ -164107,7 +163562,7 @@ module.exports = (JWA, JWK) => { const { createHmac } = __nccwpck_require__(6113) const { KEYOBJECT } = __nccwpck_require__(62928) -const timingSafeEqual = __nccwpck_require__(15300) +const timingSafeEqual = __nccwpck_require__(93570) const resolveNodeAlg = __nccwpck_require__(41518) const { asInput } = __nccwpck_require__(31032) @@ -171339,7 +170794,7 @@ function _objectWithoutProperties(source, excluded) { return target; } -const VERSION = "3.5.1"; +const VERSION = "3.6.0"; const _excluded = ["authStrategy"]; class Octokit { @@ -171845,7 +171300,7 @@ function withDefaults(oldDefaults, newDefaults) { }); } -const VERSION = "6.0.11"; +const VERSION = "6.0.12"; const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url. // So we use RequestParameters and add method as additional required property. @@ -172095,7 +171550,7 @@ var isPlainObject = __nccwpck_require__(63287); var nodeFetch = _interopDefault(__nccwpck_require__(80467)); var requestError = __nccwpck_require__(10537); -const VERSION = "5.6.2"; +const VERSION = "5.6.3"; function getBufferResponse(response) { return response.arrayBuffer(); @@ -173458,7 +172913,7 @@ function registerGlobal(type, instance, diag, allowOverride = false) { } if (api.version !== version_1.VERSION) { // All registered APIs must be of the same version exactly - const err = new Error('@opentelemetry/api: All API registration versions must match'); + const err = new Error(`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${version_1.VERSION}`); diag.error(err.stack || err.message); return false; } @@ -174968,7 +174423,7 @@ var TraceFlags; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.VERSION = void 0; // this is autogenerated file, see scripts/version-update.js -exports.VERSION = '1.4.0'; +exports.VERSION = '1.4.1'; //# sourceMappingURL=version.js.map /***/ }), @@ -184116,7 +183571,61 @@ module.exports = { BackupGateway: __nccwpck_require__(68277), IoTTwinMaker: __nccwpck_require__(65010), WorkSpacesWeb: __nccwpck_require__(94124), - AmplifyUIBuilder: __nccwpck_require__(89937) + AmplifyUIBuilder: __nccwpck_require__(89937), + Keyspaces: __nccwpck_require__(24789), + Billingconductor: __nccwpck_require__(38416), + GameSparks: __nccwpck_require__(83025), + PinpointSMSVoiceV2: __nccwpck_require__(478), + Ivschat: __nccwpck_require__(17077), + ChimeSDKMediaPipelines: __nccwpck_require__(18423), + EMRServerless: __nccwpck_require__(219), + M2: __nccwpck_require__(22482), + ConnectCampaigns: __nccwpck_require__(42789), + RedshiftServerless: __nccwpck_require__(29987), + RolesAnywhere: __nccwpck_require__(83604), + LicenseManagerUserSubscriptions: __nccwpck_require__(37725), + BackupStorage: __nccwpck_require__(82304), + PrivateNetworks: __nccwpck_require__(63088), + SupportApp: __nccwpck_require__(51288), + ControlTower: __nccwpck_require__(77574), + IoTFleetWise: __nccwpck_require__(94329), + MigrationHubOrchestrator: __nccwpck_require__(66120), + ConnectCases: __nccwpck_require__(72223), + ResourceExplorer2: __nccwpck_require__(74071), + Scheduler: __nccwpck_require__(94840), + ChimeSDKVoice: __nccwpck_require__(349), + IoTRoboRunner: __nccwpck_require__(22163), + SsmSap: __nccwpck_require__(44552), + OAM: __nccwpck_require__(9319), + ARCZonalShift: __nccwpck_require__(54280), + Omics: __nccwpck_require__(75114), + OpenSearchServerless: __nccwpck_require__(86277), + SecurityLake: __nccwpck_require__(84296), + SimSpaceWeaver: __nccwpck_require__(37090), + DocDBElastic: __nccwpck_require__(20792), + SageMakerGeospatial: __nccwpck_require__(4707), + CodeCatalyst: __nccwpck_require__(19499), + Pipes: __nccwpck_require__(14220), + SageMakerMetrics: __nccwpck_require__(28199), + KinesisVideoWebRTCStorage: __nccwpck_require__(52642), + LicenseManagerLinuxSubscriptions: __nccwpck_require__(52687), + KendraRanking: __nccwpck_require__(46255), + CleanRooms: __nccwpck_require__(15130), + CloudTrailData: __nccwpck_require__(31191), + Tnb: __nccwpck_require__(15300), + InternetMonitor: __nccwpck_require__(84099), + IVSRealTime: __nccwpck_require__(51946), + VPCLattice: __nccwpck_require__(78952), + OSIS: __nccwpck_require__(98021), + MediaPackageV2: __nccwpck_require__(53264), + PaymentCryptography: __nccwpck_require__(11594), + PaymentCryptographyData: __nccwpck_require__(96559), + CodeGuruSecurity: __nccwpck_require__(32620), + VerifiedPermissions: __nccwpck_require__(35604), + AppFabric: __nccwpck_require__(46318), + MedicalImaging: __nccwpck_require__(79712), + EntityResolution: __nccwpck_require__(22697), + ManagedBlockchainQuery: __nccwpck_require__(51046) }; /***/ }), @@ -184211,6 +183720,7 @@ Object.defineProperty(apiLoader.services['amplifyuibuilder'], '2021-08-11', { get: function get() { var model = __nccwpck_require__(48987); model.paginators = (__nccwpck_require__(56072)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(70564)/* .waiters */ .V); return model; }, enumerable: true, @@ -184346,6 +183856,32 @@ Object.defineProperty(apiLoader.services['appconfigdata'], '2021-11-11', { module.exports = AWS.AppConfigData; +/***/ }), + +/***/ 46318: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['appfabric'] = {}; +AWS.AppFabric = Service.defineService('appfabric', ['2023-05-19']); +Object.defineProperty(apiLoader.services['appfabric'], '2023-05-19', { + get: function get() { + var model = __nccwpck_require__(78267); + model.paginators = (__nccwpck_require__(42193)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(44821)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.AppFabric; + + /***/ }), /***/ 60844: @@ -184581,6 +184117,31 @@ Object.defineProperty(apiLoader.services['appsync'], '2017-07-25', { module.exports = AWS.AppSync; +/***/ }), + +/***/ 54280: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['arczonalshift'] = {}; +AWS.ARCZonalShift = Service.defineService('arczonalshift', ['2022-10-30']); +Object.defineProperty(apiLoader.services['arczonalshift'], '2022-10-30', { + get: function get() { + var model = __nccwpck_require__(52286); + model.paginators = (__nccwpck_require__(70002)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.ARCZonalShift; + + /***/ }), /***/ 29434: @@ -184756,6 +184317,31 @@ Object.defineProperty(apiLoader.services['backupgateway'], '2021-01-01', { module.exports = AWS.BackupGateway; +/***/ }), + +/***/ 82304: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['backupstorage'] = {}; +AWS.BackupStorage = Service.defineService('backupstorage', ['2018-04-10']); +Object.defineProperty(apiLoader.services['backupstorage'], '2018-04-10', { + get: function get() { + var model = __nccwpck_require__(97436); + model.paginators = (__nccwpck_require__(73644)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.BackupStorage; + + /***/ }), /***/ 10000: @@ -184781,6 +184367,32 @@ Object.defineProperty(apiLoader.services['batch'], '2016-08-10', { module.exports = AWS.Batch; +/***/ }), + +/***/ 38416: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['billingconductor'] = {}; +AWS.Billingconductor = Service.defineService('billingconductor', ['2021-07-30']); +Object.defineProperty(apiLoader.services['billingconductor'], '2021-07-30', { + get: function get() { + var model = __nccwpck_require__(54862); + model.paginators = (__nccwpck_require__(97894)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(64224)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.Billingconductor; + + /***/ }), /***/ 35429: @@ -184881,6 +184493,31 @@ Object.defineProperty(apiLoader.services['chimesdkidentity'], '2021-04-20', { module.exports = AWS.ChimeSDKIdentity; +/***/ }), + +/***/ 18423: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['chimesdkmediapipelines'] = {}; +AWS.ChimeSDKMediaPipelines = Service.defineService('chimesdkmediapipelines', ['2021-07-15']); +Object.defineProperty(apiLoader.services['chimesdkmediapipelines'], '2021-07-15', { + get: function get() { + var model = __nccwpck_require__(14679); + model.paginators = (__nccwpck_require__(82201)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.ChimeSDKMediaPipelines; + + /***/ }), /***/ 80788: @@ -184931,6 +184568,57 @@ Object.defineProperty(apiLoader.services['chimesdkmessaging'], '2021-05-15', { module.exports = AWS.ChimeSDKMessaging; +/***/ }), + +/***/ 349: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['chimesdkvoice'] = {}; +AWS.ChimeSDKVoice = Service.defineService('chimesdkvoice', ['2022-08-03']); +Object.defineProperty(apiLoader.services['chimesdkvoice'], '2022-08-03', { + get: function get() { + var model = __nccwpck_require__(26420); + model.paginators = (__nccwpck_require__(7986)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.ChimeSDKVoice; + + +/***/ }), + +/***/ 15130: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['cleanrooms'] = {}; +AWS.CleanRooms = Service.defineService('cleanrooms', ['2022-02-17']); +Object.defineProperty(apiLoader.services['cleanrooms'], '2022-02-17', { + get: function get() { + var model = __nccwpck_require__(11585); + model.paginators = (__nccwpck_require__(73060)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(29284)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.CleanRooms; + + /***/ }), /***/ 85473: @@ -185263,6 +184951,31 @@ Object.defineProperty(apiLoader.services['cloudtrail'], '2013-11-01', { module.exports = AWS.CloudTrail; +/***/ }), + +/***/ 31191: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['cloudtraildata'] = {}; +AWS.CloudTrailData = Service.defineService('cloudtraildata', ['2021-08-11']); +Object.defineProperty(apiLoader.services['cloudtraildata'], '2021-08-11', { + get: function get() { + var model = __nccwpck_require__(27372); + model.paginators = (__nccwpck_require__(79223)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.CloudTrailData; + + /***/ }), /***/ 6763: @@ -185389,6 +185102,32 @@ Object.defineProperty(apiLoader.services['codebuild'], '2016-10-06', { module.exports = AWS.CodeBuild; +/***/ }), + +/***/ 19499: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['codecatalyst'] = {}; +AWS.CodeCatalyst = Service.defineService('codecatalyst', ['2022-09-28']); +Object.defineProperty(apiLoader.services['codecatalyst'], '2022-09-28', { + get: function get() { + var model = __nccwpck_require__(22999); + model.paginators = (__nccwpck_require__(14522)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(42522)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.CodeCatalyst; + + /***/ }), /***/ 71323: @@ -185491,6 +185230,31 @@ Object.defineProperty(apiLoader.services['codegurureviewer'], '2019-09-19', { module.exports = AWS.CodeGuruReviewer; +/***/ }), + +/***/ 32620: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['codegurusecurity'] = {}; +AWS.CodeGuruSecurity = Service.defineService('codegurusecurity', ['2018-05-10']); +Object.defineProperty(apiLoader.services['codegurusecurity'], '2018-05-10', { + get: function get() { + var model = __nccwpck_require__(7662); + model.paginators = (__nccwpck_require__(77755)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.CodeGuruSecurity; + + /***/ }), /***/ 22938: @@ -185791,6 +185555,56 @@ Object.defineProperty(apiLoader.services['connect'], '2017-08-08', { module.exports = AWS.Connect; +/***/ }), + +/***/ 42789: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['connectcampaigns'] = {}; +AWS.ConnectCampaigns = Service.defineService('connectcampaigns', ['2021-01-30']); +Object.defineProperty(apiLoader.services['connectcampaigns'], '2021-01-30', { + get: function get() { + var model = __nccwpck_require__(71566); + model.paginators = (__nccwpck_require__(45198)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.ConnectCampaigns; + + +/***/ }), + +/***/ 72223: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['connectcases'] = {}; +AWS.ConnectCases = Service.defineService('connectcases', ['2022-10-03']); +Object.defineProperty(apiLoader.services['connectcases'], '2022-10-03', { + get: function get() { + var model = __nccwpck_require__(3923); + model.paginators = (__nccwpck_require__(8429)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.ConnectCases; + + /***/ }), /***/ 41847: @@ -185841,6 +185655,31 @@ Object.defineProperty(apiLoader.services['connectparticipant'], '2018-09-07', { module.exports = AWS.ConnectParticipant; +/***/ }), + +/***/ 77574: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['controltower'] = {}; +AWS.ControlTower = Service.defineService('controltower', ['2018-05-10']); +Object.defineProperty(apiLoader.services['controltower'], '2018-05-10', { + get: function get() { + var model = __nccwpck_require__(1095); + model.paginators = (__nccwpck_require__(55167)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.ControlTower; + + /***/ }), /***/ 79523: @@ -185957,6 +185796,7 @@ Object.defineProperty(apiLoader.services['dataexchange'], '2017-07-25', { get: function get() { var model = __nccwpck_require__(42346); model.paginators = (__nccwpck_require__(55607)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(43176)/* .waiters */ .V); return model; }, enumerable: true, @@ -186269,6 +186109,31 @@ Object.defineProperty(apiLoader.services['docdb'], '2014-10-31', { module.exports = AWS.DocDB; +/***/ }), + +/***/ 20792: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['docdbelastic'] = {}; +AWS.DocDBElastic = Service.defineService('docdbelastic', ['2022-11-28']); +Object.defineProperty(apiLoader.services['docdbelastic'], '2022-11-28', { + get: function get() { + var model = __nccwpck_require__(34162); + model.paginators = (__nccwpck_require__(89093)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.DocDBElastic; + + /***/ }), /***/ 41116: @@ -186767,6 +186632,56 @@ Object.defineProperty(apiLoader.services['emrcontainers'], '2020-10-01', { module.exports = AWS.EMRcontainers; +/***/ }), + +/***/ 219: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['emrserverless'] = {}; +AWS.EMRServerless = Service.defineService('emrserverless', ['2021-07-13']); +Object.defineProperty(apiLoader.services['emrserverless'], '2021-07-13', { + get: function get() { + var model = __nccwpck_require__(41070); + model.paginators = (__nccwpck_require__(39521)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.EMRServerless; + + +/***/ }), + +/***/ 22697: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['entityresolution'] = {}; +AWS.EntityResolution = Service.defineService('entityresolution', ['2018-05-10']); +Object.defineProperty(apiLoader.services['entityresolution'], '2018-05-10', { + get: function get() { + var model = __nccwpck_require__(61033); + model.paginators = (__nccwpck_require__(37403)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.EntityResolution; + + /***/ }), /***/ 84462: @@ -186804,6 +186719,7 @@ var apiLoader = AWS.apiLoader; apiLoader.services['eventbridge'] = {}; AWS.EventBridge = Service.defineService('eventbridge', ['2015-10-07']); +__nccwpck_require__(3034); Object.defineProperty(apiLoader.services['eventbridge'], '2015-10-07', { get: function get() { var model = __nccwpck_require__(9659); @@ -187092,6 +187008,31 @@ Object.defineProperty(apiLoader.services['gamelift'], '2015-10-01', { module.exports = AWS.GameLift; +/***/ }), + +/***/ 83025: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['gamesparks'] = {}; +AWS.GameSparks = Service.defineService('gamesparks', ['2021-08-17']); +Object.defineProperty(apiLoader.services['gamesparks'], '2021-08-17', { + get: function get() { + var model = __nccwpck_require__(54092); + model.paginators = (__nccwpck_require__(51734)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.GameSparks; + + /***/ }), /***/ 63249: @@ -187259,6 +187200,7 @@ Object.defineProperty(apiLoader.services['groundstation'], '2019-05-23', { get: function get() { var model = __nccwpck_require__(27733); model.paginators = (__nccwpck_require__(55974)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(77815)/* .waiters */ .V); return model; }, enumerable: true, @@ -187519,6 +187461,32 @@ Object.defineProperty(apiLoader.services['inspector2'], '2020-06-08', { module.exports = AWS.Inspector2; +/***/ }), + +/***/ 84099: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['internetmonitor'] = {}; +AWS.InternetMonitor = Service.defineService('internetmonitor', ['2021-06-03']); +Object.defineProperty(apiLoader.services['internetmonitor'], '2021-06-03', { + get: function get() { + var model = __nccwpck_require__(62158); + model.paginators = (__nccwpck_require__(64409)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(76543)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.InternetMonitor; + + /***/ }), /***/ 98392: @@ -187744,6 +187712,32 @@ Object.defineProperty(apiLoader.services['iotfleethub'], '2020-11-03', { module.exports = AWS.IoTFleetHub; +/***/ }), + +/***/ 94329: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['iotfleetwise'] = {}; +AWS.IoTFleetWise = Service.defineService('iotfleetwise', ['2021-06-17']); +Object.defineProperty(apiLoader.services['iotfleetwise'], '2021-06-17', { + get: function get() { + var model = __nccwpck_require__(68937); + model.paginators = (__nccwpck_require__(85715)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(23391)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.IoTFleetWise; + + /***/ }), /***/ 42332: @@ -187769,6 +187763,31 @@ Object.defineProperty(apiLoader.services['iotjobsdataplane'], '2017-09-29', { module.exports = AWS.IoTJobsDataPlane; +/***/ }), + +/***/ 22163: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['iotroborunner'] = {}; +AWS.IoTRoboRunner = Service.defineService('iotroborunner', ['2018-05-10']); +Object.defineProperty(apiLoader.services['iotroborunner'], '2018-05-10', { + get: function get() { + var model = __nccwpck_require__(11483); + model.paginators = (__nccwpck_require__(82393)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.IoTRoboRunner; + + /***/ }), /***/ 98562: @@ -187921,6 +187940,56 @@ Object.defineProperty(apiLoader.services['ivs'], '2020-07-14', { module.exports = AWS.IVS; +/***/ }), + +/***/ 17077: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['ivschat'] = {}; +AWS.Ivschat = Service.defineService('ivschat', ['2020-07-14']); +Object.defineProperty(apiLoader.services['ivschat'], '2020-07-14', { + get: function get() { + var model = __nccwpck_require__(77512); + model.paginators = (__nccwpck_require__(85556)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.Ivschat; + + +/***/ }), + +/***/ 51946: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['ivsrealtime'] = {}; +AWS.IVSRealTime = Service.defineService('ivsrealtime', ['2020-07-14']); +Object.defineProperty(apiLoader.services['ivsrealtime'], '2020-07-14', { + get: function get() { + var model = __nccwpck_require__(23084); + model.paginators = (__nccwpck_require__(64507)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.IVSRealTime; + + /***/ }), /***/ 56775: @@ -187996,6 +188065,57 @@ Object.defineProperty(apiLoader.services['kendra'], '2019-02-03', { module.exports = AWS.Kendra; +/***/ }), + +/***/ 46255: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['kendraranking'] = {}; +AWS.KendraRanking = Service.defineService('kendraranking', ['2022-10-19']); +Object.defineProperty(apiLoader.services['kendraranking'], '2022-10-19', { + get: function get() { + var model = __nccwpck_require__(66044); + model.paginators = (__nccwpck_require__(38563)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.KendraRanking; + + +/***/ }), + +/***/ 24789: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['keyspaces'] = {}; +AWS.Keyspaces = Service.defineService('keyspaces', ['2022-02-10']); +Object.defineProperty(apiLoader.services['keyspaces'], '2022-02-10', { + get: function get() { + var model = __nccwpck_require__(59857); + model.paginators = (__nccwpck_require__(19252)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(53164)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.Keyspaces; + + /***/ }), /***/ 49876: @@ -188172,6 +188292,31 @@ Object.defineProperty(apiLoader.services['kinesisvideosignalingchannels'], '2019 module.exports = AWS.KinesisVideoSignalingChannels; +/***/ }), + +/***/ 52642: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['kinesisvideowebrtcstorage'] = {}; +AWS.KinesisVideoWebRTCStorage = Service.defineService('kinesisvideowebrtcstorage', ['2018-05-10']); +Object.defineProperty(apiLoader.services['kinesisvideowebrtcstorage'], '2018-05-10', { + get: function get() { + var model = __nccwpck_require__(62761); + model.paginators = (__nccwpck_require__(3540)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.KinesisVideoWebRTCStorage; + + /***/ }), /***/ 56782: @@ -188384,6 +188529,56 @@ Object.defineProperty(apiLoader.services['licensemanager'], '2018-08-01', { module.exports = AWS.LicenseManager; +/***/ }), + +/***/ 52687: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['licensemanagerlinuxsubscriptions'] = {}; +AWS.LicenseManagerLinuxSubscriptions = Service.defineService('licensemanagerlinuxsubscriptions', ['2018-05-10']); +Object.defineProperty(apiLoader.services['licensemanagerlinuxsubscriptions'], '2018-05-10', { + get: function get() { + var model = __nccwpck_require__(94260); + model.paginators = (__nccwpck_require__(60467)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.LicenseManagerLinuxSubscriptions; + + +/***/ }), + +/***/ 37725: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['licensemanagerusersubscriptions'] = {}; +AWS.LicenseManagerUserSubscriptions = Service.defineService('licensemanagerusersubscriptions', ['2018-05-10']); +Object.defineProperty(apiLoader.services['licensemanagerusersubscriptions'], '2018-05-10', { + get: function get() { + var model = __nccwpck_require__(48338); + model.paginators = (__nccwpck_require__(84416)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.LicenseManagerUserSubscriptions; + + /***/ }), /***/ 22718: @@ -188509,6 +188704,31 @@ Object.defineProperty(apiLoader.services['lookoutvision'], '2020-11-20', { module.exports = AWS.LookoutVision; +/***/ }), + +/***/ 22482: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['m2'] = {}; +AWS.M2 = Service.defineService('m2', ['2021-04-28']); +Object.defineProperty(apiLoader.services['m2'], '2021-04-28', { + get: function get() { + var model = __nccwpck_require__(21363); + model.paginators = (__nccwpck_require__(96286)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.M2; + + /***/ }), /***/ 82907: @@ -188577,6 +188797,7 @@ Object.defineProperty(apiLoader.services['macie2'], '2020-01-01', { get: function get() { var model = __nccwpck_require__(50847); model.paginators = (__nccwpck_require__(25947)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(71131)/* .waiters */ .V); return model; }, enumerable: true, @@ -188611,6 +188832,32 @@ Object.defineProperty(apiLoader.services['managedblockchain'], '2018-09-24', { module.exports = AWS.ManagedBlockchain; +/***/ }), + +/***/ 51046: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['managedblockchainquery'] = {}; +AWS.ManagedBlockchainQuery = Service.defineService('managedblockchainquery', ['2023-05-04']); +Object.defineProperty(apiLoader.services['managedblockchainquery'], '2023-05-04', { + get: function get() { + var model = __nccwpck_require__(53546); + model.paginators = (__nccwpck_require__(95929)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(17688)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.ManagedBlockchainQuery; + + /***/ }), /***/ 2609: @@ -188813,6 +189060,32 @@ Object.defineProperty(apiLoader.services['mediapackage'], '2017-10-12', { module.exports = AWS.MediaPackage; +/***/ }), + +/***/ 53264: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['mediapackagev2'] = {}; +AWS.MediaPackageV2 = Service.defineService('mediapackagev2', ['2022-12-25']); +Object.defineProperty(apiLoader.services['mediapackagev2'], '2022-12-25', { + get: function get() { + var model = __nccwpck_require__(37594); + model.paginators = (__nccwpck_require__(44503)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(68906)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.MediaPackageV2; + + /***/ }), /***/ 14962: @@ -188913,6 +189186,32 @@ Object.defineProperty(apiLoader.services['mediatailor'], '2018-04-23', { module.exports = AWS.MediaTailor; +/***/ }), + +/***/ 79712: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['medicalimaging'] = {}; +AWS.MedicalImaging = Service.defineService('medicalimaging', ['2023-07-19']); +Object.defineProperty(apiLoader.services['medicalimaging'], '2023-07-19', { + get: function get() { + var model = __nccwpck_require__(46663); + model.paginators = (__nccwpck_require__(63177)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(63171)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.MedicalImaging; + + /***/ }), /***/ 50782: @@ -189013,6 +189312,32 @@ Object.defineProperty(apiLoader.services['migrationhubconfig'], '2019-06-30', { module.exports = AWS.MigrationHubConfig; +/***/ }), + +/***/ 66120: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['migrationhuborchestrator'] = {}; +AWS.MigrationHubOrchestrator = Service.defineService('migrationhuborchestrator', ['2021-08-28']); +Object.defineProperty(apiLoader.services['migrationhuborchestrator'], '2021-08-28', { + get: function get() { + var model = __nccwpck_require__(73093); + model.paginators = (__nccwpck_require__(24233)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(83173)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.MigrationHubOrchestrator; + + /***/ }), /***/ 2925: @@ -189290,6 +189615,57 @@ Object.defineProperty(apiLoader.services['nimble'], '2020-08-01', { module.exports = AWS.Nimble; +/***/ }), + +/***/ 9319: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['oam'] = {}; +AWS.OAM = Service.defineService('oam', ['2022-06-10']); +Object.defineProperty(apiLoader.services['oam'], '2022-06-10', { + get: function get() { + var model = __nccwpck_require__(13463); + model.paginators = (__nccwpck_require__(55717)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.OAM; + + +/***/ }), + +/***/ 75114: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['omics'] = {}; +AWS.Omics = Service.defineService('omics', ['2022-11-28']); +Object.defineProperty(apiLoader.services['omics'], '2022-11-28', { + get: function get() { + var model = __nccwpck_require__(74258); + model.paginators = (__nccwpck_require__(78278)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(31165)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.Omics; + + /***/ }), /***/ 60358: @@ -189315,6 +189691,31 @@ Object.defineProperty(apiLoader.services['opensearch'], '2021-01-01', { module.exports = AWS.OpenSearch; +/***/ }), + +/***/ 86277: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['opensearchserverless'] = {}; +AWS.OpenSearchServerless = Service.defineService('opensearchserverless', ['2021-11-01']); +Object.defineProperty(apiLoader.services['opensearchserverless'], '2021-11-01', { + get: function get() { + var model = __nccwpck_require__(61668); + model.paginators = (__nccwpck_require__(68785)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.OpenSearchServerless; + + /***/ }), /***/ 75691: @@ -189392,6 +189793,31 @@ Object.defineProperty(apiLoader.services['organizations'], '2016-11-28', { module.exports = AWS.Organizations; +/***/ }), + +/***/ 98021: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['osis'] = {}; +AWS.OSIS = Service.defineService('osis', ['2022-01-01']); +Object.defineProperty(apiLoader.services['osis'], '2022-01-01', { + get: function get() { + var model = __nccwpck_require__(51838); + model.paginators = (__nccwpck_require__(72472)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.OSIS; + + /***/ }), /***/ 27551: @@ -189442,6 +189868,56 @@ Object.defineProperty(apiLoader.services['panorama'], '2019-07-24', { module.exports = AWS.Panorama; +/***/ }), + +/***/ 11594: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['paymentcryptography'] = {}; +AWS.PaymentCryptography = Service.defineService('paymentcryptography', ['2021-09-14']); +Object.defineProperty(apiLoader.services['paymentcryptography'], '2021-09-14', { + get: function get() { + var model = __nccwpck_require__(86072); + model.paginators = (__nccwpck_require__(17819)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.PaymentCryptography; + + +/***/ }), + +/***/ 96559: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['paymentcryptographydata'] = {}; +AWS.PaymentCryptographyData = Service.defineService('paymentcryptographydata', ['2022-02-03']); +Object.defineProperty(apiLoader.services['paymentcryptographydata'], '2022-02-03', { + get: function get() { + var model = __nccwpck_require__(68578); + model.paginators = (__nccwpck_require__(89757)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.PaymentCryptographyData; + + /***/ }), /***/ 33696: @@ -189615,6 +190091,57 @@ Object.defineProperty(apiLoader.services['pinpointsmsvoice'], '2018-09-05', { module.exports = AWS.PinpointSMSVoice; +/***/ }), + +/***/ 478: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['pinpointsmsvoicev2'] = {}; +AWS.PinpointSMSVoiceV2 = Service.defineService('pinpointsmsvoicev2', ['2022-03-31']); +Object.defineProperty(apiLoader.services['pinpointsmsvoicev2'], '2022-03-31', { + get: function get() { + var model = __nccwpck_require__(88319); + model.paginators = (__nccwpck_require__(80650)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(6663)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.PinpointSMSVoiceV2; + + +/***/ }), + +/***/ 14220: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['pipes'] = {}; +AWS.Pipes = Service.defineService('pipes', ['2015-10-07']); +Object.defineProperty(apiLoader.services['pipes'], '2015-10-07', { + get: function get() { + var model = __nccwpck_require__(40616); + model.paginators = (__nccwpck_require__(17710)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.Pipes; + + /***/ }), /***/ 97332: @@ -189657,6 +190184,7 @@ Object.defineProperty(apiLoader.services['pricing'], '2017-10-15', { get: function get() { var model = __nccwpck_require__(22484); model.paginators = (__nccwpck_require__(60369)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(41996)/* .waiters */ .V); return model; }, enumerable: true, @@ -189666,6 +190194,31 @@ Object.defineProperty(apiLoader.services['pricing'], '2017-10-15', { module.exports = AWS.Pricing; +/***/ }), + +/***/ 63088: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['privatenetworks'] = {}; +AWS.PrivateNetworks = Service.defineService('privatenetworks', ['2021-12-03']); +Object.defineProperty(apiLoader.services['privatenetworks'], '2021-12-03', { + get: function get() { + var model = __nccwpck_require__(46306); + model.paginators = (__nccwpck_require__(42771)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.PrivateNetworks; + + /***/ }), /***/ 9275: @@ -189958,6 +190511,31 @@ Object.defineProperty(apiLoader.services['redshiftdata'], '2019-12-20', { module.exports = AWS.RedshiftData; +/***/ }), + +/***/ 29987: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['redshiftserverless'] = {}; +AWS.RedshiftServerless = Service.defineService('redshiftserverless', ['2021-04-21']); +Object.defineProperty(apiLoader.services['redshiftserverless'], '2021-04-21', { + get: function get() { + var model = __nccwpck_require__(95705); + model.paginators = (__nccwpck_require__(892)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.RedshiftServerless; + + /***/ }), /***/ 65470: @@ -190009,6 +190587,31 @@ Object.defineProperty(apiLoader.services['resiliencehub'], '2020-04-30', { module.exports = AWS.Resiliencehub; +/***/ }), + +/***/ 74071: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['resourceexplorer2'] = {}; +AWS.ResourceExplorer2 = Service.defineService('resourceexplorer2', ['2022-07-28']); +Object.defineProperty(apiLoader.services['resourceexplorer2'], '2022-07-28', { + get: function get() { + var model = __nccwpck_require__(26515); + model.paginators = (__nccwpck_require__(8580)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.ResourceExplorer2; + + /***/ }), /***/ 58756: @@ -190084,6 +190687,31 @@ Object.defineProperty(apiLoader.services['robomaker'], '2018-06-29', { module.exports = AWS.RoboMaker; +/***/ }), + +/***/ 83604: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['rolesanywhere'] = {}; +AWS.RolesAnywhere = Service.defineService('rolesanywhere', ['2018-05-10']); +Object.defineProperty(apiLoader.services['rolesanywhere'], '2018-05-10', { + get: function get() { + var model = __nccwpck_require__(80801); + model.paginators = (__nccwpck_require__(65955)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.RolesAnywhere; + + /***/ }), /***/ 44968: @@ -190416,6 +191044,56 @@ Object.defineProperty(apiLoader.services['sagemakerfeaturestoreruntime'], '2020- module.exports = AWS.SageMakerFeatureStoreRuntime; +/***/ }), + +/***/ 4707: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['sagemakergeospatial'] = {}; +AWS.SageMakerGeospatial = Service.defineService('sagemakergeospatial', ['2020-05-27']); +Object.defineProperty(apiLoader.services['sagemakergeospatial'], '2020-05-27', { + get: function get() { + var model = __nccwpck_require__(26059); + model.paginators = (__nccwpck_require__(99606)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.SageMakerGeospatial; + + +/***/ }), + +/***/ 28199: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['sagemakermetrics'] = {}; +AWS.SageMakerMetrics = Service.defineService('sagemakermetrics', ['2022-09-30']); +Object.defineProperty(apiLoader.services['sagemakermetrics'], '2022-09-30', { + get: function get() { + var model = __nccwpck_require__(89834); + model.paginators = (__nccwpck_require__(80107)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.SageMakerMetrics; + + /***/ }), /***/ 85044: @@ -190466,6 +191144,31 @@ Object.defineProperty(apiLoader.services['savingsplans'], '2019-06-28', { module.exports = AWS.SavingsPlans; +/***/ }), + +/***/ 94840: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['scheduler'] = {}; +AWS.Scheduler = Service.defineService('scheduler', ['2021-06-30']); +Object.defineProperty(apiLoader.services['scheduler'], '2021-06-30', { + get: function get() { + var model = __nccwpck_require__(36876); + model.paginators = (__nccwpck_require__(54594)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.Scheduler; + + /***/ }), /***/ 55713: @@ -190542,6 +191245,31 @@ Object.defineProperty(apiLoader.services['securityhub'], '2018-10-26', { module.exports = AWS.SecurityHub; +/***/ }), + +/***/ 84296: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['securitylake'] = {}; +AWS.SecurityLake = Service.defineService('securitylake', ['2018-05-10']); +Object.defineProperty(apiLoader.services['securitylake'], '2018-05-10', { + get: function get() { + var model = __nccwpck_require__(26935); + model.paginators = (__nccwpck_require__(42170)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.SecurityLake; + + /***/ }), /***/ 62402: @@ -190794,6 +191522,31 @@ Object.defineProperty(apiLoader.services['simpledb'], '2009-04-15', { module.exports = AWS.SimpleDB; +/***/ }), + +/***/ 37090: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['simspaceweaver'] = {}; +AWS.SimSpaceWeaver = Service.defineService('simspaceweaver', ['2022-10-28']); +Object.defineProperty(apiLoader.services['simspaceweaver'], '2022-10-28', { + get: function get() { + var model = __nccwpck_require__(92139); + model.paginators = (__nccwpck_require__(31849)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.SimSpaceWeaver; + + /***/ }), /***/ 57719: @@ -190997,6 +191750,31 @@ Object.defineProperty(apiLoader.services['ssmincidents'], '2018-05-10', { module.exports = AWS.SSMIncidents; +/***/ }), + +/***/ 44552: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['ssmsap'] = {}; +AWS.SsmSap = Service.defineService('ssmsap', ['2018-05-10']); +Object.defineProperty(apiLoader.services['ssmsap'], '2018-05-10', { + get: function get() { + var model = __nccwpck_require__(49218); + model.paginators = (__nccwpck_require__(94718)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.SsmSap; + + /***/ }), /***/ 71096: @@ -191173,6 +191951,31 @@ Object.defineProperty(apiLoader.services['support'], '2013-04-15', { module.exports = AWS.Support; +/***/ }), + +/***/ 51288: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['supportapp'] = {}; +AWS.SupportApp = Service.defineService('supportapp', ['2021-08-20']); +Object.defineProperty(apiLoader.services['supportapp'], '2021-08-20', { + get: function get() { + var model = __nccwpck_require__(94851); + model.paginators = (__nccwpck_require__(60546)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.SupportApp; + + /***/ }), /***/ 32327: @@ -191299,6 +192102,31 @@ Object.defineProperty(apiLoader.services['timestreamwrite'], '2018-11-01', { module.exports = AWS.TimestreamWrite; +/***/ }), + +/***/ 15300: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['tnb'] = {}; +AWS.Tnb = Service.defineService('tnb', ['2008-10-21']); +Object.defineProperty(apiLoader.services['tnb'], '2008-10-21', { + get: function get() { + var model = __nccwpck_require__(1433); + model.paginators = (__nccwpck_require__(55995)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.Tnb; + + /***/ }), /***/ 75811: @@ -191340,6 +192168,7 @@ Object.defineProperty(apiLoader.services['transfer'], '2018-11-05', { get: function get() { var model = __nccwpck_require__(93419); model.paginators = (__nccwpck_require__(65803)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(45405)/* .waiters */ .V); return model; }, enumerable: true, @@ -191374,6 +192203,32 @@ Object.defineProperty(apiLoader.services['translate'], '2017-07-01', { module.exports = AWS.Translate; +/***/ }), + +/***/ 35604: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['verifiedpermissions'] = {}; +AWS.VerifiedPermissions = Service.defineService('verifiedpermissions', ['2021-12-01']); +Object.defineProperty(apiLoader.services['verifiedpermissions'], '2021-12-01', { + get: function get() { + var model = __nccwpck_require__(31407); + model.paginators = (__nccwpck_require__(85997)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(14021)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.VerifiedPermissions; + + /***/ }), /***/ 28747: @@ -191399,6 +192254,31 @@ Object.defineProperty(apiLoader.services['voiceid'], '2021-09-27', { module.exports = AWS.VoiceID; +/***/ }), + +/***/ 78952: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['vpclattice'] = {}; +AWS.VPCLattice = Service.defineService('vpclattice', ['2022-11-30']); +Object.defineProperty(apiLoader.services['vpclattice'], '2022-11-30', { + get: function get() { + var model = __nccwpck_require__(49656); + model.paginators = (__nccwpck_require__(98717)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.VPCLattice; + + /***/ }), /***/ 72742: @@ -192409,6 +193289,82 @@ AWS.Config = AWS.util.inherit({ } }, + /** + * Loads token from the configuration object. This is used internally + * by the SDK to ensure that refreshable {Token} objects are properly + * refreshed and loaded when sending a request. If you want to ensure that + * your token is loaded prior to a request, you can use this method + * directly to provide accurate token data stored in the object. + * + * @note If you configure the SDK with static token, the token data should + * already be present in {token} attribute. This method is primarily necessary + * to load token from asynchronous sources, or sources that can refresh + * token periodically. + * @example Getting your access token + * AWS.config.getToken(function(err) { + * if (err) console.log(err.stack); // token not loaded + * else console.log("Token:", AWS.config.token.token); + * }) + * @callback callback function(err) + * Called when the {token} have been properly set on the configuration object. + * + * @param err [Error] if this is set, token was not successfully loaded and + * this error provides information why. + * @see token + */ + getToken: function getToken(callback) { + var self = this; + + function finish(err) { + callback(err, err ? null : self.token); + } + + function tokenError(msg, err) { + return new AWS.util.error(err || new Error(), { + code: 'TokenError', + message: msg, + name: 'TokenError' + }); + } + + function getAsyncToken() { + self.token.get(function(err) { + if (err) { + var msg = 'Could not load token from ' + + self.token.constructor.name; + err = tokenError(msg, err); + } + finish(err); + }); + } + + function getStaticToken() { + var err = null; + if (!self.token.token) { + err = tokenError('Missing token'); + } + finish(err); + } + + if (self.token) { + if (typeof self.token.get === 'function') { + getAsyncToken(); + } else { // static token + getStaticToken(); + } + } else if (self.tokenProvider) { + self.tokenProvider.resolve(function(err, token) { + if (err) { + err = tokenError('Could not load token from any providers', err); + } + self.token = token; + finish(err); + }); + } else { + finish(tokenError('No token to load')); + } + }, + /** * @!group Loading and Setting Configuration Options */ @@ -192542,7 +193498,8 @@ AWS.Config = AWS.util.inherit({ hostPrefixEnabled: true, stsRegionalEndpoints: 'legacy', useFipsEndpoint: false, - useDualstackEndpoint: false + useDualstackEndpoint: false, + token: null }, /** @@ -192698,7 +193655,7 @@ AWS.util.update(AWS, { /** * @constant */ - VERSION: '2.1082.0', + VERSION: '2.1437.0', /** * @api private @@ -192763,6 +193720,7 @@ __nccwpck_require__(58743); __nccwpck_require__(39925); __nccwpck_require__(9897); __nccwpck_require__(99127); +__nccwpck_require__(93985); /** * @readonly @@ -193798,6 +194756,7 @@ AWS.CredentialProviderChain = AWS.util.inherit(AWS.Credentials, { * AWS.CredentialProviderChain.defaultProviders = [ * function () { return new AWS.EnvironmentCredentials('AWS'); }, * function () { return new AWS.EnvironmentCredentials('AMAZON'); }, + * function () { return new AWS.SsoCredentials(); }, * function () { return new AWS.SharedIniFileCredentials(); }, * function () { return new AWS.ECSCredentials(); }, * function () { return new AWS.ProcessCredentials(); }, @@ -193850,15 +194809,27 @@ __nccwpck_require__(25768); * AWS.config.credentials = new AWS.EC2MetadataCredentials({ * httpOptions: { timeout: 5000 }, // 5 second timeout * maxRetries: 10, // retry 10 times - * retryDelayOptions: { base: 200 } // see AWS.Config for information + * retryDelayOptions: { base: 200 }, // see AWS.Config for information + * logger: console // see AWS.Config for information * }); + * ``` * * If your requests are timing out in connecting to the metadata service, such * as when testing on a development machine, you can use the connectTimeout * option, specified in milliseconds, which also defaults to 1 second. - * ``` + * + * If the requests failed or returns expired credentials, it will + * extend the expiration of current credential, with a warning message. For more + * information, please go to: + * https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html + * + * @!attribute originalExpiration + * @return [Date] The optional original expiration of the current credential. + * In case of AWS outage, the EC2 metadata will extend expiration of the + * existing credential. * * @see AWS.Config.retryDelayOptions + * @see AWS.Config.logger * * @!macro nobrowser */ @@ -193876,7 +194847,7 @@ AWS.EC2MetadataCredentials = AWS.util.inherit(AWS.Credentials, { options.httpOptions); this.metadataService = new AWS.MetadataService(options); - this.metadata = {}; + this.logger = options.logger || AWS.config && AWS.config.logger; }, /** @@ -193894,6 +194865,13 @@ AWS.EC2MetadataCredentials = AWS.util.inherit(AWS.Credentials, { */ defaultMaxRetries: 3, + /** + * The original expiration of the current credential. In case of AWS + * outage, the EC2 metadata will extend expiration of the existing + * credential. + */ + originalExpiration: undefined, + /** * Loads the credentials from the instance metadata service * @@ -193916,25 +194894,63 @@ AWS.EC2MetadataCredentials = AWS.util.inherit(AWS.Credentials, { load: function load(callback) { var self = this; self.metadataService.loadCredentials(function(err, creds) { - if (!err) { - var currentTime = AWS.util.date.getDate(); - var expireTime = new Date(creds.Expiration); - if (expireTime < currentTime) { - err = AWS.util.error( - new Error('EC2 Instance Metadata Serivce provided expired credentials'), - { code: 'EC2MetadataCredentialsProviderFailure' } - ); + if (err) { + if (self.hasLoadedCredentials()) { + self.extendExpirationIfExpired(); + callback(); } else { - self.expired = false; - self.metadata = creds; - self.accessKeyId = creds.AccessKeyId; - self.secretAccessKey = creds.SecretAccessKey; - self.sessionToken = creds.Token; - self.expireTime = expireTime; + callback(err); } + } else { + self.setCredentials(creds); + self.extendExpirationIfExpired(); + callback(); } - callback(err); }); + }, + + /** + * Whether this credential has been loaded. + * @api private + */ + hasLoadedCredentials: function hasLoadedCredentials() { + return this.AccessKeyId && this.secretAccessKey; + }, + + /** + * if expired, extend the expiration by 15 minutes base plus a jitter of 5 + * minutes range. + * @api private + */ + extendExpirationIfExpired: function extendExpirationIfExpired() { + if (this.needsRefresh()) { + this.originalExpiration = this.originalExpiration || this.expireTime; + this.expired = false; + var nextTimeout = 15 * 60 + Math.floor(Math.random() * 5 * 60); + var currentTime = AWS.util.date.getDate().getTime(); + this.expireTime = new Date(currentTime + nextTimeout * 1000); + // TODO: add doc link; + this.logger.warn('Attempting credential expiration extension due to a ' + + 'credential service availability issue. A refresh of these ' + + 'credentials will be attempted again at ' + this.expireTime + + '\nFor more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html'); + } + }, + + /** + * Update the credential with new credential responded from EC2 metadata + * service. + * @api private + */ + setCredentials: function setCredentials(creds) { + var currentTime = AWS.util.date.getDate().getTime(); + var expireTime = new Date(creds.Expiration); + this.expired = currentTime >= expireTime ? true : false; + this.metadata = creds; + this.accessKeyId = creds.AccessKeyId; + this.secretAccessKey = creds.SecretAccessKey; + this.sessionToken = creds.Token; + this.expireTime = expireTime; } }); @@ -194834,6 +195850,7 @@ AWS.SharedIniFileCredentials = AWS.util.inherit(AWS.Credentials, { var externalId = roleProfile['external_id']; var mfaSerial = roleProfile['mfa_serial']; var sourceProfileName = roleProfile['source_profile']; + var durationSeconds = parseInt(roleProfile['duration_seconds'], 10) || undefined; // From experimentation, the following behavior mimics the AWS CLI: // @@ -194888,6 +195905,7 @@ AWS.SharedIniFileCredentials = AWS.util.inherit(AWS.Credentials, { }); var roleParams = { + DurationSeconds: durationSeconds, RoleArn: roleArn, RoleSessionName: roleSessionName || 'aws-sdk-js-' + Date.now() }; @@ -194924,6 +195942,261 @@ AWS.SharedIniFileCredentials = AWS.util.inherit(AWS.Credentials, { }); +/***/ }), + +/***/ 68335: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + +var AWS = __nccwpck_require__(28437); +var path = __nccwpck_require__(71017); +var crypto = __nccwpck_require__(6113); +var iniLoader = AWS.util.iniLoader; + +/** + * Represents credentials from sso.getRoleCredentials API for + * `sso_*` values defined in shared credentials file. + * + * ## Using SSO credentials + * + * The credentials file must specify the information below to use sso: + * + * [profile sso-profile] + * sso_account_id = 012345678901 + * sso_region = **-****-* + * sso_role_name = SampleRole + * sso_start_url = https://d-******.awsapps.com/start + * + * or using the session format: + * + * [profile sso-token] + * sso_session = prod + * sso_account_id = 012345678901 + * sso_role_name = SampleRole + * + * [sso-session prod] + * sso_region = **-****-* + * sso_start_url = https://d-******.awsapps.com/start + * + * This information will be automatically added to your shared credentials file by running + * `aws configure sso`. + * + * ## Using custom profiles + * + * The SDK supports loading credentials for separate profiles. This can be done + * in two ways: + * + * 1. Set the `AWS_PROFILE` environment variable in your process prior to + * loading the SDK. + * 2. Directly load the AWS.SsoCredentials provider: + * + * ```javascript + * var creds = new AWS.SsoCredentials({profile: 'myprofile'}); + * AWS.config.credentials = creds; + * ``` + * + * @!macro nobrowser + */ +AWS.SsoCredentials = AWS.util.inherit(AWS.Credentials, { + /** + * Creates a new SsoCredentials object. + * + * @param options [map] a set of options + * @option options profile [String] (AWS_PROFILE env var or 'default') + * the name of the profile to load. + * @option options filename [String] ('~/.aws/credentials' or defined by + * AWS_SHARED_CREDENTIALS_FILE process env var) + * the filename to use when loading credentials. + * @option options callback [Function] (err) Credentials are eagerly loaded + * by the constructor. When the callback is called with no error, the + * credentials have been loaded successfully. + */ + constructor: function SsoCredentials(options) { + AWS.Credentials.call(this); + + options = options || {}; + this.errorCode = 'SsoCredentialsProviderFailure'; + this.expired = true; + + this.filename = options.filename; + this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; + this.service = options.ssoClient; + this.httpOptions = options.httpOptions || null; + this.get(options.callback || AWS.util.fn.noop); + }, + + /** + * @api private + */ + load: function load(callback) { + var self = this; + + try { + var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename); + var profile = profiles[this.profile] || {}; + + if (Object.keys(profile).length === 0) { + throw AWS.util.error( + new Error('Profile ' + this.profile + ' not found'), + { code: self.errorCode } + ); + } + + if (profile.sso_session) { + if (!profile.sso_account_id || !profile.sso_role_name) { + throw AWS.util.error( + new Error('Profile ' + this.profile + ' with session ' + profile.sso_session + + ' does not have valid SSO credentials. Required parameters "sso_account_id", "sso_session", ' + + '"sso_role_name". Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html'), + { code: self.errorCode } + ); + } + } else { + if (!profile.sso_start_url || !profile.sso_account_id || !profile.sso_region || !profile.sso_role_name) { + throw AWS.util.error( + new Error('Profile ' + this.profile + ' does not have valid SSO credentials. Required parameters "sso_account_id", "sso_region", ' + + '"sso_role_name", "sso_start_url". Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html'), + { code: self.errorCode } + ); + } + } + + this.getToken(this.profile, profile, function (err, token) { + if (err) { + return callback(err); + } + var request = { + accessToken: token, + accountId: profile.sso_account_id, + roleName: profile.sso_role_name, + }; + + if (!self.service || self.service.config.region !== profile.sso_region) { + self.service = new AWS.SSO({ + region: profile.sso_region, + httpOptions: self.httpOptions, + }); + } + + self.service.getRoleCredentials(request, function(err, data) { + if (err || !data || !data.roleCredentials) { + callback(AWS.util.error( + err || new Error('Please log in using "aws sso login"'), + { code: self.errorCode } + ), null); + } else if (!data.roleCredentials.accessKeyId || !data.roleCredentials.secretAccessKey || !data.roleCredentials.sessionToken || !data.roleCredentials.expiration) { + throw AWS.util.error(new Error( + 'SSO returns an invalid temporary credential.' + )); + } else { + self.expired = false; + self.accessKeyId = data.roleCredentials.accessKeyId; + self.secretAccessKey = data.roleCredentials.secretAccessKey; + self.sessionToken = data.roleCredentials.sessionToken; + self.expireTime = new Date(data.roleCredentials.expiration); + callback(null); + } + }); + }); + } catch (err) { + callback(err); + } + }, + + /** + * @private + * Uses legacy file system retrieval or if sso-session is set, + * use the SSOTokenProvider. + * + * @param {string} profileName - name of the profile. + * @param {object} profile - profile data containing sso_session or sso_start_url etc. + * @param {function} callback - called with (err, (string) token). + * + * @returns {void} + */ + getToken: function getToken(profileName, profile, callback) { + var self = this; + + if (profile.sso_session) { + var _iniLoader = AWS.util.iniLoader; + var ssoSessions = _iniLoader.loadSsoSessionsFrom(); + var ssoSession = ssoSessions[profile.sso_session]; + Object.assign(profile, ssoSession); + + var ssoTokenProvider = new AWS.SSOTokenProvider({ + profile: profileName, + }); + ssoTokenProvider.load(function (err) { + if (err) { + return callback(err); + } + return callback(null, ssoTokenProvider.token); + }); + return; + } + + try { + /** + * The time window (15 mins) that SDK will treat the SSO token expires in before the defined expiration date in token. + * This is needed because server side may have invalidated the token before the defined expiration date. + */ + var EXPIRE_WINDOW_MS = 15 * 60 * 1000; + var hasher = crypto.createHash('sha1'); + var fileName = hasher.update(profile.sso_start_url).digest('hex') + '.json'; + var cachePath = path.join( + iniLoader.getHomeDir(), + '.aws', + 'sso', + 'cache', + fileName + ); + var cacheFile = AWS.util.readFileSync(cachePath); + var cacheContent = null; + if (cacheFile) { + cacheContent = JSON.parse(cacheFile); + } + if (!cacheContent) { + throw AWS.util.error( + new Error('Cached credentials not found under ' + this.profile + ' profile. Please make sure you log in with aws sso login first'), + { code: self.errorCode } + ); + } + + if (!cacheContent.startUrl || !cacheContent.region || !cacheContent.accessToken || !cacheContent.expiresAt) { + throw AWS.util.error( + new Error('Cached credentials are missing required properties. Try running aws sso login.') + ); + } + + if (new Date(cacheContent.expiresAt).getTime() - Date.now() <= EXPIRE_WINDOW_MS) { + throw AWS.util.error(new Error( + 'The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.' + )); + } + + return callback(null, cacheContent.accessToken); + } catch (err) { + return callback(err, null); + } + }, + + /** + * Loads the credentials from the AWS SSO process + * + * @callback callback function(err) + * Called after the AWS SSO process has been executed. When this + * callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see get + */ + refresh: function refresh(callback) { + iniLoader.clearCachedFiles(); + this.coalesceRefresh(callback || AWS.util.fn.callback); + }, +}); + + /***/ }), /***/ 77360: @@ -196134,8 +197407,10 @@ AWS.DynamoDB.DocumentClient = AWS.util.inherit({ * @option options params [map] An optional map of parameters to bind to every * request sent by this service object. * @option options service [AWS.DynamoDB] An optional pre-configured instance - * of the AWS.DynamoDB service object to use for requests. The object may - * bound parameters used by the document client. + * of the AWS.DynamoDB service object. This instance's config will be + * copied to a new instance used by this client. You should not need to + * retain a reference to the input object, and may destroy it or allow it + * to be garbage collected. * @option options convertEmptyValues [Boolean] set to true if you would like * the document client to convert empty values (0-length strings, binary * buffers, and sets) to be converted to NULL types when persisting to @@ -197704,18 +198979,52 @@ function getOperationAuthtype(req) { return operation ? operation.authtype : ''; } +/** + * @api private + */ +function getIdentityType(req) { + var service = req.service; + + if (service.config.signatureVersion) { + return service.config.signatureVersion; + } + + if (service.api.signatureVersion) { + return service.api.signatureVersion; + } + + return getOperationAuthtype(req); +} + AWS.EventListeners = { Core: new SequentialExecutor().addNamedListeners(function(add, addAsync) { - addAsync('VALIDATE_CREDENTIALS', 'validate', - function VALIDATE_CREDENTIALS(req, done) { - if (!req.service.api.signatureVersion && !req.service.config.signatureVersion) return done(); // none - req.service.config.getCredentials(function(err) { - if (err) { - req.response.error = AWS.util.error(err, - {code: 'CredentialsError', message: 'Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1'}); + addAsync( + 'VALIDATE_CREDENTIALS', 'validate', + function VALIDATE_CREDENTIALS(req, done) { + if (!req.service.api.signatureVersion && !req.service.config.signatureVersion) return done(); // none + + var identityType = getIdentityType(req); + if (identityType === 'bearer') { + req.service.config.getToken(function(err) { + if (err) { + req.response.error = AWS.util.error(err, {code: 'TokenError'}); + } + done(); + }); + return; } - done(); - }); + + req.service.config.getCredentials(function(err) { + if (err) { + req.response.error = AWS.util.error(err, + { + code: 'CredentialsError', + message: 'Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1' + } + ); + } + done(); + }); }); add('VALIDATE_REGION', 'validate', function VALIDATE_REGION(req) { @@ -197842,6 +199151,24 @@ AWS.EventListeners = { req.httpRequest.headers['Host'] = req.httpRequest.endpoint.host; }); + add('SET_TRACE_ID', 'afterBuild', function SET_TRACE_ID(req) { + var traceIdHeaderName = 'X-Amzn-Trace-Id'; + if (AWS.util.isNode() && !Object.hasOwnProperty.call(req.httpRequest.headers, traceIdHeaderName)) { + var ENV_LAMBDA_FUNCTION_NAME = 'AWS_LAMBDA_FUNCTION_NAME'; + var ENV_TRACE_ID = '_X_AMZN_TRACE_ID'; + var functionName = process.env[ENV_LAMBDA_FUNCTION_NAME]; + var traceId = process.env[ENV_TRACE_ID]; + if ( + typeof functionName === 'string' && + functionName.length > 0 && + typeof traceId === 'string' && + traceId.length > 0 + ) { + req.httpRequest.headers[traceIdHeaderName] = traceId; + } + } + }); + add('RESTART', 'restart', function RESTART() { var err = this.response.error; if (!err || !err.retryable) return; @@ -197863,42 +199190,61 @@ AWS.EventListeners = { addAsync('SIGN', 'sign', function SIGN(req, done) { var service = req.service; - var operations = req.service.api.operations || {}; - var operation = operations[req.operation]; - var authtype = operation ? operation.authtype : ''; - if (!service.api.signatureVersion && !authtype && !service.config.signatureVersion) return done(); // none + var identityType = getIdentityType(req); + if (!identityType || identityType.length === 0) return done(); // none - service.config.getCredentials(function (err, credentials) { - if (err) { - req.response.error = err; - return done(); - } + if (identityType === 'bearer') { + service.config.getToken(function (err, token) { + if (err) { + req.response.error = err; + return done(); + } - try { - var date = service.getSkewCorrectedDate(); - var SignerClass = service.getSignerClass(req); - var signer = new SignerClass(req.httpRequest, - service.getSigningName(req), - { - signatureCache: service.config.signatureCache, - operation: operation, - signatureVersion: service.api.signatureVersion - }); - signer.setServiceClientId(service._clientId); + try { + var SignerClass = service.getSignerClass(req); + var signer = new SignerClass(req.httpRequest); + signer.addAuthorization(token); + } catch (e) { + req.response.error = e; + } + done(); + }); + } else { + service.config.getCredentials(function (err, credentials) { + if (err) { + req.response.error = err; + return done(); + } - // clear old authorization headers - delete req.httpRequest.headers['Authorization']; - delete req.httpRequest.headers['Date']; - delete req.httpRequest.headers['X-Amz-Date']; + try { + var date = service.getSkewCorrectedDate(); + var SignerClass = service.getSignerClass(req); + var operations = req.service.api.operations || {}; + var operation = operations[req.operation]; + var signer = new SignerClass(req.httpRequest, + service.getSigningName(req), + { + signatureCache: service.config.signatureCache, + operation: operation, + signatureVersion: service.api.signatureVersion + }); + signer.setServiceClientId(service._clientId); - // add new authorization - signer.addAuthorization(credentials, date); - req.signedAt = date; - } catch (e) { - req.response.error = e; - } - done(); - }); + // clear old authorization headers + delete req.httpRequest.headers['Authorization']; + delete req.httpRequest.headers['Date']; + delete req.httpRequest.headers['X-Amz-Date']; + + // add new authorization + signer.addAuthorization(credentials, date); + req.signedAt = date; + } catch (e) { + req.response.error = e; + } + done(); + }); + + } }); add('VALIDATE_RESPONSE', 'validateResponse', function VALIDATE_RESPONSE(resp) { @@ -197912,6 +199258,17 @@ AWS.EventListeners = { } }); + add('ERROR', 'error', function ERROR(err, resp) { + var awsQueryCompatible = resp.request.service.api.awsQueryCompatible; + if (awsQueryCompatible) { + var headers = resp.httpResponse.headers; + var queryErrorCode = headers ? headers['x-amzn-query-error'] : undefined; + if (queryErrorCode && queryErrorCode.includes(';')) { + resp.error.code = queryErrorCode.split(';')[0]; + } + } + }, true); + addAsync('SEND', 'send', function SEND(resp, done) { resp.httpResponse._abortCallback = done; resp.error = null; @@ -198262,6 +199619,7 @@ AWS.EventListeners = { add('BUILD', 'build', svc.buildRequest); add('EXTRACT_DATA', 'extractData', svc.extractData); add('EXTRACT_ERROR', 'extractError', svc.extractError); + add('UNSET_CONTENT_LENGTH', 'afterBuild', svc.unsetContentLength); }), RestXml: new SequentialExecutor().addNamedListeners(function(add) { @@ -198564,13 +199922,14 @@ AWS.NodeHttpClient = AWS.util.inherit({ path: pathPrefix + httpRequest.path }; + AWS.util.update(options, httpOptions); + if (!httpOptions.agent) { options.agent = this.getAgent(useSSL, { keepAlive: process.env[CONNECTION_REUSE_ENV_NAME] === '1' ? true : false }); } - AWS.util.update(options, httpOptions); delete options.proxy; // proxy isn't an HTTP option delete options.timeout; // timeout isn't an HTTP option @@ -198894,6 +200253,60 @@ function translateScalar(value, shape) { module.exports = JsonParser; +/***/ }), + +/***/ 93985: +/***/ ((module) => { + +var warning = [ + 'We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.\n', + 'Please migrate your code to use AWS SDK for JavaScript (v3).', + 'For more information, check the migration guide at https://a.co/7PzMCcy' +].join('\n'); + +module.exports = { + suppress: false +}; + +/** + * To suppress this message: + * @example + * require('aws-sdk/lib/maintenance_mode_message').suppress = true; + */ +function emitWarning() { + if (typeof process === 'undefined') + return; + + // Skip maintenance mode message in Lambda environments + if ( + typeof process.env === 'object' && + typeof process.env.AWS_EXECUTION_ENV !== 'undefined' && + process.env.AWS_EXECUTION_ENV.indexOf('AWS_Lambda_') === 0 + ) { + return; + } + + if ( + typeof process.env === 'object' && + typeof process.env.AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE !== 'undefined' + ) { + return; + } + + if (typeof process.emitWarning === 'function') { + process.emitWarning(warning, { + type: 'NOTE' + }); + } +} + +setTimeout(function () { + if (!module.exports.suppress) { + emitWarning(); + } +}, 0); + + /***/ }), /***/ 25768: @@ -199334,6 +200747,7 @@ function Api(api, options) { property(this, 'documentation', api.documentation); property(this, 'documentationUrl', api.documentationUrl); } + property(this, 'awsQueryCompatible', api.metadata.awsQueryCompatible); } /** @@ -200066,14 +201480,16 @@ __nccwpck_require__(57714); __nccwpck_require__(27454); __nccwpck_require__(13754); __nccwpck_require__(80371); +__nccwpck_require__(68335); -// Setup default chain providers +// Setup default providers for credentials chain // If this changes, please update documentation for // AWS.CredentialProviderChain.defaultProviders in // credentials/credential_provider_chain.js AWS.CredentialProviderChain.defaultProviders = [ function () { return new AWS.EnvironmentCredentials('AWS'); }, function () { return new AWS.EnvironmentCredentials('AMAZON'); }, + function () { return new AWS.SsoCredentials(); }, function () { return new AWS.SharedIniFileCredentials(); }, function () { return new AWS.ECSCredentials(); }, function () { return new AWS.ProcessCredentials(); }, @@ -200081,6 +201497,19 @@ AWS.CredentialProviderChain.defaultProviders = [ function () { return new AWS.EC2MetadataCredentials(); } ]; +// Load custom token providers +__nccwpck_require__(82647); +__nccwpck_require__(50126); +__nccwpck_require__(90327); + +// Setup default providers for token chain +// If this changes, please update documentation for +// AWS.TokenProviderChain.defaultProviders in +// token/token_provider_chain.js +AWS.TokenProviderChain.defaultProviders = [ + function () { return new AWS.SSOTokenProvider(); }, +]; + var getRegion = function() { var env = process.env; var region = env.AWS_REGION || env.AMAZON_REGION; @@ -200152,6 +201581,9 @@ AWS.util.update(AWS.Config.prototype.keys, { var region = getRegion(); return region ? getRealRegion(region): undefined; }, + tokenProvider: function() { + return new AWS.TokenProviderChain(); + }, useFipsEndpoint: function() { var region = getRegion(); return isFipsRegion(region) @@ -200682,6 +202114,15 @@ function buildRequest(req) { var builder = new JsonBuilder(); if (version === 1) version = '1.0'; + + if (api.awsQueryCompatible) { + if (!httpRequest.params) { + httpRequest.params = {}; + } + // because Query protocol does this. + Object.assign(httpRequest.params, req.params); + } + httpRequest.body = builder.build(req.params || {}, input); httpRequest.headers['Content-Type'] = 'application/x-amz-json-' + version; httpRequest.headers['X-Amz-Target'] = target; @@ -200701,6 +202142,7 @@ function extractError(resp) { if (httpResponse.body.length > 0) { try { var e = JSON.parse(httpResponse.body.toString()); + var code = e.__type || e.code || e.Code; if (code) { error.code = code.split('#').pop(); @@ -200710,6 +202152,24 @@ function extractError(resp) { } else { error.message = (e.message || e.Message || null); } + + // The minimized models do not have error shapes, so + // without expanding the model size, it's not possible + // to validate the response shape (members) or + // check if any are sensitive to logging. + + // Assign the fields as non-enumerable, allowing specific access only. + for (var key in e || {}) { + if (key === 'code' || key === 'message') { + continue; + } + error['[' + key + ']'] = 'See error.' + key + ' for details.'; + Object.defineProperty(error, key, { + value: e[key], + enumerable: false, + writable: true + }); + } } catch (e) { error.statusCode = httpResponse.statusCode; error.message = httpResponse.statusMessage; @@ -201027,6 +202487,18 @@ var Json = __nccwpck_require__(30083); var JsonBuilder = __nccwpck_require__(47495); var JsonParser = __nccwpck_require__(5474); +var METHODS_WITHOUT_BODY = ['GET', 'HEAD', 'DELETE']; + +function unsetContentLength(req) { + var payloadMember = util.getRequestPayloadShape(req); + if ( + payloadMember === undefined && + METHODS_WITHOUT_BODY.indexOf(req.httpRequest.method) >= 0 + ) { + delete req.httpRequest.headers['Content-Length']; + } +} + function populateBody(req) { var builder = new JsonBuilder(); var input = req.service.api.operations[req.operation].input; @@ -201063,7 +202535,7 @@ function buildRequest(req) { Rest.buildRequest(req); // never send body payload on GET/HEAD/DELETE - if (['GET', 'HEAD', 'DELETE'].indexOf(req.httpRequest.method) < 0) { + if (METHODS_WITHOUT_BODY.indexOf(req.httpRequest.method) < 0) { populateBody(req); } } @@ -201112,7 +202584,8 @@ function extractData(resp) { module.exports = { buildRequest: buildRequest, extractError: extractError, - extractData: extractData + extractData: extractData, + unsetContentLength: unsetContentLength }; @@ -201836,6 +203309,7 @@ function derivedKeys(service) { [region, '*'], [regionPrefix, '*'], ['*', endpointPrefix], + [region, 'internal-*'], ['*', '*'] ].map(function(item) { return item[0] && item[1] ? item.join('/') : null; @@ -201880,10 +203354,21 @@ function configureEndpoint(service) { } // signature version - if (!config.signatureVersion) config.signatureVersion = 'v4'; + if (!config.signatureVersion) { + // Note: config is a global object and should not be mutated here. + // However, we are retaining this line for backwards compatibility. + // The non-v4 signatureVersion will be set in a copied object below. + config.signatureVersion = 'v4'; + } + + var useBearer = (service.api && service.api.signatureVersion) === 'bearer'; // merge config - applyConfig(service, config); + applyConfig(service, Object.assign( + {}, + config, + { signatureVersion: useBearer ? 'bearer' : config.signatureVersion } + )); return; } } @@ -203732,7 +205217,7 @@ AWS.S3.ManagedUpload = AWS.util.inherit({ if (self.completeInfo[partNumber] && self.completeInfo[partNumber].ETag !== null) return null; partInfo.ETag = data.ETag; self.doneParts++; - if (self.isDoneChunking && self.doneParts === self.numParts) { + if (self.isDoneChunking && self.doneParts === self.totalPartNumbers) { self.finishMultiPart(); } else { self.fillQueue.call(self); @@ -204638,6 +206123,8 @@ AWS.Service = inherit({ version = this.config.signatureVersion; } else if (authtype === 'v4' || authtype === 'v4-unsigned-body') { version = 'v4'; + } else if (authtype === 'bearer') { + version = 'bearer'; } else { version = this.api.signatureVersion; } @@ -205339,6 +206826,32 @@ AWS.util.update(AWS.EC2.prototype, { }); +/***/ }), + +/***/ 3034: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + +var AWS = __nccwpck_require__(28437); + +AWS.util.update(AWS.EventBridge.prototype, { + /** + * @api private + */ + setupRequestListeners: function setupRequestListeners(request) { + if (request.operation === 'putEvents') { + var params = request.params || {}; + if (params.EndpointId !== undefined) { + throw new AWS.util.error(new Error(), { + code: 'InvalidParameter', + message: 'EndpointId is not supported in current SDK.\n' + + 'You should consider switching to V3(https://github.com/aws/aws-sdk-js-v3).' + }); + } + } + }, +}); + + /***/ }), /***/ 14472: @@ -206274,7 +207787,8 @@ AWS.util.update(AWS.S3.prototype, { willComputeChecksums: function willComputeChecksums(req) { var rules = req.service.api.operations[req.operation].input.members; var body = req.httpRequest.body; - var needsContentMD5 = rules.ContentMD5 && + var needsContentMD5 = req.service.config.computeChecksums && + rules.ContentMD5 && !req.params.ContentMD5 && body && (AWS.util.Buffer.isBuffer(req.httpRequest.body) || typeof req.httpRequest.body === 'string'); @@ -207493,9 +209007,14 @@ var s3util = { var allowFipsEndpoint = options.allowFipsEndpoint || false; if (!regionFromArn) { + var message = 'ARN region is empty'; + if (req._parsedArn.service === 's3') { + message = message + '\nYou may want to use multi-regional ARN. The feature is not supported in current SDK. ' + + 'You should consider switching to V3(https://github.com/aws/aws-sdk-js-v3).'; + } throw AWS.util.error(new Error(), { code: 'InvalidARN', - message: 'ARN region is empty' + message: message }); } @@ -207897,18 +209416,32 @@ var AWS = __nccwpck_require__(28437); var os = __nccwpck_require__(22037); var path = __nccwpck_require__(71017); -function parseFile(filename, isConfig) { - var content = AWS.util.ini.parse(AWS.util.readFileSync(filename)); - var tmpContent = {}; - Object.keys(content).forEach(function(profileName) { - var profileContent = content[profileName]; - profileName = isConfig ? profileName.replace(/^profile\s/, '') : profileName; - Object.defineProperty(tmpContent, profileName, { - value: profileContent, - enumerable: true - }); +function parseFile(filename) { + return AWS.util.ini.parse(AWS.util.readFileSync(filename)); +} + +function getProfiles(fileContent) { + var tmpContent = {}; + Object.keys(fileContent).forEach(function(sectionName) { + if (/^sso-session\s/.test(sectionName)) return; + Object.defineProperty(tmpContent, sectionName.replace(/^profile\s/, ''), { + value: fileContent[sectionName], + enumerable: true }); - return tmpContent; + }); + return tmpContent; +} + +function getSsoSessions(fileContent) { + var tmpContent = {}; + Object.keys(fileContent).forEach(function(sectionName) { + if (!/^sso-session\s/.test(sectionName)) return; + Object.defineProperty(tmpContent, sectionName.replace(/^sso-session\s/, ''), { + value: fileContent[sectionName], + enumerable: true + }); + }); + return tmpContent; } /** @@ -207923,41 +209456,66 @@ function parseFile(filename, isConfig) { AWS.IniLoader = AWS.util.inherit({ constructor: function IniLoader() { this.resolvedProfiles = {}; + this.resolvedSsoSessions = {}; }, /** Remove all cached files. Used after config files are updated. */ clearCachedFiles: function clearCachedFiles() { this.resolvedProfiles = {}; + this.resolvedSsoSessions = {}; }, -/** - * Load configurations from config/credentials files and cache them - * for later use. If no file is specified it will try to load default - * files. - * @param options [map] information describing the file - * @option options filename [String] ('~/.aws/credentials' or defined by - * AWS_SHARED_CREDENTIALS_FILE process env var or '~/.aws/config' if - * isConfig is set to true) - * path to the file to be read. - * @option options isConfig [Boolean] (false) True to read config file. - * @return [map] object containing contents from file in key-value - * pairs. - */ + /** + * Load configurations from config/credentials files and cache them + * for later use. If no file is specified it will try to load default files. + * + * @param options [map] information describing the file + * @option options filename [String] ('~/.aws/credentials' or defined by + * AWS_SHARED_CREDENTIALS_FILE process env var or '~/.aws/config' if + * isConfig is set to true) + * path to the file to be read. + * @option options isConfig [Boolean] (false) True to read config file. + * @return [map] object containing contents from file in key-value + * pairs. + */ loadFrom: function loadFrom(options) { options = options || {}; var isConfig = options.isConfig === true; var filename = options.filename || this.getDefaultFilePath(isConfig); if (!this.resolvedProfiles[filename]) { - var fileContent = this.parseFile(filename, isConfig); - Object.defineProperty(this.resolvedProfiles, filename, { value: fileContent }); + var fileContent = parseFile(filename); + if (isConfig) { + Object.defineProperty(this.resolvedProfiles, filename, { + value: getProfiles(fileContent) + }); + } else { + Object.defineProperty(this.resolvedProfiles, filename, { value: fileContent }); + } } return this.resolvedProfiles[filename]; }, /** - * @api private + * Load sso sessions from config/credentials files and cache them + * for later use. If no file is specified it will try to load default file. + * + * @param options [map] information describing the file + * @option options filename [String] ('~/.aws/config' or defined by + * AWS_CONFIG_FILE process env var) + * @return [map] object containing contents from file in key-value + * pairs. */ - parseFile: parseFile, + loadSsoSessionsFrom: function loadSsoSessionsFrom(options) { + options = options || {}; + var filename = options.filename || this.getDefaultFilePath(true); + if (!this.resolvedSsoSessions[filename]) { + var fileContent = parseFile(filename); + Object.defineProperty(this.resolvedSsoSessions, filename, { + value: getSsoSessions(fileContent) + }); + } + return this.resolvedSsoSessions[filename]; + }, /** * @api private @@ -207996,11 +209554,31 @@ AWS.IniLoader = AWS.util.inherit({ var IniLoader = AWS.IniLoader; module.exports = { - IniLoader: IniLoader, - parseFile: parseFile, + IniLoader: IniLoader }; +/***/ }), + +/***/ 98382: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + +var AWS = __nccwpck_require__(28437); + +/** + * @api private + */ +AWS.Signers.Bearer = AWS.util.inherit(AWS.Signers.RequestSigner, { + constructor: function Bearer(request) { + AWS.Signers.RequestSigner.call(this, request); + }, + + addAuthorization: function addAuthorization(token) { + this.request.headers['Authorization'] = 'Bearer ' + token.token; + } +}); + + /***/ }), /***/ 60328: @@ -208161,6 +209739,7 @@ AWS.Signers.RequestSigner.getVersion = function getVersion(version) { case 'v4': return AWS.Signers.V4; case 's3': return AWS.Signers.S3; case 'v3https': return AWS.Signers.V3Https; + case 'bearer': return AWS.Signers.Bearer; } throw new Error('Unknown signing version ' + version); }; @@ -208171,6 +209750,7 @@ __nccwpck_require__(24473); __nccwpck_require__(26529); __nccwpck_require__(58616); __nccwpck_require__(60328); +__nccwpck_require__(98382); /***/ }), @@ -208907,6 +210487,656 @@ AcceptorStateMachine.prototype.addState = function addState(name, acceptState, f module.exports = AcceptorStateMachine; +/***/ }), + +/***/ 82647: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + +var AWS = __nccwpck_require__(28437); + +/** + * Represents AWS token object, which contains {token}, and optional + * {expireTime}. + * Creating a `Token` object allows you to pass around your + * token to configuration and service objects. + * + * Note that this class typically does not need to be constructed manually, + * as the {AWS.Config} and {AWS.Service} classes both accept simple + * options hashes with the two keys. The token from this object will be used + * automatically in operations which require them. + * + * ## Expiring and Refreshing Token + * + * Occasionally token can expire in the middle of a long-running + * application. In this case, the SDK will automatically attempt to + * refresh the token from the storage location if the Token + * class implements the {refresh} method. + * + * If you are implementing a token storage location, you + * will want to create a subclass of the `Token` class and + * override the {refresh} method. This method allows token to be + * retrieved from the backing store, be it a file system, database, or + * some network storage. The method should reset the token attributes + * on the object. + * + * @!attribute token + * @return [String] represents the literal token string. This will typically + * be a base64 encoded string. + * @!attribute expireTime + * @return [Date] a time when token should be considered expired. Used + * in conjunction with {expired}. + * @!attribute expired + * @return [Boolean] whether the token is expired and require a refresh. Used + * in conjunction with {expireTime}. + */ +AWS.Token = AWS.util.inherit({ + /** + * Creates a Token object with a given set of information in options hash. + * @option options token [String] represents the literal token string. + * @option options expireTime [Date] field representing the time at which + * the token expires. + * @example Create a token object + * var token = new AWS.Token({ token: 'token' }); + */ + constructor: function Token(options) { + // hide token from being displayed with util.inspect + AWS.util.hideProperties(this, ['token']); + + this.expired = false; + this.expireTime = null; + this.refreshCallbacks = []; + if (arguments.length === 1) { + var options = arguments[0]; + this.token = options.token; + this.expireTime = options.expireTime; + } + }, + + /** + * @return [Integer] the number of seconds before {expireTime} during which + * the token will be considered expired. + */ + expiryWindow: 15, + + /** + * @return [Boolean] whether the Token object should call {refresh} + * @note Subclasses should override this method to provide custom refresh + * logic. + */ + needsRefresh: function needsRefresh() { + var currentTime = AWS.util.date.getDate().getTime(); + var adjustedTime = new Date(currentTime + this.expiryWindow * 1000); + + if (this.expireTime && adjustedTime > this.expireTime) + return true; + + return this.expired || !this.token; + }, + + /** + * Gets the existing token, refreshing them if they are not yet loaded + * or have expired. Users should call this method before using {refresh}, + * as this will not attempt to reload token when they are already + * loaded into the object. + * + * @callback callback function(err) + * When this callback is called with no error, it means either token + * do not need to be refreshed or refreshed token information has + * been loaded into the object (as the `token` property). + * @param err [Error] if an error occurred, this value will be filled + */ + get: function get(callback) { + var self = this; + if (this.needsRefresh()) { + this.refresh(function(err) { + if (!err) self.expired = false; // reset expired flag + if (callback) callback(err); + }); + } else if (callback) { + callback(); + } + }, + + /** + * @!method getPromise() + * Returns a 'thenable' promise. + * Gets the existing token, refreshing it if it's not yet loaded + * or have expired. Users should call this method before using {refresh}, + * as this will not attempt to reload token when it's already + * loaded into the object. + * + * Two callbacks can be provided to the `then` method on the returned promise. + * The first callback will be called if the promise is fulfilled, and the second + * callback will be called if the promise is rejected. + * @callback fulfilledCallback function() + * Called if the promise is fulfilled. When this callback is called, it means + * either token does not need to be refreshed or refreshed token information + * has been loaded into the object (as the `token` property). + * @callback rejectedCallback function(err) + * Called if the promise is rejected. + * @param err [Error] if an error occurred, this value will be filled. + * @return [Promise] A promise that represents the state of the `get` call. + * @example Calling the `getPromise` method. + * var promise = tokenProvider.getPromise(); + * promise.then(function() { ... }, function(err) { ... }); + */ + + /** + * @!method refreshPromise() + * Returns a 'thenable' promise. + * Refreshes the token. Users should call {get} before attempting + * to forcibly refresh token. + * + * Two callbacks can be provided to the `then` method on the returned promise. + * The first callback will be called if the promise is fulfilled, and the second + * callback will be called if the promise is rejected. + * @callback fulfilledCallback function() + * Called if the promise is fulfilled. When this callback is called, it + * means refreshed token information has been loaded into the object + * (as the `token` property). + * @callback rejectedCallback function(err) + * Called if the promise is rejected. + * @param err [Error] if an error occurred, this value will be filled. + * @return [Promise] A promise that represents the state of the `refresh` call. + * @example Calling the `refreshPromise` method. + * var promise = tokenProvider.refreshPromise(); + * promise.then(function() { ... }, function(err) { ... }); + */ + + /** + * Refreshes the token. Users should call {get} before attempting + * to forcibly refresh token. + * + * @callback callback function(err) + * When this callback is called with no error, it means refreshed + * token information has been loaded into the object (as the + * `token` property). + * @param err [Error] if an error occurred, this value will be filled + * @note Subclasses should override this class to reset the + * {token} on the token object and then call the callback with + * any error information. + * @see get + */ + refresh: function refresh(callback) { + this.expired = false; + callback(); + }, + + /** + * @api private + * @param callback + */ + coalesceRefresh: function coalesceRefresh(callback, sync) { + var self = this; + if (self.refreshCallbacks.push(callback) === 1) { + self.load(function onLoad(err) { + AWS.util.arrayEach(self.refreshCallbacks, function(callback) { + if (sync) { + callback(err); + } else { + // callback could throw, so defer to ensure all callbacks are notified + AWS.util.defer(function () { + callback(err); + }); + } + }); + self.refreshCallbacks.length = 0; + }); + } + }, + + /** + * @api private + * @param callback + */ + load: function load(callback) { + callback(); + } +}); + +/** + * @api private + */ +AWS.Token.addPromisesToClass = function addPromisesToClass(PromiseDependency) { + this.prototype.getPromise = AWS.util.promisifyMethod('get', PromiseDependency); + this.prototype.refreshPromise = AWS.util.promisifyMethod('refresh', PromiseDependency); +}; + +/** + * @api private + */ +AWS.Token.deletePromisesFromClass = function deletePromisesFromClass() { + delete this.prototype.getPromise; + delete this.prototype.refreshPromise; +}; + +AWS.util.addPromises(AWS.Token); + + +/***/ }), + +/***/ 90327: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + +var AWS = __nccwpck_require__(28437); +var crypto = __nccwpck_require__(6113); +var fs = __nccwpck_require__(57147); +var path = __nccwpck_require__(71017); +var iniLoader = AWS.util.iniLoader; + +// Tracking refresh attempt to ensure refresh is not attempted more than once every 30 seconds. +var lastRefreshAttemptTime = 0; + +/** + * Throws error is key is not present in token object. + * + * @param token [Object] Object to be validated. + * @param key [String] The key to be validated on the object. + */ +var validateTokenKey = function validateTokenKey(token, key) { + if (!token[key]) { + throw AWS.util.error( + new Error('Key "' + key + '" not present in SSO Token'), + { code: 'SSOTokenProviderFailure' } + ); + } +}; + +/** + * Calls callback function with or without error based on provided times in case + * of unsuccessful refresh. + * + * @param currentTime [number] current time in milliseconds since ECMAScript epoch. + * @param tokenExpireTime [number] token expire time in milliseconds since ECMAScript epoch. + * @param callback [Function] Callback to call in case of error. + */ +var refreshUnsuccessful = function refreshUnsuccessful( + currentTime, + tokenExpireTime, + callback +) { + if (tokenExpireTime > currentTime) { + // Cached token is still valid, return. + callback(null); + } else { + // Token invalid, throw error requesting user to sso login. + throw AWS.util.error( + new Error('SSO Token refresh failed. Please log in using "aws sso login"'), + { code: 'SSOTokenProviderFailure' } + ); + } +}; + +/** + * Represents token loaded from disk derived from the AWS SSO device grant authorication flow. + * + * ## Using SSO Token Provider + * + * This provider is checked by default in the Node.js environment in TokenProviderChain. + * To use the SSO Token Provider, simply add your SSO Start URL and Region to the + * ~/.aws/config file in the following format: + * + * [default] + * sso_start_url = https://d-abc123.awsapps.com/start + * sso_region = us-east-1 + * + * ## Using custom profiles + * + * The SDK supports loading token for separate profiles. This can be done in two ways: + * + * 1. Set the `AWS_PROFILE` environment variable in your process prior to loading the SDK. + * 2. Directly load the AWS.SSOTokenProvider: + * + * ```javascript + * var ssoTokenProvider = new AWS.SSOTokenProvider({profile: 'myprofile'}); + * ``` + * + * @!macro nobrowser + */ +AWS.SSOTokenProvider = AWS.util.inherit(AWS.Token, { + /** + * Expiry window of five minutes. + */ + expiryWindow: 5 * 60, + + /** + * Creates a new token object from cached access token. + * + * @param options [map] a set of options + * @option options profile [String] (AWS_PROFILE env var or 'default') + * the name of the profile to load. + * @option options callback [Function] (err) Token is eagerly loaded + * by the constructor. When the callback is called with no error, the + * token has been loaded successfully. + */ + constructor: function SSOTokenProvider(options) { + AWS.Token.call(this); + + options = options || {}; + + this.expired = true; + this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; + this.get(options.callback || AWS.util.fn.noop); + }, + + /** + * Reads sso_start_url from provided profile, and reads token from + * ~/.aws/sso/cache/.json + * + * Throws an error if required fields token and expiresAt are missing. + * Throws an error if token has expired and metadata to perform refresh is + * not available. + * Attempts to refresh the token if it's within 5 minutes before expiry time. + * + * @api private + */ + load: function load(callback) { + var self = this; + var profiles = iniLoader.loadFrom({ isConfig: true }); + var profile = profiles[this.profile] || {}; + + if (Object.keys(profile).length === 0) { + throw AWS.util.error( + new Error('Profile "' + this.profile + '" not found'), + { code: 'SSOTokenProviderFailure' } + ); + } else if (!profile['sso_session']) { + throw AWS.util.error( + new Error('Profile "' + profileName + '" is missing required property "sso_session".'), + { code: 'SSOTokenProviderFailure' } + ); + } + + var ssoSessionName = profile['sso_session']; + var ssoSessions = iniLoader.loadSsoSessionsFrom(); + var ssoSession = ssoSessions[ssoSessionName]; + + if (!ssoSession) { + throw AWS.util.error( + new Error('Sso session "' + ssoSessionName + '" not found'), + { code: 'SSOTokenProviderFailure' } + ); + } else if (!ssoSession['sso_start_url']) { + throw AWS.util.error( + new Error('Sso session "' + profileName + '" is missing required property "sso_start_url".'), + { code: 'SSOTokenProviderFailure' } + ); + } else if (!ssoSession['sso_region']) { + throw AWS.util.error( + new Error('Sso session "' + profileName + '" is missing required property "sso_region".'), + { code: 'SSOTokenProviderFailure' } + ); + } + + var hasher = crypto.createHash('sha1'); + var fileName = hasher.update(ssoSessionName).digest('hex') + '.json'; + var cachePath = path.join(iniLoader.getHomeDir(), '.aws', 'sso', 'cache', fileName); + var tokenFromCache = JSON.parse(fs.readFileSync(cachePath)); + + if (!tokenFromCache) { + throw AWS.util.error( + new Error('Cached token not found. Please log in using "aws sso login"' + + ' for profile "' + this.profile + '".'), + { code: 'SSOTokenProviderFailure' } + ); + } + + validateTokenKey(tokenFromCache, 'accessToken'); + validateTokenKey(tokenFromCache, 'expiresAt'); + + var currentTime = AWS.util.date.getDate().getTime(); + var adjustedTime = new Date(currentTime + this.expiryWindow * 1000); + var tokenExpireTime = new Date(tokenFromCache['expiresAt']); + + if (tokenExpireTime > adjustedTime) { + // Token is valid and not expired. + self.token = tokenFromCache.accessToken; + self.expireTime = tokenExpireTime; + self.expired = false; + callback(null); + return; + } + + // Skip new refresh, if last refresh was done within 30 seconds. + if (currentTime - lastRefreshAttemptTime < 30 * 1000) { + refreshUnsuccessful(currentTime, tokenExpireTime, callback); + return; + } + + // Token is in expiry window, refresh from SSOOIDC.createToken() call. + validateTokenKey(tokenFromCache, 'clientId'); + validateTokenKey(tokenFromCache, 'clientSecret'); + validateTokenKey(tokenFromCache, 'refreshToken'); + + if (!self.service || self.service.config.region !== ssoSession.sso_region) { + self.service = new AWS.SSOOIDC({ region: ssoSession.sso_region }); + } + + var params = { + clientId: tokenFromCache.clientId, + clientSecret: tokenFromCache.clientSecret, + refreshToken: tokenFromCache.refreshToken, + grantType: 'refresh_token', + }; + + lastRefreshAttemptTime = AWS.util.date.getDate().getTime(); + self.service.createToken(params, function(err, data) { + if (err || !data) { + refreshUnsuccessful(currentTime, tokenExpireTime, callback); + } else { + try { + validateTokenKey(data, 'accessToken'); + validateTokenKey(data, 'expiresIn'); + self.expired = false; + self.token = data.accessToken; + self.expireTime = new Date(Date.now() + data.expiresIn * 1000); + callback(null); + + try { + // Write updated token data to disk. + tokenFromCache.accessToken = data.accessToken; + tokenFromCache.expiresAt = self.expireTime.toISOString(); + tokenFromCache.refreshToken = data.refreshToken; + fs.writeFileSync(cachePath, JSON.stringify(tokenFromCache, null, 2)); + } catch (error) { + // Swallow error if unable to write token to file. + } + } catch (error) { + refreshUnsuccessful(currentTime, tokenExpireTime, callback); + } + } + }); + }, + + /** + * Loads the cached access token from disk. + * + * @callback callback function(err) + * Called after the AWS SSO process has been executed. When this + * callback is called with no error, it means that the token information + * has been loaded into the object (as the `token` property). + * @param err [Error] if an error occurred, this value will be filled. + * @see get + */ + refresh: function refresh(callback) { + iniLoader.clearCachedFiles(); + this.coalesceRefresh(callback || AWS.util.fn.callback); + }, +}); + + +/***/ }), + +/***/ 50126: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + +var AWS = __nccwpck_require__(28437); + +/** + * Creates a token provider chain that searches for token in a list of + * token providers specified by the {providers} property. + * + * By default, the chain will use the {defaultProviders} to resolve token. + * + * ## Setting Providers + * + * Each provider in the {providers} list should be a function that returns + * a {AWS.Token} object, or a hardcoded token object. The function + * form allows for delayed execution of the Token construction. + * + * ## Resolving Token from a Chain + * + * Call {resolve} to return the first valid token object that can be + * loaded by the provider chain. + * + * For example, to resolve a chain with a custom provider that checks a file + * on disk after the set of {defaultProviders}: + * + * ```javascript + * var diskProvider = new FileTokenProvider('./token.json'); + * var chain = new AWS.TokenProviderChain(); + * chain.providers.push(diskProvider); + * chain.resolve(); + * ``` + * + * The above code will return the `diskProvider` object if the + * file contains token and the `defaultProviders` do not contain + * any token. + * + * @!attribute providers + * @return [Array] + * a list of token objects or functions that return token + * objects. If the provider is a function, the function will be + * executed lazily when the provider needs to be checked for valid + * token. By default, this object will be set to the {defaultProviders}. + * @see defaultProviders + */ +AWS.TokenProviderChain = AWS.util.inherit(AWS.Token, { + + /** + * Creates a new TokenProviderChain with a default set of providers + * specified by {defaultProviders}. + */ + constructor: function TokenProviderChain(providers) { + if (providers) { + this.providers = providers; + } else { + this.providers = AWS.TokenProviderChain.defaultProviders.slice(0); + } + this.resolveCallbacks = []; + }, + + /** + * @!method resolvePromise() + * Returns a 'thenable' promise. + * Resolves the provider chain by searching for the first token in {providers}. + * + * Two callbacks can be provided to the `then` method on the returned promise. + * The first callback will be called if the promise is fulfilled, and the second + * callback will be called if the promise is rejected. + * @callback fulfilledCallback function(token) + * Called if the promise is fulfilled and the provider resolves the chain + * to a token object + * @param token [AWS.Token] the token object resolved by the provider chain. + * @callback rejectedCallback function(error) + * Called if the promise is rejected. + * @param err [Error] the error object returned if no token is found. + * @return [Promise] A promise that represents the state of the `resolve` method call. + * @example Calling the `resolvePromise` method. + * var promise = chain.resolvePromise(); + * promise.then(function(token) { ... }, function(err) { ... }); + */ + + /** + * Resolves the provider chain by searching for the first token in {providers}. + * + * @callback callback function(err, token) + * Called when the provider resolves the chain to a token object + * or null if no token can be found. + * + * @param err [Error] the error object returned if no token is found. + * @param token [AWS.Token] the token object resolved by the provider chain. + * @return [AWS.TokenProviderChain] the provider, for chaining. + */ + resolve: function resolve(callback) { + var self = this; + if (self.providers.length === 0) { + callback(new Error('No providers')); + return self; + } + + if (self.resolveCallbacks.push(callback) === 1) { + var index = 0; + var providers = self.providers.slice(0); + + function resolveNext(err, token) { + if ((!err && token) || index === providers.length) { + AWS.util.arrayEach(self.resolveCallbacks, function (callback) { + callback(err, token); + }); + self.resolveCallbacks.length = 0; + return; + } + + var provider = providers[index++]; + if (typeof provider === 'function') { + token = provider.call(); + } else { + token = provider; + } + + if (token.get) { + token.get(function (getErr) { + resolveNext(getErr, getErr ? null : token); + }); + } else { + resolveNext(null, token); + } + } + + resolveNext(); + } + + return self; + } +}); + +/** + * The default set of providers used by a vanilla TokenProviderChain. + * + * In the browser: + * + * ```javascript + * AWS.TokenProviderChain.defaultProviders = [] + * ``` + * + * In Node.js: + * + * ```javascript + * AWS.TokenProviderChain.defaultProviders = [ + * function () { return new AWS.SSOTokenProvider(); }, + * ] + * ``` + */ +AWS.TokenProviderChain.defaultProviders = []; + +/** + * @api private + */ +AWS.TokenProviderChain.addPromisesToClass = function addPromisesToClass(PromiseDependency) { + this.prototype.resolvePromise = AWS.util.promisifyMethod('resolve', PromiseDependency); +}; + +/** + * @api private + */ +AWS.TokenProviderChain.deletePromisesFromClass = function deletePromisesFromClass() { + delete this.prototype.resolvePromise; +}; + +AWS.util.addPromises(AWS.TokenProviderChain); + + /***/ }), /***/ 77985: @@ -209129,20 +211359,28 @@ var util = { parse: function string(ini) { var currentSection, map = {}; util.arrayEach(ini.split(/\r?\n/), function(line) { - line = line.split(/(^|\s)[;#]/)[0]; // remove comments - var section = line.match(/^\s*\[([^\[\]]+)\]\s*$/); - if (section) { - currentSection = section[1]; + line = line.split(/(^|\s)[;#]/)[0].trim(); // remove comments and trim + var isSection = line[0] === '[' && line[line.length - 1] === ']'; + if (isSection) { + currentSection = line.substring(1, line.length - 1); if (currentSection === '__proto__' || currentSection.split(/\s/)[1] === '__proto__') { throw util.error( new Error('Cannot load profile name \'' + currentSection + '\' from shared ini file.') ); } } else if (currentSection) { - var item = line.match(/^\s*(.+?)\s*=\s*(.+?)\s*$/); - if (item) { + var indexOfEqualsSign = line.indexOf('='); + var start = 0; + var end = line.length - 1; + var isAssignment = + indexOfEqualsSign !== -1 && indexOfEqualsSign !== start && indexOfEqualsSign !== end; + + if (isAssignment) { + var name = line.substring(0, indexOfEqualsSign).trim(); + var value = line.substring(indexOfEqualsSign + 1).trim(); + map[currentSection] = map[currentSection] || {}; - map[currentSection][item[1]] = item[2]; + map[currentSection][name] = value; } } }); @@ -209516,7 +211754,25 @@ var util = { err.name = String(options && options.name || err.name || err.code || 'Error'); err.time = new Date(); - if (originalError) err.originalError = originalError; + if (originalError) { + err.originalError = originalError; + } + + + for (var key in options || {}) { + if (key[0] === '[' && key[key.length - 1] === ']') { + key = key.slice(1, -1); + if (key === 'code' || key === 'message') { + continue; + } + err['[' + key + ']'] = 'See error.' + key + ' for details.'; + Object.defineProperty(err, key, { + value: err[key] || (options && options[key]) || (originalError && originalError[key]), + enumerable: false, + writable: true + }); + } + } return err; }, @@ -209836,7 +212092,7 @@ var util = { */ uuid: { v4: function uuidV4() { - return (__nccwpck_require__(71062).v4)(); + return (__nccwpck_require__(57821).v4)(); } }, @@ -210139,7 +212395,7 @@ var AWS = __nccwpck_require__(28437); var util = AWS.util; var Shape = AWS.Model.Shape; -var xml2js = __nccwpck_require__(84274); +var xml2js = __nccwpck_require__(66189); /** * @api private @@ -210381,5127 +212637,447 @@ module.exports = { /***/ }), -/***/ 71062: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 35827: +/***/ ((__unused_webpack_module, exports) => { -var v1 = __nccwpck_require__(68207); -var v4 = __nccwpck_require__(54151); - -var uuid = v4; -uuid.v1 = v1; -uuid.v4 = v4; - -module.exports = uuid; +"use strict"; -/***/ }), - -/***/ 50367: -/***/ ((module) => { +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; /** * Convert array of 16 byte values to UUID string format of the form: * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ var byteToHex = []; + for (var i = 0; i < 256; ++i) { byteToHex[i] = (i + 0x100).toString(16).substr(1); } function bytesToUuid(buf, offset) { var i = offset || 0; - var bth = byteToHex; - // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 - return ([bth[buf[i++]], bth[buf[i++]], - bth[buf[i++]], bth[buf[i++]], '-', - bth[buf[i++]], bth[buf[i++]], '-', - bth[buf[i++]], bth[buf[i++]], '-', - bth[buf[i++]], bth[buf[i++]], '-', - bth[buf[i++]], bth[buf[i++]], - bth[buf[i++]], bth[buf[i++]], - bth[buf[i++]], bth[buf[i++]]]).join(''); + var bth = byteToHex; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 + + return [bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]]].join(''); } -module.exports = bytesToUuid; - +var _default = bytesToUuid; +exports["default"] = _default; /***/ }), -/***/ 91734: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 57821: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -// Unique ID creation requires a high quality random # generator. In node.js -// this is pretty straight-forward - we use the crypto API. +"use strict"; +var __webpack_unused_export__; -var crypto = __nccwpck_require__(6113); -module.exports = function nodeRNG() { - return crypto.randomBytes(16); -}; +__webpack_unused_export__ = ({ + value: true +}); +__webpack_unused_export__ = ({ + enumerable: true, + get: function () { + return _v.default; + } +}); +__webpack_unused_export__ = ({ + enumerable: true, + get: function () { + return _v2.default; + } +}); +Object.defineProperty(exports, "v4", ({ + enumerable: true, + get: function () { + return _v3.default; + } +})); +__webpack_unused_export__ = ({ + enumerable: true, + get: function () { + return _v4.default; + } +}); +var _v = _interopRequireDefault(__nccwpck_require__(67668)); + +var _v2 = _interopRequireDefault(__nccwpck_require__(98573)); + +var _v3 = _interopRequireDefault(__nccwpck_require__(7811)); + +var _v4 = _interopRequireDefault(__nccwpck_require__(46508)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), -/***/ 68207: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 93525: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var rng = __nccwpck_require__(91734); -var bytesToUuid = __nccwpck_require__(50367); +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function md5(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + + return _crypto.default.createHash('md5').update(bytes).digest(); +} + +var _default = md5; +exports["default"] = _default; + +/***/ }), + +/***/ 49788: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = rng; + +var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function rng() { + return _crypto.default.randomBytes(16); +} + +/***/ }), + +/***/ 7387: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function sha1(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + + return _crypto.default.createHash('sha1').update(bytes).digest(); +} + +var _default = sha1; +exports["default"] = _default; + +/***/ }), + +/***/ 67668: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _rng = _interopRequireDefault(__nccwpck_require__(49788)); + +var _bytesToUuid = _interopRequireDefault(__nccwpck_require__(35827)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // **`v1()` - Generate time-based UUID** // // Inspired by https://github.com/LiosK/UUID.js // and http://docs.python.org/library/uuid.html - var _nodeId; -var _clockseq; -// Previous uuid creation time +var _clockseq; // Previous uuid creation time + + var _lastMSecs = 0; -var _lastNSecs = 0; +var _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details -// See https://github.com/broofa/node-uuid for API details function v1(options, buf, offset) { var i = buf && offset || 0; var b = buf || []; - options = options || {}; var node = options.node || _nodeId; - var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; - - // node and clockseq need to be initialized to random values if they're not + var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not // specified. We do this lazily to minimize issues related to insufficient // system entropy. See #189 + if (node == null || clockseq == null) { - var seedBytes = rng(); + var seedBytes = options.random || (options.rng || _rng.default)(); + if (node == null) { // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - node = _nodeId = [ - seedBytes[0] | 0x01, - seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5] - ]; + node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; } + if (clockseq == null) { // Per 4.2.2, randomize (14 bit) clockseq clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; } - } - - // UUID timestamps are 100 nano-second units since the Gregorian epoch, + } // UUID timestamps are 100 nano-second units since the Gregorian epoch, // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); - // Per 4.2.1.2, use count of uuid's generated during the current clock + + var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); // Per 4.2.1.2, use count of uuid's generated during the current clock // cycle to simulate higher resolution clock - var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; - // Time since last uuid creation (in msecs) - var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; + var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) + + var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression - // Per 4.2.1.2, Bump clockseq on clock regression if (dt < 0 && options.clockseq === undefined) { clockseq = clockseq + 1 & 0x3fff; - } - - // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new // time interval + + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { nsecs = 0; - } + } // Per 4.2.1.2 Throw error if too many uuids are requested + - // Per 4.2.1.2 Throw error if too many uuids are requested if (nsecs >= 10000) { - throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); } _lastMSecs = msecs; _lastNSecs = nsecs; - _clockseq = clockseq; + _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - msecs += 12219292800000; + msecs += 12219292800000; // `time_low` - // `time_low` var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; b[i++] = tl >>> 24 & 0xff; b[i++] = tl >>> 16 & 0xff; b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; + b[i++] = tl & 0xff; // `time_mid` - // `time_mid` - var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; + var tmh = msecs / 0x100000000 * 10000 & 0xfffffff; b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; + b[i++] = tmh & 0xff; // `time_high_and_version` - // `time_high_and_version` b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - b[i++] = tmh >>> 16 & 0xff; - // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - b[i++] = clockseq >>> 8 | 0x80; + b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - // `clock_seq_low` - b[i++] = clockseq & 0xff; + b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` + + b[i++] = clockseq & 0xff; // `node` - // `node` for (var n = 0; n < 6; ++n) { b[i + n] = node[n]; } - return buf ? buf : bytesToUuid(b); + return buf ? buf : (0, _bytesToUuid.default)(b); } -module.exports = v1; - +var _default = v1; +exports["default"] = _default; /***/ }), -/***/ 54151: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 98573: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var rng = __nccwpck_require__(91734); -var bytesToUuid = __nccwpck_require__(50367); +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _v = _interopRequireDefault(__nccwpck_require__(36097)); + +var _md = _interopRequireDefault(__nccwpck_require__(93525)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const v3 = (0, _v.default)('v3', 0x30, _md.default); +var _default = v3; +exports["default"] = _default; + +/***/ }), + +/***/ 36097: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = _default; +exports.URL = exports.DNS = void 0; + +var _bytesToUuid = _interopRequireDefault(__nccwpck_require__(35827)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function uuidToBytes(uuid) { + // Note: We assume we're being passed a valid uuid string + var bytes = []; + uuid.replace(/[a-fA-F0-9]{2}/g, function (hex) { + bytes.push(parseInt(hex, 16)); + }); + return bytes; +} + +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); // UTF8 escape + + var bytes = new Array(str.length); + + for (var i = 0; i < str.length; i++) { + bytes[i] = str.charCodeAt(i); + } + + return bytes; +} + +const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +exports.DNS = DNS; +const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +exports.URL = URL; + +function _default(name, version, hashfunc) { + var generateUUID = function (value, namespace, buf, offset) { + var off = buf && offset || 0; + if (typeof value == 'string') value = stringToBytes(value); + if (typeof namespace == 'string') namespace = uuidToBytes(namespace); + if (!Array.isArray(value)) throw TypeError('value must be an array of bytes'); + if (!Array.isArray(namespace) || namespace.length !== 16) throw TypeError('namespace must be uuid string or an Array of 16 byte values'); // Per 4.3 + + var bytes = hashfunc(namespace.concat(value)); + bytes[6] = bytes[6] & 0x0f | version; + bytes[8] = bytes[8] & 0x3f | 0x80; + + if (buf) { + for (var idx = 0; idx < 16; ++idx) { + buf[off + idx] = bytes[idx]; + } + } + + return buf || (0, _bytesToUuid.default)(bytes); + }; // Function#name is not settable on some platforms (#270) + + + try { + generateUUID.name = name; + } catch (err) {} // For CommonJS default export support + + + generateUUID.DNS = DNS; + generateUUID.URL = URL; + return generateUUID; +} + +/***/ }), + +/***/ 7811: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _rng = _interopRequireDefault(__nccwpck_require__(49788)); + +var _bytesToUuid = _interopRequireDefault(__nccwpck_require__(35827)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function v4(options, buf, offset) { var i = buf && offset || 0; - if (typeof(options) == 'string') { + if (typeof options == 'string') { buf = options === 'binary' ? new Array(16) : null; options = null; } + options = options || {}; - var rnds = options.random || (options.rng || rng)(); + var rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - rnds[6] = (rnds[6] & 0x0f) | 0x40; - rnds[8] = (rnds[8] & 0x3f) | 0x80; - // Copy bytes to buffer, if provided + rnds[6] = rnds[6] & 0x0f | 0x40; + rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided + if (buf) { for (var ii = 0; ii < 16; ++ii) { buf[i + ii] = rnds[ii]; } } - return buf || bytesToUuid(rnds); + return buf || (0, _bytesToUuid.default)(rnds); } -module.exports = v4; - +var _default = v4; +exports["default"] = _default; /***/ }), -/***/ 2441: -/***/ (function(__unused_webpack_module, exports) { - -// Generated by CoffeeScript 1.12.7 -(function() { - "use strict"; - exports.stripBOM = function(str) { - if (str[0] === '\uFEFF') { - return str.substring(1); - } else { - return str; - } - }; - -}).call(this); - - -/***/ }), - -/***/ 94213: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -// Generated by CoffeeScript 1.12.7 -(function() { - "use strict"; - var builder, defaults, escapeCDATA, requiresCDATA, wrapCDATA, - hasProp = {}.hasOwnProperty; - - builder = __nccwpck_require__(25273); - - defaults = (__nccwpck_require__(82573).defaults); - - requiresCDATA = function(entry) { - return typeof entry === "string" && (entry.indexOf('&') >= 0 || entry.indexOf('>') >= 0 || entry.indexOf('<') >= 0); - }; - - wrapCDATA = function(entry) { - return ""; - }; - - escapeCDATA = function(entry) { - return entry.replace(']]>', ']]]]>'); - }; - - exports.Builder = (function() { - function Builder(opts) { - var key, ref, value; - this.options = {}; - ref = defaults["0.2"]; - for (key in ref) { - if (!hasProp.call(ref, key)) continue; - value = ref[key]; - this.options[key] = value; - } - for (key in opts) { - if (!hasProp.call(opts, key)) continue; - value = opts[key]; - this.options[key] = value; - } - } - - Builder.prototype.buildObject = function(rootObj) { - var attrkey, charkey, render, rootElement, rootName; - attrkey = this.options.attrkey; - charkey = this.options.charkey; - if ((Object.keys(rootObj).length === 1) && (this.options.rootName === defaults['0.2'].rootName)) { - rootName = Object.keys(rootObj)[0]; - rootObj = rootObj[rootName]; - } else { - rootName = this.options.rootName; - } - render = (function(_this) { - return function(element, obj) { - var attr, child, entry, index, key, value; - if (typeof obj !== 'object') { - if (_this.options.cdata && requiresCDATA(obj)) { - element.raw(wrapCDATA(obj)); - } else { - element.txt(obj); - } - } else if (Array.isArray(obj)) { - for (index in obj) { - if (!hasProp.call(obj, index)) continue; - child = obj[index]; - for (key in child) { - entry = child[key]; - element = render(element.ele(key), entry).up(); - } - } - } else { - for (key in obj) { - if (!hasProp.call(obj, key)) continue; - child = obj[key]; - if (key === attrkey) { - if (typeof child === "object") { - for (attr in child) { - value = child[attr]; - element = element.att(attr, value); - } - } - } else if (key === charkey) { - if (_this.options.cdata && requiresCDATA(child)) { - element = element.raw(wrapCDATA(child)); - } else { - element = element.txt(child); - } - } else if (Array.isArray(child)) { - for (index in child) { - if (!hasProp.call(child, index)) continue; - entry = child[index]; - if (typeof entry === 'string') { - if (_this.options.cdata && requiresCDATA(entry)) { - element = element.ele(key).raw(wrapCDATA(entry)).up(); - } else { - element = element.ele(key, entry).up(); - } - } else { - element = render(element.ele(key), entry).up(); - } - } - } else if (typeof child === "object") { - element = render(element.ele(key), child).up(); - } else { - if (typeof child === 'string' && _this.options.cdata && requiresCDATA(child)) { - element = element.ele(key).raw(wrapCDATA(child)).up(); - } else { - if (child == null) { - child = ''; - } - element = element.ele(key, child.toString()).up(); - } - } - } - } - return element; - }; - })(this); - rootElement = builder.create(rootName, this.options.xmldec, this.options.doctype, { - headless: this.options.headless, - allowSurrogateChars: this.options.allowSurrogateChars - }); - return render(rootElement, rootObj).end(this.options.renderOpts); - }; - - return Builder; - - })(); - -}).call(this); - - -/***/ }), - -/***/ 82573: -/***/ (function(__unused_webpack_module, exports) { - -// Generated by CoffeeScript 1.12.7 -(function() { - exports.defaults = { - "0.1": { - explicitCharkey: false, - trim: true, - normalize: true, - normalizeTags: false, - attrkey: "@", - charkey: "#", - explicitArray: false, - ignoreAttrs: false, - mergeAttrs: false, - explicitRoot: false, - validator: null, - xmlns: false, - explicitChildren: false, - childkey: '@@', - charsAsChildren: false, - includeWhiteChars: false, - async: false, - strict: true, - attrNameProcessors: null, - attrValueProcessors: null, - tagNameProcessors: null, - valueProcessors: null, - emptyTag: '' - }, - "0.2": { - explicitCharkey: false, - trim: false, - normalize: false, - normalizeTags: false, - attrkey: "$", - charkey: "_", - explicitArray: true, - ignoreAttrs: false, - mergeAttrs: false, - explicitRoot: true, - validator: null, - xmlns: false, - explicitChildren: false, - preserveChildrenOrder: false, - childkey: '$$', - charsAsChildren: false, - includeWhiteChars: false, - async: false, - strict: true, - attrNameProcessors: null, - attrValueProcessors: null, - tagNameProcessors: null, - valueProcessors: null, - rootName: 'root', - xmldec: { - 'version': '1.0', - 'encoding': 'UTF-8', - 'standalone': true - }, - doctype: null, - renderOpts: { - 'pretty': true, - 'indent': ' ', - 'newline': '\n' - }, - headless: false, - chunkSize: 10000, - emptyTag: '', - cdata: false - } - }; - -}).call(this); - - -/***/ }), - -/***/ 98754: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -// Generated by CoffeeScript 1.12.7 -(function() { - "use strict"; - var bom, defaults, events, isEmpty, processItem, processors, sax, setImmediate, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - - sax = __nccwpck_require__(73977); - - events = __nccwpck_require__(82361); - - bom = __nccwpck_require__(2441); - - processors = __nccwpck_require__(77406); - - setImmediate = (__nccwpck_require__(39512).setImmediate); - - defaults = (__nccwpck_require__(82573).defaults); - - isEmpty = function(thing) { - return typeof thing === "object" && (thing != null) && Object.keys(thing).length === 0; - }; - - processItem = function(processors, item, key) { - var i, len, process; - for (i = 0, len = processors.length; i < len; i++) { - process = processors[i]; - item = process(item, key); - } - return item; - }; - - exports.Parser = (function(superClass) { - extend(Parser, superClass); - - function Parser(opts) { - this.parseString = bind(this.parseString, this); - this.reset = bind(this.reset, this); - this.assignOrPush = bind(this.assignOrPush, this); - this.processAsync = bind(this.processAsync, this); - var key, ref, value; - if (!(this instanceof exports.Parser)) { - return new exports.Parser(opts); - } - this.options = {}; - ref = defaults["0.2"]; - for (key in ref) { - if (!hasProp.call(ref, key)) continue; - value = ref[key]; - this.options[key] = value; - } - for (key in opts) { - if (!hasProp.call(opts, key)) continue; - value = opts[key]; - this.options[key] = value; - } - if (this.options.xmlns) { - this.options.xmlnskey = this.options.attrkey + "ns"; - } - if (this.options.normalizeTags) { - if (!this.options.tagNameProcessors) { - this.options.tagNameProcessors = []; - } - this.options.tagNameProcessors.unshift(processors.normalize); - } - this.reset(); - } - - Parser.prototype.processAsync = function() { - var chunk, err; - try { - if (this.remaining.length <= this.options.chunkSize) { - chunk = this.remaining; - this.remaining = ''; - this.saxParser = this.saxParser.write(chunk); - return this.saxParser.close(); - } else { - chunk = this.remaining.substr(0, this.options.chunkSize); - this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length); - this.saxParser = this.saxParser.write(chunk); - return setImmediate(this.processAsync); - } - } catch (error1) { - err = error1; - if (!this.saxParser.errThrown) { - this.saxParser.errThrown = true; - return this.emit(err); - } - } - }; - - Parser.prototype.assignOrPush = function(obj, key, newValue) { - if (!(key in obj)) { - if (!this.options.explicitArray) { - return obj[key] = newValue; - } else { - return obj[key] = [newValue]; - } - } else { - if (!(obj[key] instanceof Array)) { - obj[key] = [obj[key]]; - } - return obj[key].push(newValue); - } - }; - - Parser.prototype.reset = function() { - var attrkey, charkey, ontext, stack; - this.removeAllListeners(); - this.saxParser = sax.parser(this.options.strict, { - trim: false, - normalize: false, - xmlns: this.options.xmlns - }); - this.saxParser.errThrown = false; - this.saxParser.onerror = (function(_this) { - return function(error) { - _this.saxParser.resume(); - if (!_this.saxParser.errThrown) { - _this.saxParser.errThrown = true; - return _this.emit("error", error); - } - }; - })(this); - this.saxParser.onend = (function(_this) { - return function() { - if (!_this.saxParser.ended) { - _this.saxParser.ended = true; - return _this.emit("end", _this.resultObject); - } - }; - })(this); - this.saxParser.ended = false; - this.EXPLICIT_CHARKEY = this.options.explicitCharkey; - this.resultObject = null; - stack = []; - attrkey = this.options.attrkey; - charkey = this.options.charkey; - this.saxParser.onopentag = (function(_this) { - return function(node) { - var key, newValue, obj, processedKey, ref; - obj = {}; - obj[charkey] = ""; - if (!_this.options.ignoreAttrs) { - ref = node.attributes; - for (key in ref) { - if (!hasProp.call(ref, key)) continue; - if (!(attrkey in obj) && !_this.options.mergeAttrs) { - obj[attrkey] = {}; - } - newValue = _this.options.attrValueProcessors ? processItem(_this.options.attrValueProcessors, node.attributes[key], key) : node.attributes[key]; - processedKey = _this.options.attrNameProcessors ? processItem(_this.options.attrNameProcessors, key) : key; - if (_this.options.mergeAttrs) { - _this.assignOrPush(obj, processedKey, newValue); - } else { - obj[attrkey][processedKey] = newValue; - } - } - } - obj["#name"] = _this.options.tagNameProcessors ? processItem(_this.options.tagNameProcessors, node.name) : node.name; - if (_this.options.xmlns) { - obj[_this.options.xmlnskey] = { - uri: node.uri, - local: node.local - }; - } - return stack.push(obj); - }; - })(this); - this.saxParser.onclosetag = (function(_this) { - return function() { - var cdata, emptyStr, key, node, nodeName, obj, objClone, old, s, xpath; - obj = stack.pop(); - nodeName = obj["#name"]; - if (!_this.options.explicitChildren || !_this.options.preserveChildrenOrder) { - delete obj["#name"]; - } - if (obj.cdata === true) { - cdata = obj.cdata; - delete obj.cdata; - } - s = stack[stack.length - 1]; - if (obj[charkey].match(/^\s*$/) && !cdata) { - emptyStr = obj[charkey]; - delete obj[charkey]; - } else { - if (_this.options.trim) { - obj[charkey] = obj[charkey].trim(); - } - if (_this.options.normalize) { - obj[charkey] = obj[charkey].replace(/\s{2,}/g, " ").trim(); - } - obj[charkey] = _this.options.valueProcessors ? processItem(_this.options.valueProcessors, obj[charkey], nodeName) : obj[charkey]; - if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) { - obj = obj[charkey]; - } - } - if (isEmpty(obj)) { - obj = _this.options.emptyTag !== '' ? _this.options.emptyTag : emptyStr; - } - if (_this.options.validator != null) { - xpath = "/" + ((function() { - var i, len, results; - results = []; - for (i = 0, len = stack.length; i < len; i++) { - node = stack[i]; - results.push(node["#name"]); - } - return results; - })()).concat(nodeName).join("/"); - (function() { - var err; - try { - return obj = _this.options.validator(xpath, s && s[nodeName], obj); - } catch (error1) { - err = error1; - return _this.emit("error", err); - } - })(); - } - if (_this.options.explicitChildren && !_this.options.mergeAttrs && typeof obj === 'object') { - if (!_this.options.preserveChildrenOrder) { - node = {}; - if (_this.options.attrkey in obj) { - node[_this.options.attrkey] = obj[_this.options.attrkey]; - delete obj[_this.options.attrkey]; - } - if (!_this.options.charsAsChildren && _this.options.charkey in obj) { - node[_this.options.charkey] = obj[_this.options.charkey]; - delete obj[_this.options.charkey]; - } - if (Object.getOwnPropertyNames(obj).length > 0) { - node[_this.options.childkey] = obj; - } - obj = node; - } else if (s) { - s[_this.options.childkey] = s[_this.options.childkey] || []; - objClone = {}; - for (key in obj) { - if (!hasProp.call(obj, key)) continue; - objClone[key] = obj[key]; - } - s[_this.options.childkey].push(objClone); - delete obj["#name"]; - if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) { - obj = obj[charkey]; - } - } - } - if (stack.length > 0) { - return _this.assignOrPush(s, nodeName, obj); - } else { - if (_this.options.explicitRoot) { - old = obj; - obj = {}; - obj[nodeName] = old; - } - _this.resultObject = obj; - _this.saxParser.ended = true; - return _this.emit("end", _this.resultObject); - } - }; - })(this); - ontext = (function(_this) { - return function(text) { - var charChild, s; - s = stack[stack.length - 1]; - if (s) { - s[charkey] += text; - if (_this.options.explicitChildren && _this.options.preserveChildrenOrder && _this.options.charsAsChildren && (_this.options.includeWhiteChars || text.replace(/\\n/g, '').trim() !== '')) { - s[_this.options.childkey] = s[_this.options.childkey] || []; - charChild = { - '#name': '__text__' - }; - charChild[charkey] = text; - if (_this.options.normalize) { - charChild[charkey] = charChild[charkey].replace(/\s{2,}/g, " ").trim(); - } - s[_this.options.childkey].push(charChild); - } - return s; - } - }; - })(this); - this.saxParser.ontext = ontext; - return this.saxParser.oncdata = (function(_this) { - return function(text) { - var s; - s = ontext(text); - if (s) { - return s.cdata = true; - } - }; - })(this); - }; - - Parser.prototype.parseString = function(str, cb) { - var err; - if ((cb != null) && typeof cb === "function") { - this.on("end", function(result) { - this.reset(); - return cb(null, result); - }); - this.on("error", function(err) { - this.reset(); - return cb(err); - }); - } - try { - str = str.toString(); - if (str.trim() === '') { - this.emit("end", null); - return true; - } - str = bom.stripBOM(str); - if (this.options.async) { - this.remaining = str; - setImmediate(this.processAsync); - return this.saxParser; - } - return this.saxParser.write(str).close(); - } catch (error1) { - err = error1; - if (!(this.saxParser.errThrown || this.saxParser.ended)) { - this.emit('error', err); - return this.saxParser.errThrown = true; - } else if (this.saxParser.ended) { - throw err; - } - } - }; - - return Parser; - - })(events.EventEmitter); - - exports.parseString = function(str, a, b) { - var cb, options, parser; - if (b != null) { - if (typeof b === 'function') { - cb = b; - } - if (typeof a === 'object') { - options = a; - } - } else { - if (typeof a === 'function') { - cb = a; - } - options = {}; - } - parser = new exports.Parser(options); - return parser.parseString(str, cb); - }; - -}).call(this); - - -/***/ }), - -/***/ 77406: -/***/ (function(__unused_webpack_module, exports) { - -// Generated by CoffeeScript 1.12.7 -(function() { - "use strict"; - var prefixMatch; - - prefixMatch = new RegExp(/(?!xmlns)^.*:/); - - exports.normalize = function(str) { - return str.toLowerCase(); - }; - - exports.firstCharLowerCase = function(str) { - return str.charAt(0).toLowerCase() + str.slice(1); - }; - - exports.stripPrefix = function(str) { - return str.replace(prefixMatch, ''); - }; - - exports.parseNumbers = function(str) { - if (!isNaN(str)) { - str = str % 1 === 0 ? parseInt(str, 10) : parseFloat(str); - } - return str; - }; - - exports.parseBooleans = function(str) { - if (/^(?:true|false)$/i.test(str)) { - str = str.toLowerCase() === 'true'; - } - return str; - }; - -}).call(this); - - -/***/ }), - -/***/ 84274: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -// Generated by CoffeeScript 1.12.7 -(function() { - "use strict"; - var builder, defaults, parser, processors, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - - defaults = __nccwpck_require__(82573); - - builder = __nccwpck_require__(94213); - - parser = __nccwpck_require__(98754); - - processors = __nccwpck_require__(77406); - - exports.defaults = defaults.defaults; - - exports.processors = processors; - - exports.ValidationError = (function(superClass) { - extend(ValidationError, superClass); - - function ValidationError(message) { - this.message = message; - } - - return ValidationError; - - })(Error); - - exports.Builder = builder.Builder; - - exports.Parser = parser.Parser; - - exports.parseString = parser.parseString; - -}).call(this); - - -/***/ }), - -/***/ 73977: +/***/ 46508: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -;(function (sax) { // wrapper for non-node envs - sax.parser = function (strict, opt) { return new SAXParser(strict, opt) } - sax.SAXParser = SAXParser - sax.SAXStream = SAXStream - sax.createStream = createStream +"use strict"; - // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns. - // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)), - // since that's the earliest that a buffer overrun could occur. This way, checks are - // as rare as required, but as often as necessary to ensure never crossing this bound. - // Furthermore, buffers are only tested at most once per write(), so passing a very - // large string into write() might have undesirable effects, but this is manageable by - // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme - // edge case, result in creating at most one complete copy of the string passed in. - // Set to Infinity to have unlimited buffers. - sax.MAX_BUFFER_LENGTH = 64 * 1024 - var buffers = [ - 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype', - 'procInstName', 'procInstBody', 'entity', 'attribName', - 'attribValue', 'cdata', 'script' - ] +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; - sax.EVENTS = [ - 'text', - 'processinginstruction', - 'sgmldeclaration', - 'doctype', - 'comment', - 'opentagstart', - 'attribute', - 'opentag', - 'closetag', - 'opencdata', - 'cdata', - 'closecdata', - 'error', - 'end', - 'ready', - 'script', - 'opennamespace', - 'closenamespace' - ] +var _v = _interopRequireDefault(__nccwpck_require__(36097)); - function SAXParser (strict, opt) { - if (!(this instanceof SAXParser)) { - return new SAXParser(strict, opt) - } +var _sha = _interopRequireDefault(__nccwpck_require__(7387)); - var parser = this - clearBuffers(parser) - parser.q = parser.c = '' - parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH - parser.opt = opt || {} - parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags - parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase' - parser.tags = [] - parser.closed = parser.closedRoot = parser.sawRoot = false - parser.tag = parser.error = null - parser.strict = !!strict - parser.noscript = !!(strict || parser.opt.noscript) - parser.state = S.BEGIN - parser.strictEntities = parser.opt.strictEntities - parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES) - parser.attribList = [] - - // namespaces form a prototype chain. - // it always points at the current tag, - // which protos to its parent tag. - if (parser.opt.xmlns) { - parser.ns = Object.create(rootNS) - } - - // mostly just for error reporting - parser.trackPosition = parser.opt.position !== false - if (parser.trackPosition) { - parser.position = parser.line = parser.column = 0 - } - emit(parser, 'onready') - } - - if (!Object.create) { - Object.create = function (o) { - function F () {} - F.prototype = o - var newf = new F() - return newf - } - } - - if (!Object.keys) { - Object.keys = function (o) { - var a = [] - for (var i in o) if (o.hasOwnProperty(i)) a.push(i) - return a - } - } - - function checkBufferLength (parser) { - var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10) - var maxActual = 0 - for (var i = 0, l = buffers.length; i < l; i++) { - var len = parser[buffers[i]].length - if (len > maxAllowed) { - // Text/cdata nodes can get big, and since they're buffered, - // we can get here under normal conditions. - // Avoid issues by emitting the text node now, - // so at least it won't get any bigger. - switch (buffers[i]) { - case 'textNode': - closeText(parser) - break - - case 'cdata': - emitNode(parser, 'oncdata', parser.cdata) - parser.cdata = '' - break - - case 'script': - emitNode(parser, 'onscript', parser.script) - parser.script = '' - break - - default: - error(parser, 'Max buffer length exceeded: ' + buffers[i]) - } - } - maxActual = Math.max(maxActual, len) - } - // schedule the next check for the earliest possible buffer overrun. - var m = sax.MAX_BUFFER_LENGTH - maxActual - parser.bufferCheckPosition = m + parser.position - } - - function clearBuffers (parser) { - for (var i = 0, l = buffers.length; i < l; i++) { - parser[buffers[i]] = '' - } - } - - function flushBuffers (parser) { - closeText(parser) - if (parser.cdata !== '') { - emitNode(parser, 'oncdata', parser.cdata) - parser.cdata = '' - } - if (parser.script !== '') { - emitNode(parser, 'onscript', parser.script) - parser.script = '' - } - } - - SAXParser.prototype = { - end: function () { end(this) }, - write: write, - resume: function () { this.error = null; return this }, - close: function () { return this.write(null) }, - flush: function () { flushBuffers(this) } - } - - var Stream - try { - Stream = (__nccwpck_require__(12781).Stream) - } catch (ex) { - Stream = function () {} - } - - var streamWraps = sax.EVENTS.filter(function (ev) { - return ev !== 'error' && ev !== 'end' - }) - - function createStream (strict, opt) { - return new SAXStream(strict, opt) - } - - function SAXStream (strict, opt) { - if (!(this instanceof SAXStream)) { - return new SAXStream(strict, opt) - } - - Stream.apply(this) - - this._parser = new SAXParser(strict, opt) - this.writable = true - this.readable = true - - var me = this - - this._parser.onend = function () { - me.emit('end') - } - - this._parser.onerror = function (er) { - me.emit('error', er) - - // if didn't throw, then means error was handled. - // go ahead and clear error, so we can write again. - me._parser.error = null - } - - this._decoder = null - - streamWraps.forEach(function (ev) { - Object.defineProperty(me, 'on' + ev, { - get: function () { - return me._parser['on' + ev] - }, - set: function (h) { - if (!h) { - me.removeAllListeners(ev) - me._parser['on' + ev] = h - return h - } - me.on(ev, h) - }, - enumerable: true, - configurable: false - }) - }) - } - - SAXStream.prototype = Object.create(Stream.prototype, { - constructor: { - value: SAXStream - } - }) - - SAXStream.prototype.write = function (data) { - if (typeof Buffer === 'function' && - typeof Buffer.isBuffer === 'function' && - Buffer.isBuffer(data)) { - if (!this._decoder) { - var SD = (__nccwpck_require__(71576).StringDecoder) - this._decoder = new SD('utf8') - } - data = this._decoder.write(data) - } - - this._parser.write(data.toString()) - this.emit('data', data) - return true - } - - SAXStream.prototype.end = function (chunk) { - if (chunk && chunk.length) { - this.write(chunk) - } - this._parser.end() - return true - } - - SAXStream.prototype.on = function (ev, handler) { - var me = this - if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) { - me._parser['on' + ev] = function () { - var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments) - args.splice(0, 0, ev) - me.emit.apply(me, args) - } - } - - return Stream.prototype.on.call(me, ev, handler) - } - - // this really needs to be replaced with character classes. - // XML allows all manner of ridiculous numbers and digits. - var CDATA = '[CDATA[' - var DOCTYPE = 'DOCTYPE' - var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace' - var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/' - var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE } - - // http://www.w3.org/TR/REC-xml/#NT-NameStartChar - // This implementation works on strings, a single character at a time - // as such, it cannot ever support astral-plane characters (10000-EFFFF) - // without a significant breaking change to either this parser, or the - // JavaScript language. Implementation of an emoji-capable xml parser - // is left as an exercise for the reader. - var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ - - var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ - - var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ - var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ - - function isWhitespace (c) { - return c === ' ' || c === '\n' || c === '\r' || c === '\t' - } - - function isQuote (c) { - return c === '"' || c === '\'' - } - - function isAttribEnd (c) { - return c === '>' || isWhitespace(c) - } - - function isMatch (regex, c) { - return regex.test(c) - } - - function notMatch (regex, c) { - return !isMatch(regex, c) - } - - var S = 0 - sax.STATE = { - BEGIN: S++, // leading byte order mark or whitespace - BEGIN_WHITESPACE: S++, // leading whitespace - TEXT: S++, // general stuff - TEXT_ENTITY: S++, // & and such. - OPEN_WAKA: S++, // < - SGML_DECL: S++, // - SCRIPT: S++, //